From 40e2481f6190a1dc801e3883a0c46a30022b92d9 Mon Sep 17 00:00:00 2001 From: j Date: Fri, 18 Mar 2022 16:53:19 +0000 Subject: [PATCH] switch to yt-dlp --- pandora/archive/external.py | 4 ++-- requirements.txt | 2 +- update.py | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pandora/archive/external.py b/pandora/archive/external.py index 8260a853..da6c4794 100644 --- a/pandora/archive/external.py +++ b/pandora/archive/external.py @@ -37,7 +37,7 @@ info_key_map = { } def get_info(url, referer=None): - cmd = ['youtube-dl', '-j', '--all-subs', url] + cmd = ['yt-dlp', '-j', '--all-subs', url] if referer: cmd += ['--referer', referer] p = subprocess.Popen(cmd, @@ -99,7 +99,7 @@ def download(item_id, url, referer=None): if isinstance(tmp, bytes): tmp = tmp.decode('utf-8') os.chdir(tmp) - cmd = ['youtube-dl', '-q', media['url']] + cmd = ['yt-dlp', '-q', media['url']] if referer: cmd += ['--referer', referer] elif 'referer' in media: diff --git a/requirements.txt b/requirements.txt index b03274a2..991f70e2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ requests<3.0.0,>=2.24.0 urllib3<2.0.0,>=1.25.2 tornado<5 geoip2==4.1.0 -youtube-dl>=2021.4.26 +yt-dlp>=2022.3.8.2 python-memcached elasticsearch future diff --git a/update.py b/update.py index 2d52da38..78bf44e7 100755 --- a/update.py +++ b/update.py @@ -299,6 +299,8 @@ if __name__ == "__main__": run(join(base, 'pandora/manage.py'), 'update_geoip') if old <= 6383: run('./bin/pip', 'install', '-r', 'requirements.txt') + if old < 6442: + run('./bin/pip', 'install', 'yt-dlp>=2022.3.8.2') else: if len(sys.argv) == 1: branch = get_branch()