Пример #1
0
 def playYtdl2(self, url, title=None, subs=None):
   if title is None:
     title = url
   http = ythelper.skip_download(url)
   ydl = youtube_dl.YoutubeDL({'outtmpl': '%(id)s%(ext)s'})
   with ydl:
     result = ydl.extract_info(url,download=False)
   if 'entries' in result:
     video = result['entries'][0]
   else:
     video = result
   video_url = video['url']
   print video_url
   #return self.play2(title, video_url, subs, http)
   return video_url
Пример #2
0
  def _get_cmd(self, args):
    self.args = args
    cmd = [YTDL_PATH, "--no-part", "--no-continue", "--no-playlist", 
           "--max-downloads", "1", "--no-progress", "--output", OUT_FILE]

    if ythelper.skip_download(self.url):
      cmd.append("--simulate")
      cmd.append("--dump-single-json")

    fmat = ythelper.get_format(self.url)
    if fmat is not None:
      cmd.append("--format")
      cmd.append(fmat)

    cmd.append(self.url)
    return cmd
Пример #3
0
  def _get_cmd(self, args):
    self.args = args
    cmd = [YTDL_PATH, "--no-part", "--no-continue", "--no-playlist", 
           "--max-downloads", "1", "--no-progress", "--output", OUT_FILE]

    if ythelper.skip_download(self.url):
      cmd.append("--simulate")
      cmd.append("--dump-single-json")

    cmd.append("--format")
    fmat = ythelper.get_format(self.url)
    if fmat is not None:
      cmd.append(fmat)
    else:
      cmd.append("best")
    cmd.append(self.url)
    return cmd
Пример #4
0
 def playYtdl(self, url, title=None, subs=None):
   if title is None:
     title = url
   http = ythelper.skip_download(url)
   self.play(title, YoutubeDlProcess(url), subs, http)
Пример #5
0
 def playYtdl(self, url, title=None, subs=None):
   if title is None:
     title = url
   http = ythelper.skip_download(url)
   self.play(title, YoutubeDlProcess(url), subs, http)
Пример #6
0
 def playNoProxy(self, url, title=None, subs=None):
   if title is None:
     title = url
   http = ythelper.skip_download(url)
   self.play(title, YoutubeDlNoProxy(url), subs, http=True)
Пример #7
0
 def playURL2(self, url, title=None, subs=None):
   if title is None:
     title = url
   http = ythelper.skip_download(url)
   return self.play2(title, url, subs, http=True)