From 56c87cde7d23d45dbf6acc13a8c59a1389e5df1c Mon Sep 17 00:00:00 2001 From: George Pchelkin Date: Sun, 20 Aug 2023 09:32:43 +0100 Subject: [PATCH] add support for x.com links --- poetry.lock | 77 +++++++++++++++++++++---------------------- pyproject.toml | 2 +- requirements-dev.txt | 6 ++-- requirements-docs.txt | 12 +++---- requirements.txt | 5 ++- scdlbot/__main__.py | 7 ++-- 6 files changed, 54 insertions(+), 55 deletions(-) diff --git a/poetry.lock b/poetry.lock index 6767139f2..08747c36d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -34,18 +34,17 @@ trio = ["trio (<0.22)"] [[package]] name = "apscheduler" -version = "3.10.1" +version = "3.10.4" description = "In-process task scheduler with Cron-like capabilities" optional = false python-versions = ">=3.6" files = [ - {file = "APScheduler-3.10.1-py3-none-any.whl", hash = "sha256:e813ad5ada7aff36fb08cdda746b520531eaac7757832abc204868ba78e0c8f6"}, - {file = "APScheduler-3.10.1.tar.gz", hash = "sha256:0293937d8f6051a0f493359440c1a1b93e882c57daf0197afeff0e727777b96e"}, + {file = "APScheduler-3.10.4-py3-none-any.whl", hash = "sha256:fb91e8a768632a4756a585f79ec834e0e27aad5860bac7eaa523d9ccefd87661"}, + {file = "APScheduler-3.10.4.tar.gz", hash = "sha256:e6df071b27d9be898e486bc7940a7be50b4af2e9da7c08f0744a96d4bd4cef4a"}, ] [package.dependencies] pytz = "*" -setuptools = ">=0.7" six = ">=1.4.0" tzlocal = ">=2.0,<3.dev0 || >=4.dev0" @@ -588,13 +587,13 @@ files = [ [[package]] name = "click" -version = "8.1.6" +version = "8.1.7" description = "Composable command line interface toolkit" optional = false python-versions = ">=3.7" files = [ - {file = "click-8.1.6-py3-none-any.whl", hash = "sha256:fa244bb30b3b5ee2cae3da8f55c9e5e0c0e86093306301fb418eb9dc40fbded5"}, - {file = "click-8.1.6.tar.gz", hash = "sha256:48ee849951919527a045bfe3bf7baa8a959c423134e1a5b98c05c20ba75a1cbd"}, + {file = "click-8.1.7-py3-none-any.whl", hash = "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28"}, + {file = "click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de"}, ] [package.dependencies] @@ -785,13 +784,13 @@ files = [ [[package]] name = "exceptiongroup" -version = "1.1.2" +version = "1.1.3" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" files = [ - {file = "exceptiongroup-1.1.2-py3-none-any.whl", hash = "sha256:e346e69d186172ca7cf029c8c1d16235aa0e04035e5750b4b95039e65204328f"}, - {file = "exceptiongroup-1.1.2.tar.gz", hash = "sha256:12c3e887d6485d16943a309616de20ae5582633e0a2eda17f4e10fd61c1e8af5"}, + {file = "exceptiongroup-1.1.3-py3-none-any.whl", hash = "sha256:343280667a4585d195ca1cf9cef84a4e178c4b6cf2274caef9859782b567d5e3"}, + {file = "exceptiongroup-1.1.3.tar.gz", hash = "sha256:097acd85d473d75af5bb98e41b61ff7fe35efe6675e4f9370ec6ec5126d160e9"}, ] [package.extras] @@ -2303,18 +2302,18 @@ files = [ [[package]] name = "setuptools" -version = "68.0.0" +version = "68.1.2" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "setuptools-68.0.0-py3-none-any.whl", hash = "sha256:11e52c67415a381d10d6b462ced9cfb97066179f0e871399e006c4ab101fc85f"}, - {file = "setuptools-68.0.0.tar.gz", hash = "sha256:baf1fdb41c6da4cd2eae722e135500da913332ab3f2f5c7d33af9b492acb5235"}, + {file = "setuptools-68.1.2-py3-none-any.whl", hash = "sha256:3d8083eed2d13afc9426f227b24fd1659489ec107c0e86cec2ffdde5c92e790b"}, + {file = "setuptools-68.1.2.tar.gz", hash = "sha256:3d4dfa6d95f1b101d695a6160a7626e15583af71a5f52176efa5d39a054d475d"}, ] [package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (==0.8.3)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pip-run (>=8.8)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5,<=7.1.2)", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (==0.8.3)", "sphinx-reredirects", "sphinxcontrib-towncrier"] +testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] [[package]] @@ -2404,13 +2403,13 @@ files = [ [[package]] name = "sphinx" -version = "7.1.2" +version = "7.2.2" description = "Python documentation generator" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "sphinx-7.1.2-py3-none-any.whl", hash = "sha256:d170a81825b2fcacb6dfd5a0d7f578a053e45d3f2b153fecc948c37344eb4cbe"}, - {file = "sphinx-7.1.2.tar.gz", hash = "sha256:780f4d32f1d7d1126576e0e5ecc19dc32ab76cd24e950228dcf7b1f6d3d9e22f"}, + {file = "sphinx-7.2.2-py3-none-any.whl", hash = "sha256:ed33bc597dd8f05cd37118f64cbac0b8bf773389a628ddfe95ab9e915c9308dc"}, + {file = "sphinx-7.2.2.tar.gz", hash = "sha256:1c0abe6d4de7a6b2c2b109a2e18387bf27b240742e1b34ea42ac3ed2ac99978c"}, ] [package.dependencies] @@ -2422,7 +2421,7 @@ imagesize = ">=1.3" importlib-metadata = {version = ">=4.8", markers = "python_version < \"3.10\""} Jinja2 = ">=3.0" packaging = ">=21.0" -Pygments = ">=2.13" +Pygments = ">=2.14" requests = ">=2.25.0" snowballstemmer = ">=2.0" sphinxcontrib-applehelp = "*" @@ -2435,7 +2434,7 @@ sphinxcontrib-serializinghtml = ">=1.1.5" [package.extras] docs = ["sphinxcontrib-websupport"] lint = ["docutils-stubs", "flake8 (>=3.5.0)", "flake8-simplify", "isort", "mypy (>=0.990)", "ruff", "sphinx-lint", "types-requests"] -test = ["cython", "filelock", "html5lib", "pytest (>=4.6)"] +test = ["cython (>=3.0)", "filelock", "html5lib", "pytest (>=4.6)", "setuptools (>=67.0)"] [[package]] name = "sphinx-autodoc-typehints" @@ -2458,13 +2457,13 @@ testing = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "diff-cover (>=7.5)", "p [[package]] name = "sphinxcontrib-applehelp" -version = "1.0.6" +version = "1.0.7" description = "sphinxcontrib-applehelp is a Sphinx extension which outputs Apple help books" optional = false python-versions = ">=3.9" files = [ - {file = "sphinxcontrib_applehelp-1.0.6-py3-none-any.whl", hash = "sha256:c0578efa23cab5a2f3aaa8af5691b952433f4fdfaac255befd3452448e7ea4a4"}, - {file = "sphinxcontrib_applehelp-1.0.6.tar.gz", hash = "sha256:a59274de7a952a99af36b8a5092352d9249279c0e3280b7dceaae8e15873c942"}, + {file = "sphinxcontrib_applehelp-1.0.7-py3-none-any.whl", hash = "sha256:094c4d56209d1734e7d252f6e0b3ccc090bd52ee56807a5d9315b19c122ab15d"}, + {file = "sphinxcontrib_applehelp-1.0.7.tar.gz", hash = "sha256:39fdc8d762d33b01a7d8f026a3b7d71563ea3b72787d5f00ad8465bd9d6dfbfa"}, ] [package.dependencies] @@ -2476,13 +2475,13 @@ test = ["pytest"] [[package]] name = "sphinxcontrib-devhelp" -version = "1.0.4" +version = "1.0.5" description = "sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp documents" optional = false python-versions = ">=3.9" files = [ - {file = "sphinxcontrib_devhelp-1.0.4-py3-none-any.whl", hash = "sha256:d4e20a17f78865d4096733989b5efa0d5e7743900e98e1f6ecd6f489380febc8"}, - {file = "sphinxcontrib_devhelp-1.0.4.tar.gz", hash = "sha256:4fd751c63dc40895ac8740948f26bf1a3c87e4e441cc008672abd1cb2bc8a3d1"}, + {file = "sphinxcontrib_devhelp-1.0.5-py3-none-any.whl", hash = "sha256:fe8009aed765188f08fcaadbb3ea0d90ce8ae2d76710b7e29ea7d047177dae2f"}, + {file = "sphinxcontrib_devhelp-1.0.5.tar.gz", hash = "sha256:63b41e0d38207ca40ebbeabcf4d8e51f76c03e78cd61abe118cf4435c73d4212"}, ] [package.dependencies] @@ -2494,13 +2493,13 @@ test = ["pytest"] [[package]] name = "sphinxcontrib-htmlhelp" -version = "2.0.3" +version = "2.0.4" description = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files" optional = false python-versions = ">=3.9" files = [ - {file = "sphinxcontrib_htmlhelp-2.0.3-py3-none-any.whl", hash = "sha256:abee4e6c5471203ad2fc40dc6a16ed99884a5d6b15a6f79c9269a7e82cf04149"}, - {file = "sphinxcontrib_htmlhelp-2.0.3.tar.gz", hash = "sha256:14358d0f88ccf58447f2b54343cdcc0012f32de2f8d27cf934fdbc0b362f9597"}, + {file = "sphinxcontrib_htmlhelp-2.0.4-py3-none-any.whl", hash = "sha256:8001661c077a73c29beaf4a79968d0726103c5605e27db92b9ebed8bab1359e9"}, + {file = "sphinxcontrib_htmlhelp-2.0.4.tar.gz", hash = "sha256:6c26a118a05b76000738429b724a0568dbde5b72391a688577da08f11891092a"}, ] [package.dependencies] @@ -2526,13 +2525,13 @@ test = ["flake8", "mypy", "pytest"] [[package]] name = "sphinxcontrib-qthelp" -version = "1.0.5" +version = "1.0.6" description = "sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp documents" optional = false python-versions = ">=3.9" files = [ - {file = "sphinxcontrib_qthelp-1.0.5-py3-none-any.whl", hash = "sha256:962730a6ad15d21fd6760b14c9e95c00a097413595aa6ee871dd9dfa4b002a16"}, - {file = "sphinxcontrib_qthelp-1.0.5.tar.gz", hash = "sha256:d31d1a1beaf3894866bb318fb712f1edc82687f1c06235a01e5b2c50c36d5c40"}, + {file = "sphinxcontrib_qthelp-1.0.6-py3-none-any.whl", hash = "sha256:bf76886ee7470b934e363da7a954ea2825650013d367728588732c7350f49ea4"}, + {file = "sphinxcontrib_qthelp-1.0.6.tar.gz", hash = "sha256:62b9d1a186ab7f5ee3356d906f648cacb7a6bdb94d201ee7adf26db55092982d"}, ] [package.dependencies] @@ -2544,13 +2543,13 @@ test = ["pytest"] [[package]] name = "sphinxcontrib-serializinghtml" -version = "1.1.7" +version = "1.1.8" description = "sphinxcontrib-serializinghtml is a sphinx extension which outputs \"serialized\" HTML files (json and pickle)" optional = false python-versions = ">=3.9" files = [ - {file = "sphinxcontrib_serializinghtml-1.1.7-py3-none-any.whl", hash = "sha256:424164fc3a8b4355a29d5ea8b7f18199022d160c8f7b96e68bb6c50217729b87"}, - {file = "sphinxcontrib_serializinghtml-1.1.7.tar.gz", hash = "sha256:ca31afee32e1508cff4034e258060ce2c81a3b1c49e77da60fdb61f0e7a73c22"}, + {file = "sphinxcontrib_serializinghtml-1.1.8-py3-none-any.whl", hash = "sha256:27849e7227277333d3d32f17c138ee148a51fa01f888a41cd6d4e73bcabe2d06"}, + {file = "sphinxcontrib_serializinghtml-1.1.8.tar.gz", hash = "sha256:aaf3026335146e688fd209b72320314b1b278320cf232e3cda198f873838511a"}, ] [package.dependencies] @@ -2911,7 +2910,7 @@ websockets = "*" type = "git" url = "https://github.com/yt-dlp/yt-dlp.git" reference = "master" -resolved_reference = "378ae9f9fb8e8c86e6ac89c4c5b815b48ce93620" +resolved_reference = "876b70c8edf4c0147f180bd981fbc4d625cbfb9c" [[package]] name = "zipp" @@ -2931,4 +2930,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "2e8ca2546f05653d2c7ee581c79bbbfe4364b275f6546490ce0b7277f5b83d00" +content-hash = "1f5016485bb28fd4c11747f6ba3cb03de521df8018088c124687efd90d2add16" diff --git a/pyproject.toml b/pyproject.toml index 458a1369e..025f78b01 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -103,7 +103,7 @@ safety = "^2.3" optional = true [tool.poetry.group.docs.dependencies] -sphinx = "^7.1" +sphinx = "^7.2" sphinx-autodoc-typehints = "^1.24" m2r2 = "^0.3" tomli = "^2.0" diff --git a/requirements-dev.txt b/requirements-dev.txt index 60d0e0674..0b896bd50 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,7 +6,7 @@ black==23.7.0 ; python_version >= "3.9" and python_version < "4.0" cattrs==23.1.2 ; python_version >= "3.9" and python_version < "4.0" certifi==2023.7.22 ; python_version >= "3.9" and python_version < "4.0" charset-normalizer==3.2.0 ; python_version >= "3.9" and python_version < "4.0" -click==8.1.6 ; python_version >= "3.9" and python_version < "4.0" +click==8.1.7 ; python_version >= "3.9" and python_version < "4.0" colorama==0.4.6 ; python_version >= "3.9" and python_version < "4.0" and (platform_system == "Windows" or sys_platform == "win32") configupdater==3.1.1 ; python_version >= "3.9" and python_version < "4.0" darglint==1.8.1 ; python_version >= "3.9" and python_version < "4.0" @@ -16,7 +16,7 @@ docutils==0.20.1 ; python_version >= "3.9" and python_version < "4.0" dparse==0.6.3 ; python_version >= "3.9" and python_version < "4.0" dpath==2.1.6 ; python_version >= "3.9" and python_version < "4.0" eradicate==2.3.0 ; python_version >= "3.9" and python_version < "4.0" -exceptiongroup==1.1.2 ; python_version >= "3.9" and python_version < "3.11" +exceptiongroup==1.1.3 ; python_version >= "3.9" and python_version < "3.11" flake8-bandit==4.1.1 ; python_version >= "3.9" and python_version < "4.0" flake8-broken-line==1.0.0 ; python_version >= "3.9" and python_version < "4.0" flake8-bugbear==23.7.10 ; python_version >= "3.9" and python_version < "4.0" @@ -67,7 +67,7 @@ rich==13.5.2 ; python_version >= "3.9" and python_version < "4.0" ruamel-yaml-clib==0.2.7 ; platform_python_implementation == "CPython" and python_version < "3.12" and python_version >= "3.9" ruamel-yaml==0.17.32 ; python_version >= "3.9" and python_version < "4.0" safety==2.3.4 ; python_version >= "3.9" and python_version < "4.0" -setuptools==68.0.0 ; python_version >= "3.9" and python_version < "4.0" +setuptools==68.1.2 ; python_version >= "3.9" and python_version < "4.0" six==1.16.0 ; python_version >= "3.9" and python_version < "4.0" smmap==5.0.0 ; python_version >= "3.9" and python_version < "4.0" snowballstemmer==2.2.0 ; python_version >= "3.9" and python_version < "4.0" diff --git a/requirements-docs.txt b/requirements-docs.txt index 7ac9db89f..dfd9e4511 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -18,13 +18,13 @@ recommonmark==0.7.1 ; python_version >= "3.9" and python_version < "4.0" requests==2.31.0 ; python_version >= "3.9" and python_version < "4.0" snowballstemmer==2.2.0 ; python_version >= "3.9" and python_version < "4.0" sphinx-autodoc-typehints==1.24.0 ; python_version >= "3.9" and python_version < "4.0" -sphinx==7.1.2 ; python_version >= "3.9" and python_version < "4.0" -sphinxcontrib-applehelp==1.0.6 ; python_version >= "3.9" and python_version < "4.0" -sphinxcontrib-devhelp==1.0.4 ; python_version >= "3.9" and python_version < "4.0" -sphinxcontrib-htmlhelp==2.0.3 ; python_version >= "3.9" and python_version < "4.0" +sphinx==7.2.2 ; python_version >= "3.9" and python_version < "4.0" +sphinxcontrib-applehelp==1.0.7 ; python_version >= "3.9" and python_version < "4.0" +sphinxcontrib-devhelp==1.0.5 ; python_version >= "3.9" and python_version < "4.0" +sphinxcontrib-htmlhelp==2.0.4 ; python_version >= "3.9" and python_version < "4.0" sphinxcontrib-jsmath==1.0.1 ; python_version >= "3.9" and python_version < "4.0" -sphinxcontrib-qthelp==1.0.5 ; python_version >= "3.9" and python_version < "4.0" -sphinxcontrib-serializinghtml==1.1.7 ; python_version >= "3.9" and python_version < "4.0" +sphinxcontrib-qthelp==1.0.6 ; python_version >= "3.9" and python_version < "4.0" +sphinxcontrib-serializinghtml==1.1.8 ; python_version >= "3.9" and python_version < "4.0" tomli==2.0.1 ; python_version >= "3.9" and python_version < "4.0" typing-extensions==4.7.1 ; python_version >= "3.9" and python_version < "4.0" urllib3==2.0.4 ; python_version >= "3.9" and python_version < "4.0" diff --git a/requirements.txt b/requirements.txt index ada659e7a..f8b91a33e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ anyio==3.7.1 ; python_version >= "3.9" and python_version < "4.0" -apscheduler==3.10.1 ; python_version >= "3.9" and python_version < "4.0" +apscheduler==3.10.4 ; python_version >= "3.9" and python_version < "4.0" args==0.1.0 ; python_version >= "3.9" and python_version < "4.0" bandcamp-downloader==0.0.13 ; python_version >= "3.9" and python_version < "4.0" beautifulsoup4==4.12.2 ; python_version >= "3.9" and python_version < "4.0" @@ -14,7 +14,7 @@ clint==0.5.1 ; python_version >= "3.9" and python_version < "4.0" dacite==1.8.1 ; python_version >= "3.9" and python_version < "4.0" demjson3==3.0.6 ; python_version >= "3.9" and python_version < "4.0" docopt==0.6.2 ; python_version >= "3.9" and python_version < "4.0" -exceptiongroup==1.1.2 ; python_version >= "3.9" and python_version < "3.11" +exceptiongroup==1.1.3 ; python_version >= "3.9" and python_version < "3.11" fake-useragent==1.2.1 ; python_version >= "3.9" and python_version < "4.0" ffmpeg-python==0.2.0 ; python_version >= "3.9" and python_version < "4.0" future==0.18.3 ; python_version >= "3.9" and python_version < "4.0" @@ -44,7 +44,6 @@ requests==2.31.0 ; python_version >= "3.9" and python_version < "4.0" requests[socks]==2.31.0 ; python_version >= "3.9" and python_version < "4.0" scdl==2.7.3 ; python_version >= "3.9" and python_version < "4.0" sdnotify==0.3.2 ; python_version >= "3.9" and python_version < "4.0" -setuptools==68.0.0 ; python_version >= "3.9" and python_version < "4.0" six==1.16.0 ; python_version >= "3.9" and python_version < "4.0" sniffio==1.3.0 ; python_version >= "3.9" and python_version < "4.0" soundcloud-v2==1.3.1 ; python_version >= "3.9" and python_version < "4.0" diff --git a/scdlbot/__main__.py b/scdlbot/__main__.py index b61ab127c..ff64bdf8d 100755 --- a/scdlbot/__main__.py +++ b/scdlbot/__main__.py @@ -221,7 +221,8 @@ def get_response_text(file_name): DOMAIN_TT = "tiktok.com" DOMAIN_IG = "instagram.com" DOMAIN_TW = "twitter.com" -DOMAINS = [DOMAIN_SC, DOMAIN_SC_API, DOMAIN_BC, DOMAIN_YT, DOMAIN_YT_BE, DOMAIN_TT, DOMAIN_IG, DOMAIN_TW] +DOMAIN_TWX = "x.com" +DOMAINS = [DOMAIN_SC, DOMAIN_SC_API, DOMAIN_BC, DOMAIN_YT, DOMAIN_YT_BE, DOMAIN_TT, DOMAIN_IG, DOMAIN_TW, DOMAIN_TWX] # TODO get rid of these dumb exceptions: @@ -727,7 +728,7 @@ def get_direct_urls_dict(message, mode, proxy, source_ip, allow_unknown_sites): # TikTok: videos # We know for sure these links can be downloaded, so we just skip running ydl_get_direct_urls urls_dict[url_text] = "http" - elif DOMAIN_TW in url.host: + elif (DOMAIN_TW in url.host or DOMAIN_TWX in url.host) and (3 <= url_parts_num <= 3): # Twitter: videos # We know for sure these links can be downloaded, so we just skip running ydl_get_direct_urls urls_dict[url_text] = "http" @@ -954,7 +955,7 @@ def run_async(coro): if DOMAIN_TT in host: download_video = True ydl_opts["videoformat"] = "mp4" - elif DOMAIN_TW in host: + elif DOMAIN_TW in host or DOMAIN_TWX in host: download_video = True ydl_opts["videoformat"] = "mp4" elif DOMAIN_IG in host: