Пример #1
0
 def get_info(self):
     ydl = YoutubeDL({"quiet": True, "prefer_insecure": True})
     ydl.add_default_info_extractors()
     try:
         info = ydl.extract_info(self.url, download=False)
     except DownloadError:
         info = None
     return info
Пример #2
0
 def get_info(self):
     ydl = YoutubeDL({"quiet": True, "prefer_insecure": True})
     ydl.add_default_info_extractors()
     try:
         info = ydl.extract_info(self.url, download=False)
     except DownloadError:
         info = None
     return info
Пример #3
0
 def extractYoutubeDL(self, url, video):
     links = {}
     try:
         from youtube_dl.YoutubeDL import YoutubeDL, ExtractorError
     except ImportError:
         util.error("no youtube-dl installed!")
         return links
     ydl = YoutubeDL({'youtube_include_dash_manifest':False}, auto_init=False)
     ydl.add_info_extractor(ydl.get_info_extractor("Youtube"))
     try:
         res = ydl.extract_info(url, False, ie_key="Youtube")
     except ExtractorError as e:
         util.error(str(e))
         return links
     for e in res['formats']:
         links[int(e['format_id'])] = e['url']
     return links
Пример #4
0
 def extractYoutubeDL(self, url, video):
     links = {}
     try:
         from youtube_dl.YoutubeDL import YoutubeDL, ExtractorError
     except ImportError:
         util.error("no youtube-dl installed!")
         return links
     ydl = YoutubeDL({'youtube_include_dash_manifest': False},
                     auto_init=False)
     ydl.add_info_extractor(ydl.get_info_extractor("Youtube"))
     try:
         res = ydl.extract_info(url, False, ie_key="Youtube")
     except ExtractorError as e:
         util.error(str(e))
         return links
     for e in res['formats']:
         links[int(e['format_id'])] = e['url']
     return links