X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2F__init__.py;h=95add9eb1102d669983f6647adc6ffb9d7ad58d9;hb=db30f02b50a565091376b316208bfdddd729b4ed;hp=62ecdf6b6c97b766ed320488bcdf208307102be1;hpb=e314ba675b6ce6683395d04e4621aae2b5aca0ec;p=youtube-dl diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py index 62ecdf6b6..95add9eb1 100644 --- a/youtube_dl/__init__.py +++ b/youtube_dl/__init__.py @@ -21,6 +21,7 @@ __authors__ = ( 'Filippo Valsorda', 'Christian Albrecht', 'Dave Vasilevsky', + 'Jaime Marquínez Ferrándiz', ) __license__ = 'Public Domain' @@ -40,7 +41,7 @@ from .utils import * from .update import update_self from .version import __version__ from .FileDownloader import * -from .InfoExtractors import * +from .InfoExtractors import gen_extractors from .PostProcessor import * def parseOpts(): @@ -247,7 +248,7 @@ def parseOpts(): postproc.add_option('-x', '--extract-audio', action='store_true', dest='extractaudio', default=False, help='convert video files to audio-only files (requires ffmpeg or avconv and ffprobe or avprobe)') postproc.add_option('--audio-format', metavar='FORMAT', dest='audioformat', default='best', - help='"best", "aac", "vorbis", "mp3", "m4a", or "wav"; best by default') + help='"best", "aac", "vorbis", "mp3", "m4a", "opus", or "wav"; best by default') postproc.add_option('--audio-quality', metavar='QUALITY', dest='audioquality', default='5', help='ffmpeg/avconv audio quality specification, insert a value between 0 (better) and 9 (worse) for VBR or a specific bitrate like 128K (default 5)') postproc.add_option('-k', '--keep-video', action='store_true', dest='keepvideo', default=False, @@ -274,52 +275,13 @@ def parseOpts(): return parser, opts, args -def gen_extractors(): - """ Return a list of an instance of every supported extractor. - The order does matter; the first extractor matched is the one handling the URL. - """ - return [ - YoutubePlaylistIE(), - YoutubeChannelIE(), - YoutubeUserIE(), - YoutubeSearchIE(), - YoutubeIE(), - MetacafeIE(), - DailymotionIE(), - GoogleSearchIE(), - PhotobucketIE(), - YahooIE(), - YahooSearchIE(), - DepositFilesIE(), - FacebookIE(), - BlipTVUserIE(), - BlipTVIE(), - VimeoIE(), - MyVideoIE(), - ComedyCentralIE(), - EscapistIE(), - CollegeHumorIE(), - XVideosIE(), - SoundcloudIE(), - InfoQIE(), - MixcloudIE(), - StanfordOpenClassroomIE(), - MTVIE(), - YoukuIE(), - XNXXIE(), - GooglePlusIE(), - ArteTvIE(), - NBAIE(), - JustinTVIE(), - FunnyOrDieIE(), - TweetReelIE(), - SteamIE(), - GenericIE() - ] - def _real_main(): parser, opts, args = parseOpts() + # Update version + if opts.update_self: + update_self(fd.to_screen, opts.verbose, sys.argv[0]) + # Open appropriate CookieJar if opts.cookiefile is None: jar = compat_cookiejar.CookieJar() @@ -412,7 +374,7 @@ def _real_main(): except (TypeError, ValueError) as err: parser.error(u'invalid playlist end number specified') if opts.extractaudio: - if opts.audioformat not in ['best', 'aac', 'mp3', 'vorbis', 'm4a', 'wav']: + if opts.audioformat not in ['best', 'aac', 'mp3', 'm4a', 'opus', 'vorbis', 'wav']: parser.error(u'invalid audio format specified') if opts.audioquality: opts.audioquality = opts.audioquality.strip('k').strip('K') @@ -497,10 +459,6 @@ def _real_main(): if opts.extractaudio: fd.add_post_processor(FFmpegExtractAudioPP(preferredcodec=opts.audioformat, preferredquality=opts.audioquality, keepvideo=opts.keepvideo, nopostoverwrites=opts.nopostoverwrites)) - # Update version - if opts.update_self: - update_self(fd.to_screen, opts.verbose, sys.argv[0]) - # Maybe do nothing if len(all_urls) < 1: if not opts.update_self: