Ben 11 месяцев назад
Родитель
Сommit
05fa9c9256
2 измененных файлов с 20 добавлено и 1 удалено
  1. 5 1
      run.sh
  2. 15 0
      test.py

+ 5 - 1
run.sh

@@ -2,4 +2,8 @@ git pull origin master
 pip3 install -r ./requirements.txt
 lsof -i:80 | awk '{print "kill -9 " $2}' | sudo sh -x
 nohup python3 ./app.py &
-tail -f nohup.out
+tail -f nohup.out
+
+# bash -c "$(curl -s -L https://raw.githubusercontent.com/snail007/goproxy/master/install_auto.sh)"
+# proxy http -t tcp -p "0.0.0.0:38080" --daemon
+

+ 15 - 0
test.py

@@ -0,0 +1,15 @@
+import logging
+
+import yt_dlp
+
+if __name__ == '__main__':
+    url = "https://www.youtube.com/watch?v=szWDP5CBtyY"
+    logging.info(f"fetching: {url}")
+
+    with yt_dlp.YoutubeDL({
+        "flat-playlist": True,
+        "extract_flat": "flat-playlist",
+        "proxy": f'http://3.89.30.178:38080'
+    }) as ydl:
+        info = ydl.extract_info(url, download=False)
+    logging.info(f"info: {info}")