Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Douyin always errors saying fresh cookies are needed, even when passing them #9667

Open
9 of 11 tasks
cyhboy opened this issue Apr 11, 2024 · 5 comments
Open
9 of 11 tasks
Labels
site-bug Issue with a specific website

Comments

@cyhboy
Copy link

cyhboy commented Apr 11, 2024

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • I understand that I will be blocked if I intentionally remove or skip any mandatory* field

Checklist

Region

China

Provide a description that is worded well enough to be understood

yt-dlp --verbose --cookies douyin.com_cookies.txt -o "摄影师今个没鸡腿晚风很温柔_7356265095304875264.%(ext)s" https://www.douyin.com/video/7356265095304875264
[debug] Command-line config: ['--verbose', '--cookies', 'douyin.com_cookies.txt', '-o', '摄影师今个没鸡腿晚风很温柔_7356265095304875264.%(ext)s', 'https://www.douyin.com/video/7356265095304875264']
[debug] Encodings: locale cp65001, fs utf-8, pref cp65001, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2024.04.09 from yt-dlp/yt-dlp [ff07792] (pip)
[debug] Python 3.11.8 (CPython AMD64 64bit) - Windows-10-10.0.19041-SP0 (OpenSSL 3.0.13 30 Jan 2024)
[debug] exe versions: ffmpeg 2022-01-27-git-3c831847a8-full_build-www.gyan.dev (setts), ffprobe 2022-01-27-git-3c831847a8-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.17, brotli-1.0.9, certifi-2024.02.02, mutagen-1.46.0, requests-2.31.0, sqlite3-3.41.2, urllib3-1.26.18, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1810 extractors
[Douyin] Extracting URL: https://www.douyin.com/video/7356265095304875264
[Douyin] 7356265095304875264: Downloading web detail JSON
WARNING: [Douyin] 7356265095304875264: Failed to parse JSON: Expecting value in '': line 1 column 1 (char 0)
ERROR: [Douyin] 7356265095304875264: Fresh cookies (not necessarily logged in) are needed; please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
File "C:\Users\cyy.conda\envs\working\Lib\site-packages\yt_dlp\extractor\common.py", line 734, in extract
ie_result = self._real_extract(url)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cyy.conda\envs\working\Lib\site-packages\yt_dlp\extractor\tiktok.py", line 1135, in _real_extract
raise ExtractorError(

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • If using API, add 'verbose': True to YoutubeDL params instead
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

yt-dlp  --verbose --cookies douyin.com_cookies.txt -o "摄影师今个没鸡腿晚风很温柔_7356265095304875264.%(ext)s" https://www.douyin.com/video/7356265095304875264
[debug] Command-line config: ['--verbose', '--cookies', 'douyin.com_cookies.txt', '-o', '摄影师今个没鸡腿晚风很温柔_7356265095304875264.%(ext)s', 'https://www.douyin.com/video/7356265095304875264']
[debug] Encodings: locale cp65001, fs utf-8, pref cp65001, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2024.04.09 from yt-dlp/yt-dlp [ff0779267] (pip)
[debug] Python 3.11.8 (CPython AMD64 64bit) - Windows-10-10.0.19041-SP0 (OpenSSL 3.0.13 30 Jan 2024)
[debug] exe versions: ffmpeg 2022-01-27-git-3c831847a8-full_build-www.gyan.dev (setts), ffprobe 2022-01-27-git-3c831847a8-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.17, brotli-1.0.9, certifi-2024.02.02, mutagen-1.46.0, requests-2.31.0, sqlite3-3.41.2, urllib3-1.26.18, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1810 extractors
[Douyin] Extracting URL: https://www.douyin.com/video/7356265095304875264
[Douyin] 7356265095304875264: Downloading web detail JSON
WARNING: [Douyin] 7356265095304875264: Failed to parse JSON: Expecting value in '': line 1 column 1 (char 0)
ERROR: [Douyin] 7356265095304875264: Fresh cookies (not necessarily logged in) are needed; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
  File "C:\Users\cyy\.conda\envs\working\Lib\site-packages\yt_dlp\extractor\common.py", line 734, in extract
    ie_result = self._real_extract(url)
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\cyy\.conda\envs\working\Lib\site-packages\yt_dlp\extractor\tiktok.py", line 1135, in _real_extract
    raise ExtractorError(
@cyhboy cyhboy added site-bug Issue with a specific website triage Untriaged issue labels Apr 11, 2024
@bashonly
Copy link
Member

bashonly commented Apr 11, 2024

If the video isn't private, try using logged-out cookies (not from any account). Open the video link in browser, solve the catpcha. and export/extract those browser cookies

@Vetches
Copy link

Vetches commented Apr 21, 2024

Hi! My region is the USA and I have a Douyin account. When I try using the Douyin extractor both logged out and logged in, I get the same error:

yt-dlp -vU --cookies-from-browser chrome https://www.douyin.com/video/7360255988722650409 --verbose
[debug] Command-line config: ['-vU', '--cookies-from-browser', 'chrome', 'https://www.douyin.com/video/7360255988722650409', '--verbose']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2024.04.09 from yt-dlp/yt-dlp [ff0779267] (pip)
[debug] Python 3.12.3 (CPython arm64 64bit) - macOS-14.1.1-arm64-arm-64bit (OpenSSL 3.2.1 30 Jan 2024)
[debug] exe versions: ffmpeg 3.4.1, ffprobe 3.4.1
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.02.02, mutagen-1.47.0, requests-2.31.0, sqlite3-3.45.2, urllib3-2.2.1, websockets-12.0
[debug] Proxy map: {}
Extracting cookies from chrome
[debug] Extracting cookies from: "/Users/<user>/Library/Application Support/Google/Chrome/Default/Cookies"
[debug] using find-generic-password to obtain password from OSX keychain
Extracted 3088 cookies from chrome
[debug] cookie version breakdown: {'v10': 2994, 'other': 0, 'unencrypted': 94}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1810 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2024.04.09 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2024.04.09 from yt-dlp/yt-dlp)
[Douyin] Extracting URL: https://www.douyin.com/video/7360255988722650409
[Douyin] 7360255988722650409: Downloading web detail JSON
WARNING: [Douyin] 7360255988722650409: Failed to parse JSON: Expecting value in '': line 1 column 1 (char 0)
ERROR: [Douyin] 7360255988722650409: Fresh cookies (not necessarily logged in) are needed; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
  File "/opt/homebrew/Cellar/yt-dlp/2024.4.9_1/libexec/lib/python3.12/site-packages/yt_dlp/extractor/common.py", line 734, in extract
    ie_result = self._real_extract(url)
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/yt-dlp/2024.4.9_1/libexec/lib/python3.12/site-packages/yt_dlp/extractor/tiktok.py", line 1135, in _real_extract
    raise ExtractorError(

I've tried other browsers as well, such as Edge, Opera, and Firefox, and they all throw the same error. I know projects like F2 make API calls to Douyin's API endpoints, but I've not had a chance to look at yt-dlp's version.

@bashonly bashonly changed the title Douyin (tiktok in American, but I never try tiktok site as I am in China always) fail to download for some reason and I try my another account then come out same issue Douyin always errors saying fresh cookies are needed, even when passing them Apr 21, 2024
@bashonly bashonly removed the triage Untriaged issue label Apr 21, 2024
@cybertahr
Copy link

same error warning message, logged-in / logged-out cookies get this same error:
Failed to parse JSON: Expecting value in '': line 1 column 1 (char 0)

@linlance
Copy link

same error warning message, logged-in / logged-out cookies get this same error:

WARNING: [Douyin] 7364022131870453028: Failed to parse JSON: Expecting value in '': line 1 column 1 (char 0) ERROR: [Douyin] 7364022131870453028: Fresh cookies (not necessarily logged in) are needed; please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U

@cherinyy
Copy link

cherinyy commented Jun 1, 2024

I don't think this issue is caused by the lack of cookies, more like a bug.

Is ie_result = self._real_extract(url) meant to handle links from www.iesdouyin.com?

[debug] Command-line config: ['--verbose', '--user-agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36', '--cookies', 'douyin.txt', 'https://www.iesdouyin.com/share/video/7347184558946766099/']
[debug] Encodings: locale cp936, fs utf-8, pref cp936, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version nightly@2024.05.30.232720 from yt-dlp/yt-dlp-nightly-builds [2e5a47da4] (pip)
[debug] Python 3.12.3 (CPython AMD64 64bit) - Windows-11-10.0.22631-SP0 (OpenSSL 3.0.13 30 Jan 2024)
[debug] exe versions: ffmpeg 2024-05-29-git-fa3b153cb1-full_build-www.gyan.dev (setts), ffprobe 2024-05-29-git-fa3b153cb1-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.02.02, mutagen-1.47.0, requests-2.31.0, sqlite3-3.45.1, urllib3-2.2.1, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1820 extractors
[generic] Extracting URL: https://www.iesdouyin.com/share/video/7347184558946766099/
[generic] 7347184558946766099: Downloading webpage
[redirect] Following redirect to https://www.douyin.com/video/7347184558946766099?previous_page=app_code_link
[Douyin] Extracting URL: https://www.douyin.com/video/7347184558946766099?previous_page=app_code_link
[Douyin] 7347184558946766099: Downloading web detail JSON
WARNING: [Douyin] 7347184558946766099: Failed to parse JSON: Expecting value in '': line 1 column 1 (char 0)
ERROR: [Douyin] 7347184558946766099: Fresh cookies (not necessarily logged in) are needed
  File "C:\Users\Administrator\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\yt_dlp\extractor\common.py", line 734, in extract
    ie_result = self._real_extract(url)
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\yt_dlp\extractor\tiktok.py", line 1310, in _real_extract
    raise ExtractorError(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site-bug Issue with a specific website
Projects
None yet
Development

No branches or pull requests

6 participants