if opts.extractaudio: fd.add_post_processor(FFmpegExtractAudioPP(preferredcodec=opts.audioformat, preferredquality=opts.audioquality, keepvideo=opts.keepvideo)) # Update version if opts.update_self: updateSelf(fd, sys.argv[0]) # Maybe do nothing if len(all_urls) < 1: if not opts.update_self: parser.error(u'you must provide at least one URL') else: sys.exit() try: retcode = fd.download(all_urls) except MaxDownloadsReached: fd.to_screen(u'--max-download limit reached, aborting.') retcode = 101 # Dump cookie jar if requested if opts.cookiefile is not None: try: jar.save() except (IOError, OSError), err: sys.exit(u'ERROR: unable to save cookie jar') sys.exit(retcode) def main(): try:
if opts.extractaudio: fd.add_post_processor(FFmpegExtractAudioPP(preferredcodec=opts.audioformat, preferredquality=opts.audioquality, keepvideo=opts.keepvideo)) # Update version if opts.update_self: updateSelf(fd, sys.argv[0]) # Maybe do nothing if len(all_urls) < 1: if not opts.update_self: parser.error(u'you must provide at least one URL') else: sys.exit() try: videoData = fd.download(all_urls) except MaxDownloadsReached: fd.to_screen(u'--max-download limit reached, aborting.') videoData = 101 # Dump cookie jar if requested if opts.cookiefile is not None: try: jar.save() except (IOError, OSError), err: sys.exit(u'ERROR: unable to save cookie jar') # sys.exit(retcode) print videoData return videoData
preferredquality=opts.audioquality, keepvideo=opts.keepvideo)) # Update version if opts.update_self: updateSelf(fd, sys.argv[0]) # Maybe do nothing if len(all_urls) < 1: if not opts.update_self: parser.error(u'you must provide at least one URL') else: sys.exit() try: retcode = fd.download(all_urls) except MaxDownloadsReached: fd.to_screen(u'--max-download limit reached, aborting.') retcode = 101 # Dump cookie jar if requested if opts.cookiefile is not None: try: jar.save() except (IOError, OSError), err: sys.exit(u'ERROR: unable to save cookie jar') sys.exit(retcode) def main():
''' Created on Jul 26, 2016 @author: jack ''' import FileDownloader if __name__ == '__main__': dubsteppath = "https://www.youtube.com/watch?v=fWRISvgAygU" dubsteppattern = "ARTIST - TITLE HH:MM:SS" catalystpath = "https://www.youtube.com/watch?v=PNjqP9JLN-c" catalystpattern = "" FileDownloader.download(catalystpath)