Comments (12)
from video_spider.
抖音解析失败,更换Cookie无效,复制所有Cookie后解析视频皆为视频已被删除
有没有可能 这个视频本来就删除了。
from video_spider.
抖音解析失败,更换Cookie无效,复制所有Cookie后解析视频皆为视频已被删除
有没有可能 这个视频本来就删除了。
那肯定不是啊 测试不都是现找视频吗 而且又不是只测试一两个
from video_spider.
解决了吗? 我换了cookie 和ttwid 都不行
from video_spider.
from video_spider.
from video_spider.
目前自用代码如下,Cookie 内容为网页版登陆后内容,准确来说为登陆后的 ttwid
#102 #104 #100 #101
public static function douyin($url)
{
$loc = get_headers($url, true)['Location'];
preg_match('/[0-9]+/', $loc, $id);
if (empty($id)) {
preg_match('/[0-9]+/', $url, $id);
}
$url = 'http://127.0.0.1:1234/';
$header = array('Content-Type: application/json');
$data = json_encode(array('url' => 'https://www.douyin.com/aweme/v1/web/aweme/detail/?aweme_id=' . $id[0] . '&aid=1128&version_name=23.5.0&device_platform=android&os_version=2333','userAgent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36'));
$arr =json_decode(Common::getCurl($url, $data, $header), true);
$url = $arr['data']['url'];
$header = array('User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36', 'Referer: https://www.douyin.com/', 'Cookie: msToken='.Common::msToken(107).';' . self::$douyinCookie);
$arr = json_decode(Common::getCurl($url, null, $header), true);
$video_url = $arr['aweme_detail']['video']['play_addr']['url_list'][0];
if (empty($video_url)) {
$arr = array('code' => 201, 'msg' => '解析失败');
return $arr;
}
$arr = array(
'code' => 200,
'msg' => 'success',
'data' => array(
'title' => $arr['aweme_detail']['desc'],
'author' => $arr['aweme_detail']['author']['nickname'],
'avatar' => $arr['aweme_detail']['music']['avatar_large']['url_list'][0],
'like' => $arr['aweme_detail']['statistics']['digg_count'],
'time' => $arr['aweme_detail']['create_time'],
'cover' => $arr['aweme_detail']['video']['origin_cover']['url_list'][0],
'url' => $arr['aweme_detail']['video']['play_addr']['url_list'][0],
'music' => array(
'author' => $arr['aweme_detail']['music']['author'],
'avatar' => $arr['aweme_detail']['music']['cover_large']['url_list'][0],
'url' => $arr['aweme_detail']['music']['play_url']['url_list'][0],
)
)
);
return $arr;
}
from video_spider.
目前自用代码如下,Cookie 内容为网页版登陆后内容,准确来说为登陆后的
ttwid
#102 #104 #100 #101public static function douyin($url) { $loc = get_headers($url, true)['Location']; preg_match('/[0-9]+/', $loc, $id); if (empty($id)) { preg_match('/[0-9]+/', $url, $id); } $url = 'http://127.0.0.1:1234/'; $header = array('Content-Type: application/json'); $data = json_encode(array('url' => 'https://www.douyin.com/aweme/v1/web/aweme/detail/?aweme_id=' . $id[0] . '&aid=1128&version_name=23.5.0&device_platform=android&os_version=2333','userAgent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36')); $arr =json_decode(Common::getCurl($url, $data, $header), true); $url = $arr['data']['url']; $header = array('User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36', 'Referer: https://www.douyin.com/', 'Cookie: msToken='.Common::msToken(107).';' . self::$douyinCookie); $arr = json_decode(Common::getCurl($url, null, $header), true); $video_url = $arr['aweme_detail']['video']['play_addr']['url_list'][0]; if (empty($video_url)) { $arr = array('code' => 201, 'msg' => '解析失败'); return $arr; } $arr = array( 'code' => 200, 'msg' => 'success', 'data' => array( 'title' => $arr['aweme_detail']['desc'], 'author' => $arr['aweme_detail']['author']['nickname'], 'avatar' => $arr['aweme_detail']['music']['avatar_large']['url_list'][0], 'like' => $arr['aweme_detail']['statistics']['digg_count'], 'time' => $arr['aweme_detail']['create_time'], 'cover' => $arr['aweme_detail']['video']['origin_cover']['url_list'][0], 'url' => $arr['aweme_detail']['video']['play_addr']['url_list'][0], 'music' => array( 'author' => $arr['aweme_detail']['music']['author'], 'avatar' => $arr['aweme_detail']['music']['cover_large']['url_list'][0], 'url' => $arr['aweme_detail']['music']['play_url']['url_list'][0], ) ) ); return $arr; }
请问 $url = 'http://127.0.0.1:1234/';是什么服务
from video_spider.
java 需要最新代码联系我
from video_spider.
from video_spider.
https://github.com/327078466/jd_maotai 有联系方式哦
from video_spider.
目前自用代码如下,Cookie 内容为网页版登陆后内容,准确来说为登陆后的
ttwid
#102 #104 #100 #101public static function douyin($url) { $loc = get_headers($url, true)['Location']; preg_match('/[0-9]+/', $loc, $id); if (empty($id)) { preg_match('/[0-9]+/', $url, $id); } $url = 'http://127.0.0.1:1234/'; $header = array('Content-Type: application/json'); $data = json_encode(array('url' => 'https://www.douyin.com/aweme/v1/web/aweme/detail/?aweme_id=' . $id[0] . '&aid=1128&version_name=23.5.0&device_platform=android&os_version=2333','userAgent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36')); $arr =json_decode(Common::getCurl($url, $data, $header), true); $url = $arr['data']['url']; $header = array('User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36', 'Referer: https://www.douyin.com/', 'Cookie: msToken='.Common::msToken(107).';' . self::$douyinCookie); $arr = json_decode(Common::getCurl($url, null, $header), true); $video_url = $arr['aweme_detail']['video']['play_addr']['url_list'][0]; if (empty($video_url)) { $arr = array('code' => 201, 'msg' => '解析失败'); return $arr; } $arr = array( 'code' => 200, 'msg' => 'success', 'data' => array( 'title' => $arr['aweme_detail']['desc'], 'author' => $arr['aweme_detail']['author']['nickname'], 'avatar' => $arr['aweme_detail']['music']['avatar_large']['url_list'][0], 'like' => $arr['aweme_detail']['statistics']['digg_count'], 'time' => $arr['aweme_detail']['create_time'], 'cover' => $arr['aweme_detail']['video']['origin_cover']['url_list'][0], 'url' => $arr['aweme_detail']['video']['play_addr']['url_list'][0], 'music' => array( 'author' => $arr['aweme_detail']['music']['author'], 'avatar' => $arr['aweme_detail']['music']['cover_large']['url_list'][0], 'url' => $arr['aweme_detail']['music']['play_url']['url_list'][0], ) ) ); return $arr; }
请教一下,用了一阵子没问题,今天用时发现返回为空了,抖音又改了吗
url = "https://www.douyin.com/aweme/v1/web/aweme/detail/?" + query + "&X-Bogus=" + x_bogus
headers = {
'User-Agent': user_agent,
'Referer': 'https://www.douyin.com/',
'Cookie': f'msToken={ms_token}; ttwid={ttwid}'
}
from video_spider.
Related Issues (20)
- 抖音接口失效了嘛
- v2版本解析接口失效 HOT 2
- 抖音接口失效了吗? HOT 10
- 请融合一下这个bilibili的解析源码
- 好像是失效了? HOT 1
- 大佬 快手解析不了 HOT 3
- 请教 HOT 3
- https://tiktok.iculture.cc/X-Bogus 超时,有替代品吗 HOT 2
- 抖音失效
- 抖音失效了
- 抖音有那种 左右滑动的视频 HOT 1
- 新片场好像现在不行了
- 能否用容器部署? HOT 1
- 想用这个接口做个小程序,请问download合法域名配置有什么好的解决方案吗 HOT 3
- 快手解析失败 HOT 7
- 微视视频解析不了了 HOT 1
- 解析出来的URL规则是什么呀 HOT 1
- 在微信里发开视频会报错,浏览器打开可以 HOT 3
- 你这个爬虫不需要设置代理吗? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from video_spider.