diff options
author | Alex Shnitman <alexta69@gmail.com> | 2021-08-17 23:53:49 +0300 |
---|---|---|
committer | Alex Shnitman <alexta69@gmail.com> | 2021-08-17 23:53:49 +0300 |
commit | 6e986a88ca8217e8546e8648a149e2be7aa087da (patch) | |
tree | 7808f3db734f04c013b686e10ee7b1abbbd1b0c9 | |
parent | Merge pull request #38 from Rpsl/retry_button (diff) | |
download | metube-6e986a88ca8217e8546e8648a149e2be7aa087da.tar.gz metube-6e986a88ca8217e8546e8648a149e2be7aa087da.tar.bz2 metube-6e986a88ca8217e8546e8648a149e2be7aa087da.zip |
switched to the yt-dlp fork of youtube-dl (closes #41)
-rw-r--r-- | .github/workflows/update-yt-dlp.yml (renamed from .github/workflows/update-youtube-dl.yml) | 13 | ||||
-rw-r--r-- | Pipfile | 2 | ||||
-rw-r--r-- | Pipfile.lock | 117 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | app/main.py | 2 | ||||
-rw-r--r-- | app/ytdl.py | 24 |
6 files changed, 125 insertions, 35 deletions
diff --git a/.github/workflows/update-youtube-dl.yml b/.github/workflows/update-yt-dlp.yml index 4c23b2a..5754774 100644 --- a/.github/workflows/update-youtube-dl.yml +++ b/.github/workflows/update-yt-dlp.yml @@ -1,11 +1,11 @@ -name: update-youtube-dl +name: update-yt-dlp on: schedule: - cron: '0 0 * * *' jobs: - update-youtube-dl : + update-yt-dlp : runs-on: ubuntu-latest steps: - @@ -19,16 +19,15 @@ jobs: with: python-version: '3.8' - - name: Update youtube-dl + name: Update yt-dlp run: | pip install pipenv pipenv sync - VER=`pipenv run pip list -o | awk '$1 == "youtube-dl" {print $3}'` + VER=`pipenv run pip list -o | awk '$1 == "yt-dlp" {print $3}'` if [ -n "$VER" ]; then - pipenv update --selective-upgrade youtube-dl + pipenv update --selective-upgrade yt-dlp git config --global user.email "updater@metube" git config --global user.name "AutoUpdater" - git add Pipfile.lock - git commit -m 'upgraded youtube-dl' + git commit -m 'upgraded yt-dlp' Pipfile.lock git push fi @@ -9,7 +9,7 @@ pylint = "*" [packages] aiohttp = "*" python-socketio = "~=4.0" -youtube-dl = "*" +yt-dlp = "*" [requires] python_version = "3.8" diff --git a/Pipfile.lock b/Pipfile.lock index 2ea90cc..c5598ea 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "3dd00449a36ed996966c79bddda7d4e1f7ec2e35e58a9d460c687ddf0d10ba5b" + "sha256": "b6d6a0d5b5417835d863fdb59e3d9946c3462a279be17c27af6dc66c2608c0f7" }, "pipfile-spec": 6, "requires": { @@ -134,6 +134,50 @@ "markers": "python_version >= '3.6'", "version": "==5.1.0" }, + "mutagen": { + "hashes": [ + "sha256:6397602efb3c2d7baebd2166ed85731ae1c1d475abca22090b7141ff5034b3e1", + "sha256:9c9f243fcec7f410f138cb12c21c84c64fde4195481a30c9bfb05b5f003adfed" + ], + "markers": "python_version >= '3.5' and python_version < '4'", + "version": "==1.45.1" + }, + "pycryptodome": { + "hashes": [ + "sha256:09c1555a3fa450e7eaca41ea11cd00afe7c91fef52353488e65663777d8524e0", + "sha256:12222a5edc9ca4a29de15fbd5339099c4c26c56e13c2ceddf0b920794f26165d", + "sha256:1723ebee5561628ce96748501cdaa7afaa67329d753933296321f0be55358dce", + "sha256:1c5e1ca507de2ad93474be5cfe2bfa76b7cf039a1a32fc196f40935944871a06", + "sha256:2603c98ae04aac675fefcf71a6c87dc4bb74a75e9071ae3923bbc91a59f08d35", + "sha256:2dea65df54349cdfa43d6b2e8edb83f5f8d6861e5cf7b1fbc3e34c5694c85e27", + "sha256:31c1df17b3dc5f39600a4057d7db53ac372f492c955b9b75dd439f5d8b460129", + "sha256:38661348ecb71476037f1e1f553159b80d256c00f6c0b00502acac891f7116d9", + "sha256:3e2e3a06580c5f190df843cdb90ea28d61099cf4924334d5297a995de68e4673", + "sha256:3f840c49d38986f6e17dbc0673d37947c88bc9d2d9dba1c01b979b36f8447db1", + "sha256:501ab36aae360e31d0ec370cf5ce8ace6cb4112060d099b993bc02b36ac83fb6", + "sha256:60386d1d4cfaad299803b45a5bc2089696eaf6cdd56f9fc17479a6f89595cfc8", + "sha256:6260e24d41149268122dd39d4ebd5941e9d107f49463f7e071fd397e29923b0c", + "sha256:6bbf7fee7b7948b29d7e71fcacf48bac0c57fb41332007061a933f2d996f9713", + "sha256:6d2df5223b12437e644ce0a3be7809471ffa71de44ccd28b02180401982594a6", + "sha256:758949ca62690b1540dfb24ad773c6da9cd0e425189e83e39c038bbd52b8e438", + "sha256:77997519d8eb8a4adcd9a47b9cec18f9b323e296986528186c0e9a7a15d6a07e", + "sha256:7fd519b89585abf57bf47d90166903ec7b43af4fe23c92273ea09e6336af5c07", + "sha256:98213ac2b18dc1969a47bc65a79a8fca02a414249d0c8635abb081c7f38c91b6", + "sha256:99b2f3fc51d308286071d0953f92055504a6ffe829a832a9fc7a04318a7683dd", + "sha256:9b6f711b25e01931f1c61ce0115245a23cdc8b80bf8539ac0363bdcf27d649b6", + "sha256:a3105a0eb63eacf98c2ecb0eb4aa03f77f40fbac2bdde22020bb8a536b226bb8", + "sha256:a8eb8b6ea09ec1c2535bf39914377bc8abcab2c7d30fa9225eb4fe412024e427", + "sha256:a92d5c414e8ee1249e850789052608f582416e82422502dc0ac8c577808a9067", + "sha256:d3d6958d53ad307df5e8469cc44474a75393a434addf20ecd451f38a72fe29b8", + "sha256:e0a4d5933a88a2c98bbe19c0c722f5483dc628d7a38338ac2cb64a7dbd34064b", + "sha256:e3bf558c6aeb49afa9f0c06cee7fb5947ee5a1ff3bd794b653d39926b49077fa", + "sha256:e61e363d9a5d7916f3a4ce984a929514c0df3daf3b1b2eb5e6edbb131ee771cf", + "sha256:f977cdf725b20f6b8229b0c87acb98c7717e742ef9f46b113985303ae12a99da", + "sha256:fc7489a50323a0df02378bc2fff86eb69d94cc5639914346c736be981c6a02e7" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", + "version": "==3.10.1" + }, "python-engineio": { "hashes": [ "sha256:5a9e6086d192463b04a1428ff1f85b6ba631bbb19d453b144ffc04f530542b84", @@ -154,7 +198,7 @@ "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'", "version": "==1.16.0" }, "typing-extensions": { @@ -165,6 +209,45 @@ ], "version": "==3.10.0.0" }, + "websockets": { + "hashes": [ + "sha256:0dd4eb8e0bbf365d6f652711ce21b8fd2b596f873d32aabb0fbb53ec604418cc", + "sha256:1d0971cc7251aeff955aa742ec541ee8aaea4bb2ebf0245748fbec62f744a37e", + "sha256:1d6b4fddb12ab9adf87b843cd4316c4bd602db8d5efd2fb83147f0458fe85135", + "sha256:230a3506df6b5f446fed2398e58dcaafdff12d67fe1397dff196411a9e820d02", + "sha256:276d2339ebf0df4f45df453923ebd2270b87900eda5dfd4a6b0cfa15f82111c3", + "sha256:2cf04601633a4ec176b9cc3d3e73789c037641001dbfaf7c411f89cd3e04fcaf", + "sha256:3ddff38894c7857c476feb3538dd847514379d6dc844961dc99f04b0384b1b1b", + "sha256:48c222feb3ced18f3dc61168ca18952a22fb88e5eb8902d2bf1b50faefdc34a2", + "sha256:51d04df04ed9d08077d10ccbe21e6805791b78eac49d16d30a1f1fe2e44ba0af", + "sha256:597c28f3aa7a09e8c070a86b03107094ee5cdafcc0d55f2f2eac92faac8dc67d", + "sha256:5c8f0d82ea2468282e08b0cf5307f3ad022290ed50c45d5cb7767957ca782880", + "sha256:7189e51955f9268b2bdd6cc537e0faa06f8fffda7fb386e5922c6391de51b077", + "sha256:7df3596838b2a0c07c6f6d67752c53859a54993d4f062689fdf547cb56d0f84f", + "sha256:826ccf85d4514609219725ba4a7abd569228c2c9f1968e8be05be366f68291ec", + "sha256:836d14eb53b500fd92bd5db2fc5894f7c72b634f9c2a28f546f75967503d8e25", + "sha256:85db8090ba94e22d964498a47fdd933b8875a1add6ebc514c7ac8703eb97bbf0", + "sha256:85e701a6c316b7067f1e8675c638036a796fe5116783a4c932e7eb8e305a3ffe", + "sha256:900589e19200be76dd7cbaa95e9771605b5ce3f62512d039fb3bc5da9014912a", + "sha256:9147868bb0cc01e6846606cd65cbf9c58598f187b96d14dd1ca17338b08793bb", + "sha256:9e7fdc775fe7403dbd8bc883ba59576a6232eac96dacb56512daacf7af5d618d", + "sha256:ab5ee15d3462198c794c49ccd31773d8a2b8c17d622aa184f669d2b98c2f0857", + "sha256:ad893d889bc700a5835e0a95a3e4f2c39e91577ab232a3dc03c262a0f8fc4b5c", + "sha256:b2e71c4670ebe1067fa8632f0d081e47254ee2d3d409de54168b43b0ba9147e0", + "sha256:b43b13e5622c5a53ab12f3272e6f42f1ce37cd5b6684b2676cb365403295cd40", + "sha256:b4ad84b156cf50529b8ac5cc1638c2cf8680490e3fccb6121316c8c02620a2e4", + "sha256:be5fd35e99970518547edc906efab29afd392319f020c3c58b0e1a158e16ed20", + "sha256:caa68c95bc1776d3521f81eeb4d5b9438be92514ec2a79fececda814099c8314", + "sha256:d144b350045c53c8ff09aa1cfa955012dd32f00c7e0862c199edcabb1a8b32da", + "sha256:d2c2d9b24d3c65b5a02cac12cbb4e4194e590314519ed49db2f67ef561c3cf58", + "sha256:e9e5fd6dbdf95d99bc03732ded1fc8ef22ebbc05999ac7e0c7bf57fe6e4e5ae2", + "sha256:ebf459a1c069f9866d8569439c06193c586e72c9330db1390af7c6a0a32c4afd", + "sha256:f31722f1c033c198aa4a39a01905951c00bd1c74f922e8afc1b1c62adbcdd56a", + "sha256:f68c352a68e5fdf1e97288d5cec9296664c590c25932a8476224124aaf90dbcd" + ], + "markers": "python_full_version >= '3.6.1'", + "version": "==9.1" + }, "yarl": { "hashes": [ "sha256:00d7ad91b6583602eb9c1d085a2cf281ada267e9a197e8b7cae487dadbfa293e", @@ -208,31 +291,31 @@ "markers": "python_version >= '3.6'", "version": "==1.6.3" }, - "youtube-dl": { + "yt-dlp": { "hashes": [ - "sha256:263e04d53fb8ba3dfbd246ad09b7d388e896c132a20cc770c26ee7684de050ac", - "sha256:cb2d3ee002158ede783e97a82c95f3817594df54367ea6a77ce5ceea4772f0ab" + "sha256:7c12ead6df0744c87b7d78e1cf4678f9e1c6e6cd1517af9b9cec3af4f2aca69a", + "sha256:8da1bf4dc4641d37d137443c4783109ee8393caad5e0d270d9d1d534e8f25240" ], "index": "pypi", - "version": "==2021.6.6" + "version": "==2021.8.10" } }, "develop": { "astroid": { "hashes": [ - "sha256:4db03ab5fc3340cf619dbc25e42c2cc3755154ce6009469766d7143d1fc2ee4e", - "sha256:8a398dfce302c13f14bab13e2b14fe385d32b73f4e4853b9bdfb64598baa1975" + "sha256:3975a0bd5373bdce166e60c851cfcbaf21ee96de80ec518c1f4cb3e94c3fb334", + "sha256:ab7f36e8a78b8e54a62028ba6beef7561db4cdb6f2a5009ecc44a6f42b5697ef" ], "markers": "python_version ~= '3.6'", - "version": "==2.5.6" + "version": "==2.6.6" }, "isort": { "hashes": [ - "sha256:0a943902919f65c5684ac4e0154b1ad4fac6dcaa5d9f3426b732f1c8b5419be6", - "sha256:2bb1680aad211e3c9944dbce1d4ba09a989f04e238296c87fe2139faa26d655d" + "sha256:9c2ea1e62d871267b78307fe511c0838ba0da28698c5732d54e2790bf3ba9899", + "sha256:e17d6e2b81095c9db0a03a8025a957f334d6ea30b26f9ec70805411e5c7c81f2" ], - "markers": "python_version >= '3.6' and python_version < '4.0'", - "version": "==5.8.0" + "markers": "python_full_version >= '3.6.1' and python_version < '4.0'", + "version": "==5.9.3" }, "lazy-object-proxy": { "hashes": [ @@ -271,18 +354,18 @@ }, "pylint": { "hashes": [ - "sha256:0a049c5d47b629d9070c3932d13bff482b12119b6a241a93bc460b0be16953c8", - "sha256:792b38ff30903884e4a9eab814ee3523731abd3c463f3ba48d7b627e87013484" + "sha256:2e1a0eb2e8ab41d6b5dbada87f066492bb1557b12b76c47c2ee8aa8a11186594", + "sha256:8b838c8983ee1904b2de66cce9d0b96649a91901350e956d78f289c3bc87b48e" ], "index": "pypi", - "version": "==2.8.3" + "version": "==2.9.6" }, "toml": { "hashes": [ "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b", "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f" ], - "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2'", "version": "==0.10.2" }, "wrapt": { @@ -3,7 +3,7 @@ ![Build Status](https://github.com/alexta69/metube/actions/workflows/main.yml/badge.svg)
![Docker Pulls](https://img.shields.io/docker/pulls/alexta69/metube.svg)
-Web GUI for youtube-dl with playlist support. Allows you to download videos from YouTube and dozens of other sites (https://ytdl-org.github.io/youtube-dl/supportedsites.html).
+Web GUI for youtube-dl (using the [yt-dlp](https://github.com/yt-dlp/yt-dlp) fork) with playlist support. Allows you to download videos from YouTube and dozens of other sites (https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md).
![screenshot1](https://github.com/alexta69/metube/raw/master/screenshot.gif)
diff --git a/app/main.py b/app/main.py index dad19e3..d94967b 100644 --- a/app/main.py +++ b/app/main.py @@ -3,9 +3,7 @@ import os
from aiohttp import web
-import asyncio
import socketio
-import time
import logging
import json
diff --git a/app/ytdl.py b/app/ytdl.py index 4475704..47cfdcd 100644 --- a/app/ytdl.py +++ b/app/ytdl.py @@ -1,6 +1,5 @@ import os
-import sys
-import youtube_dl
+import yt_dlp
from collections import OrderedDict
import asyncio
import multiprocessing
@@ -57,7 +56,18 @@ class Download: def _download(self):
try:
- ret = youtube_dl.YoutubeDL(params={
+ def put_status(st):
+ self.status_queue.put({k: v for k, v in st.items() if k in (
+ 'tmpfilename',
+ 'status',
+ 'msg',
+ 'total_bytes',
+ 'total_bytes_estimate',
+ 'downloaded_bytes',
+ 'speed',
+ 'eta',
+ )})
+ ret = yt_dlp.YoutubeDL(params={
'quiet': True,
'no_color': True,
#'skip_download': True,
@@ -65,10 +75,10 @@ class Download: 'format': self.format,
'cachedir': False,
'socket_timeout': 30,
- 'progress_hooks': [lambda d: self.status_queue.put(d)],
+ 'progress_hooks': [put_status],
}).download([self.info.url])
self.status_queue.put({'status': 'finished' if ret == 0 else 'error'})
- except youtube_dl.utils.YoutubeDLError as exc:
+ except yt_dlp.utils.YoutubeDLError as exc:
self.status_queue.put({'status': 'error', 'msg': str(exc)})
async def start(self, notifier):
@@ -129,7 +139,7 @@ class DownloadQueue: asyncio.ensure_future(self.__download())
def __extract_info(self, url):
- return youtube_dl.YoutubeDL(params={
+ return yt_dlp.YoutubeDL(params={
'quiet': True,
'no_color': True,
'extract_flat': True,
@@ -168,7 +178,7 @@ class DownloadQueue: already.add(url)
try:
entry = await asyncio.get_running_loop().run_in_executor(None, self.__extract_info, url)
- except youtube_dl.utils.YoutubeDLError as exc:
+ except yt_dlp.utils.YoutubeDLError as exc:
return {'status': 'error', 'msg': str(exc)}
return await self.__add_entry(entry, quality, already)
|