Evil0ctal / Douyin_TikTok_Download_API

🚀「Douyin_TikTok_Download_API」是一个开箱即用的高性能异步抖音、快手、TikTok、Bilibili数据爬取工具,支持API调用,在线批量解析及下载。
https://douyin.wtf
Apache License 2.0
8.62k stars 1.35k forks source link

[BUG] 获取抖音视频数据出错了: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8' #292

Closed luxing518 closed 11 months ago

luxing518 commented 11 months ago

Traceback (most recent call last): File "D:\python\venv\test2\lib\site-packages\douyin_tiktok_scraper\scraper.py", line 286, in get_douyin_video_data response = await response.json() File "D:\python\venv\test2\lib\site-packages\aiohttp\client_reqrep.py", line 1104, in json raise ContentTypeError( aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url=URL('https://www.douyin.com/aweme/v1/web/aweme/detail/?device_platform=webapp&aid=6383&channel=channel_pc_web&aweme_id=7069543727328398622&pc_client_type=1&version_code=190500&version_name=19.5.0&cookie_enabled=true&screen_width=1344&screen_height=756&browser_language=zh-CN&browser_platform=Win32&browser_name=Firefox&browser_version=110.0&browser_online=true&engine_name=Gecko&engine_version=109.0&os_name=Windows&os_version=10&cpu_core_num=16&device_memory=&platform=PC&webid=7158288523463362079&msToken=abL8SeUTPa9-EToD8qfC7toScSADxpg6yLh2dbNcpWHzE0bT04txM_4UwquIcRvkRb9IU8sifwgM1Kwf1Lsld81o9Irt2_yNyUbbQPSUO8EfVlZJ_78FckDFnwVBVUVK&X-Bogus=DFSzswSL02GANnEftT1Md09WcBjE')

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\python\venv\test2\lib\site-packages\tenacity_asyncio.py", line 50, in call result = await fn(*args, **kwargs) File "D:\python\venv\test2\lib\site-packages\douyin_tiktok_scraper\scraper.py", line 293, in get_douyin_video_data raise ValueError(f"获取抖音视频数据出错了: {e}") ValueError: 获取抖音视频数据出错了: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url=URL('https://www.douyin.com/aweme/v1/web/aweme/detail/?device_platform=webapp&aid=6383&channel=channel_pc_web&aweme_id=7069543727328398622&pc_client_type=1&version_code=190500&version_name=19.5.0&cookie_enabled=true&screen_width=1344&screen_height=756&browser_language=zh-CN&browser_platform=Win32&browser_name=Firefox&browser_version=110.0&browser_online=true&engine_name=Gecko&engine_version=109.0&os_name=Windows&os_version=10&cpu_core_num=16&device_memory=&platform=PC&webid=7158288523463362079&msToken=abL8SeUTPa9-EToD8qfC7toScSADxpg6yLh2dbNcpWHzE0bT04txM_4UwquIcRvkRb9IU8sifwgM1Kwf1Lsld81o9Irt2_yNyUbbQPSUO8EfVlZJ_78FckDFnwVBVUVK&X-Bogus=DFSzswSL02GANnEftT1Md09WcBjE')

tenacity.RetryError: RetryError[<Future at 0x286fa9c7580 state=finished raised ValueError>]

测试哔哩哔哩可以,抖音的链接不行,是官方接口更新了,还是什么原因

yinziyan1206 commented 11 months ago

看日期这个bogus代码应该是旧的了~这玩意人家随时改个参就寄了。没办法的

Evil0ctal commented 11 months ago

已修复,请使用最新代码。