Open UnixCro opened 2 years ago
Duplicate of #30251, where a patch that appears to work is provided.
No thx
Applied patch from #30251 (comment) and it worked for me.
Tutorial:
--- old/youtube-dl/youtube_dl/extractor/tiktok.py
+++ new/youtube-dl/youtube_dl/extractor/tiktok.py
to
--- old/extractor/tiktok.py
+++ new/extractor/tiktok.py
source venv/bin/activate
venv_dir=$(python3 -c "import sysconfig; print(sysconfig.get_path('purelib'))")
echo $venv_dir
cd $venv_dir/youtube_dl
patch -p1 < /tmp/tiktok.patch
deactivate
Save patch as /tmp/tiktok.patch. (or download attachment). Open it and change first lines as following:
Or use patch -p2 ...
later on (step 4). -p
says how many of the leading directories in the patch script to strip when finding the file to be patched, which obviously depends on where the patch is relative to the package being patched.
Obviously the procedure doesn't apply if the installation is a single file or not a site-packages
installation, but that should encourage people to pip
their installation.
-p
says how many of the leading directories in the patch script to strip
Thanks, for some reason I didn't even try to check manual, just was using p1 as I got used to many years ago. Now I knew something new!
Yes, I believe people mostly use pip to install this package, as I'm not a python dev I even searched if there is a way to say pip to apply patch but haven't found anything. I hope the solution is temporary unless it will be fixed someday...
I also checked solution with go script by @89z and it also works, I was able to build it under ubuntu 20.04 and go 1.17 but it lacks of some nice paratemeters like "set output filename" or download using shortcut as youtube-dl does.
wow thanks! I'll use it in bot, I was about to add this output argument by myself but you did it so fast and this is very nice!
I LOVE YOU DUDE. IT WORKED YOU A GENIUS BRO @p1ratrulezzz
Good Morning,
after the patch everything went as usual, but this morning I noticed that youtube-dl
was getting problems, regardless of which Tiktok video. It stops at Session
and doesn't do anything anymore.
youtube-dl -v https://vm.tiktok.com/ZM8o81GJ6/
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://vm.tiktok.com/ZM8o81GJ6/']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Python version 3.10.1 (CPython) - Linux-4.14.87+-armv8l-with-libc
[debug] exe versions: ffmpeg 4.4.1, ffprobe 4.4.1
[debug] Proxy map: {}
[generic] ZM8o81GJ6: Requesting header
[redirect] Following redirect to https://www.tiktok.com/@tal_dahan_98/video/7024900237076483329?_d=secCgwIARCbDRjEFSACKAESPgo8YrY3EKdj1E6gxwNUHIw1x1pyS1GuRWH%2B7yBvtTroH1PZUFsEa6LLl7vAD373o7DlJP0ex0LcUx3xx5RIGgA%3D&checksum=86caa7b721ef97df33eae17f7050f10a2df3b3563b7dbad85fc24c6108f71d6d&language=de&preview_pb=0&sec_user_id=MS4wLjABAAAAwkLYynP5HnlwKtmz4yBJ6cCjmTTfkDfupLpi6htOTGYDBqQw03ruYBKCSem4mD-x&share_app_id=1233&share_item_id=7024900237076483329&share_link_id=B9546FAF-D8BE-478F-B1D6-A82C83A8DCD6&source=h5_m×tamp=1641475816&tt_from=copy&u_code=de7i359c99ad13&user_id=6866698620222948358&utm_campaign=client_share&utm_medium=ios&utm_source=copy&_r=1
[TikTok] Setting up session
Has anyone noticed the same bug?
See #30251.
Thank you @dirkf. But how exactly do I install the new version now?
You have to replace the extractor module with the one from the PR. See https://github.com/ytdl-org/youtube-dl/pull/30479#issuecomment-1007495127.
Same mistake. It gets stuck after the setting up session.
pip install --force-reinstall -U git+https://github.com/ytdl-org/youtube-dl@refs/pull/30184/merge
... (substitute PR number 30479 and file youtube_dl/extractor/tiktok.py as appropriate) ...
You installed PR #30184 instead of #30479!
Ah nice 😂😂. It worked @dirkf. Hopefully 100 years with you.
pip install --force-reinstall -U git+https://github.com/ytdl-org/youtube-dl@refs/pull/30479/merge
@dirkf this PR doesn't work anymore. "Could not send HEAD request to https://www.tiktok.com/....: The read operation timed out"
Indeed, that's why it hasn't been merged: #30538.