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
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
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
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)
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)
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)
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)