youtube-dl: TikTok Error

~/files/Tiktok $ youtube-dl --verbose https://vm.tiktok.com/ZM8Kf5sqY/
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', 'https://vm.tiktok.com/ZM8Kf5sqY/']
[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] ZM8Kf5sqY: Requesting header
[redirect] Following redirect to https://www.tiktok.com/@elektrokurzschluss/video/7042661503035526406?_d=secCgwIARCbDRjEFSACKAESPgo8Py%2BWHrKmQ8k916xwcDBjDWlzWI3uyW3d84Z2wwgZBwA6dO9mCxynY1r%2BVVrZKE4rOvdHB5S4NR7cJt0sGgA%3D&language=de&preview_pb=0&sec_user_id=MS4wLjABAAAAwkLYynP5HnlwKtmz4yBJ6cCjmTTfkDfupLpi6htOTGYDBqQw03ruYBKCSem4mD-x&share_app_id=1233&share_item_id=7042661503035526406&share_link_id=5391ca27-a864-405f-84d3-8fec6466ad88&source=h5_m&timestamp=1640954903&u_code=de7i359c99ad13&user_id=6866698620222948358&utm_campaign=client_share&utm_medium=android&utm_source=copy&_r=1
[TikTok] Setting up session
[TikTok] 7042661503035526406: Downloading webpage
ERROR: Unable to extract data; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/youtube_dl/YoutubeDL.py", line 815, in wrapper
    return func(self, *args, **kwargs)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/youtube_dl/YoutubeDL.py", line 836, in __extract_info
    ie_result = ie.extract(url)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/youtube_dl/extractor/common.py", line 534, in extract
    ie_result = self._real_extract(url)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/youtube_dl/extractor/tiktok.py", line 110, in _real_extract
    page_props = self._parse_json(self._search_regex(
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/youtube_dl/extractor/common.py", line 1012, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
youtube_dl.utils.RegexNotFoundError: Unable to extract data; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 16 (6 by maintainers)

Most upvoted comments

Applied patch from #30251 (comment) and it worked for me.

Tutorial:

  1. Save patch as /tmp/tiktok.patch. (or download attachment). Open it and change first lines as following:
--- 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
  1. if you use venv - activate it by
source venv/bin/activate
  1. Find out site-packages folder location by running
venv_dir=$(python3 -c "import sysconfig; print(sysconfig.get_path('purelib'))")
echo $venv_dir
  1. change dir to site-packages and apply the patch
cd $venv_dir/youtube_dl
patch -p1 < /tmp/tiktok.patch
  1. If using a venv, run
deactivate
  1. It should work now.

… (substitute PR number 30479 and file youtube_dl/extractor/tiktok.py as appropriate) …

You installed PR #30184 instead of #30479!

I LOVE YOU DUDE. IT WORKED YOU A GENIUS BRO @p1ratrulezzz

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.