From: Jaime Marquínez Ferrándiz Date: Fri, 26 Apr 2013 17:25:17 +0000 (+0200) Subject: Merge pull request #801 from expleo/add_referer_support X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=3820df0106d6065f50cc1eb90823906410dc9543;p=youtube-dl.git Merge pull request #801 from expleo/add_referer_support --- 3820df0106d6065f50cc1eb90823906410dc9543 diff --cc README.md index 0ab4b660c,ffb321ff9..d3073e641 --- a/README.md +++ b/README.md @@@ -27,6 -27,7 +27,8 @@@ which means you can modify it, redistri from an initial value of SIZE. --dump-user-agent display the current browser identification --user-agent UA specify a custom user agent - --referer REF specify a custom referer ++ --referer REF specify a custom referer, use if the video access ++ is restricted to one domain --list-extractors List all supported extractors and the URLs they would handle diff --cc youtube_dl/InfoExtractors.py index 4d145dfa1,d5876ad34..3450f0d17 --- a/youtube_dl/InfoExtractors.py +++ b/youtube_dl/InfoExtractors.py @@@ -1093,7 -1120,7 +1093,10 @@@ class VimeoIE(InfoExtractor) config = webpage.split(' = {config:')[1].split(',assets:')[0] config = json.loads(config) except: -- self._downloader.report_error(u'unable to extract info section') ++ if re.search('The creator of this video has not given you permission to embed it on this domain.', webpage): ++ self._downloader.report_error(u'The author has restricted the access to this video, try with the "--referer" option') ++ else: ++ self._downloader.report_error(u'unable to extract info section') return # Extract title diff --cc youtube_dl/__init__.py index 74375175d,16e74785f..d491402c6 --- a/youtube_dl/__init__.py +++ b/youtube_dl/__init__.py @@@ -140,6 -140,8 +140,9 @@@ def parseOpts(overrideArguments=None) help='display the current browser identification', default=False) general.add_option('--user-agent', dest='user_agent', help='specify a custom user agent', metavar='UA') + general.add_option('--referer', - dest='referer', help='specify a custom referer', metavar='REF', default=None) ++ dest='referer', help='specify a custom referer, use if the video access is restricted to one domain', ++ metavar='REF', default=None) general.add_option('--list-extractors', action='store_true', dest='list_extractors', help='List all supported extractors and the URLs they would handle', default=False)