UC大鱼小视频解析下载

以前给客户写的一个批量采集软件失效了,今天又过来找我我就看了一下,作者采集那里没有问题,主要是出现在视频解析那里,以前的解析接口失效了。

客户那边是做视频采集搬运的,UC大鱼的视频质量还不错,没有水印,记录一下过程。

首先从手机UC浏览器分享了一个作者链接过来:

http://a.mp.uc.cn/media.html?mid=eafce118a8d04a7fb49edb26e67a16f4&client=ucweb&uc_param_str=frdnsnpfvecpntnwprdsssnikt&uc_biz_str=S:custom%7CC:iflow_ncmt


翻了一下页面是分页加载的,这种一般都是以Json的形式返回数据。

打开控制台切换到network页看一下网页请求,这里我有一个小技巧,一般这种分页加载的网页我会先尝试过滤一下“page=”字符看一下。


过滤”page=”字符接口一下子就出来了:

http://ff.dayu.com/contents/author/eafce118a8d04a7fb49edb26e67a16f4?biz_id=1002&_size=8&_page=1&_order_type=published_at&status=1&_fetch=1&uc_param_str=frdnsnpfvecpntnwprdsssnikt&_=1547577957727

接口请求的时候主要注意一下下面两个参数,其他默认就好。

eafce118a8d04a7fb49edb26e67a16f4 作者ID

page= 分页

以上UC大鱼作者的所有视频链接都采集出来了,接下来就是把视频直链解析出来。

我们先从作者页打开一个视频播放页面,刷新拦截一下看视频链接是从哪个接口反回来的。

http://v.mp.uc.cn/video.html?uc_param_str=frdnsnpfvecpntnwprdssskt&from=media#!wm_cid=267399668026835968!!wm_aid=26fa9499c6dd453ebbfc4880b71aaa75!!wm_id=eafce118a8d04a7fb49edb26e67a16f4


我翻了一下请求发现他的视频链接是从下面接口反回来的:

http://v.mp.uc.cn/api/vps?token=Hh%2FdqhK4JBpmDIcJ9CLIWQ%3D%3D&ums_id=97aff448e4250d3d&wm_cid=267399668026835968&wm_id=eafce118a8d04a7fb49edb26e67a16f4

有几个乱码看着不方便,Url解码一下得到下面数据:

http://v.mp.uc.cn/api/vps?token=Hh/dqhK4JBpmDIcJ9CLIWQ==&ums_id=97aff448e4250d3d&wm_cid=267399668026835968&wm_id=eafce118a8d04a7fb49edb26e67a16f4

接口返回了以下数据:

{"status":0,"message":"","data":{"url":"http://dy-frontend.video.ums.uc.cn/w/1547547793/video/wemedia/eafce118a8d04a7fb49edb26e67a16f4/444065d12d690e266b5493b90e514f99-1337752270-6-0-2.mp4?auth_key=1547581955-b0bca68f99dc4b42a0c79e978259fea2-0-504c180f7f177d2423bb13078f54a940","duration":196,"size":"21057680","sign":"db4c7d3ccc6a5ee0729a7c24da432ac3"}}


这个接口有四个参数:

token=Hh/dqhK4JBpmDIcJ9CLIWQ==

ums_id=97aff448e4250d3d

wm_cid=267399668026835968

wm_id=eafce118a8d04a7fb49edb26e67a16f4

这些参数是从哪来的一般来说我都会先尝试搜索一下网页源码,这里我没有搜索到,还是得往前面看一下是不是从别的接口返回来的。(这里我说一下抓包我推荐用Fiddler,使用Fiddler全局搜索很容易能搜索到这些参数是哪个接口返回的,就不用像我这样子一个接口一个接口去看,我因为是在老家破电脑用不了Fiddler所以就只能用浏览器的开发工具。)

往前面翻了一下发现除了token,其他几个参数都在下面这个接口:

http://ff.dayu.com/contents/267399668026835968?biz_id=1002&_fetch_author=1&_fetch_incrs=1

访问后返回了下面数据:

{"data":{"created_at":"2019-01-15T18:21:37.806+0800","updated_at":"2019-01-16T02:26:22.759+0800","content_id":"267399668026835968","format_type":1002,"biz_id":1002,"category":"游戏","content_type":1001,"origin_id":"26fa9499c6dd453ebbfc4880b71aaa75","title":"呆妹儿教你吃鸡没有小姐姐: 女人的嘴, 骗人的鬼","sub_title":"呆妹儿教你吃鸡没有小姐姐: 女人的嘴, 骗人的鬼","status":1,"audit_status":1,"author_id":"eafce118a8d04a7fb49edb26e67a16f4","shard_id":"eafce118a8d04a7fb49edb26e67a16f4","source":"1","cover_url":"http://image.uc.cn/s/wemedia/s/upload/2019/6768873b289bf9771a40f711e3faab2e.jpg","published_at":"2019-01-15T18:21:37.780+0800","body":{"videos":[{"file_name":"呆妹儿教你吃鸡没有小姐姐:女人的嘴,骗人的鬼.mp4","ums_id":"97aff448e4250d3d","page_url":"http://v.ums.uc.cn/video/v_97aff448e4250d3d.html","thumbnail":"http://img.ums.uc.cn/smart_snapshot/1547547811-1337752270-1750100306","duration":196,"width":1920,"height":1080,"bitrate":"6217","size":152837816,"status":"1","description":"呆妹儿教你吃鸡没有小姐姐: 女人的嘴, 骗人的鬼","yk_vid":"1003595284","extra":{"material_id":"","cover_from":1,"video_from":""}}]},"_extra":{"is_original":1,"covers":[],"vertical_cover_url":"","origin_cover_url":"http://image.uc.cn/s/wemedia/s/upload/2019/1b917374febb8eb03bec32147fd87c5d.jpg","customize_tags":["呆妹儿","绝地求生","吃鸡","主播","搞笑"],"second_title":"","xss_item_id":"12803331104905082604","origin_author":"","quality_score":5},"_product_info":{"settings":{"weixin_promote":false,"article_activity_id":""},"reproduce":{"open_reproduce":0},"award":{"open_award":false},"ad":{"is_show_ad":true,"video_share_status":1}},"_author":{"created_at":"2017-05-20T12:42:42.000+0800","updated_at":"2019-01-15T10:59:12.000+0800","author_id":"eafce118a8d04a7fb49edb26e67a16f4","author_name":"侠游","author_alias":"财务学长","introduction":"游戏视频创作者,玩好玩的游戏,做有趣的视频","special_introduction":"","author_type":"0","active":1,"author_level":"5","category":"游戏","avatar_url":"http://image.uc.cn/s/wemedia/s/upload/2018/27095d1b0a1d36a474233d9d5409c3e6x200x200x27.png","source":"3","biz_id":1001,"open_award":"false","open_tbk":"0","super_v":"0","xss_seed_id":"594528","extra_map":{"is_original":0,"has_opened_ad":true,"wm_weixin_id":"xiayousp"}},"_incrs":{"play":0,"A":0,"B":0,"cover_return":0,"C":0,"D":0,"dislike":0,"release":0,"buy":0,"show":0,"fav_total":0,"click_7day":0,"recommend":199,"click_total":0,"vote_keng":0,"fav":0,"share":0,"like":1,"vote_jian":0,"vote_diao":0,"click":0,"play_total":0,"click2":7,"click3":0,"comment":0,"comment_total":0,"click1":0}}}

现在我们就差一个token参数

翻了好一会才发现token原来是下面这个接口服务器响应头返回的Set-Cookie:

http://v.mp.uc.cn/video.html?uc_param_str=frdnsnpfvecpntnwprdssskt&from=media


以上有点乱,怎么获取作者全部视频就不说了,我们来盘一下UC大鱼获取视频链接的过程。

首先访问一个视频链接:http://v.mp.uc.cn/video.html?uc_param_str=frdnsnpfvecpntnwprdssskt&from=media#!wm_cid=267399668026835968!!wm_aid=26fa9499c6dd453ebbfc4880b71aaa75!!wm_id=eafce118a8d04a7fb49edb26e67a16f4

然后取上面视频链接的wm_aid参数拼接出下面链接:http://ff.dayu.com/contents/267399668026835968?biz_id=1002&_fetch_author=1&_fetch_incrs=1

访问后返回数据如下:

{"data":{"created_at":"2019-01-15T18:21:37.806+0800","updated_at":"2019-01-16T04:09:27.721+0800","content_id":"267399668026835968","format_type":1002,"biz_id":1002,"category":"游戏","content_type":1001,"origin_id":"26fa9499c6dd453ebbfc4880b71aaa75","title":"呆妹儿教你吃鸡没有小姐姐: 女人的嘴, 骗人的鬼","sub_title":"呆妹儿教你吃鸡没有小姐姐: 女人的嘴, 骗人的鬼","status":1,"audit_status":1,"author_id":"eafce118a8d04a7fb49edb26e67a16f4","shard_id":"eafce118a8d04a7fb49edb26e67a16f4","source":"1","cover_url":"http://image.uc.cn/s/wemedia/s/upload/2019/6768873b289bf9771a40f711e3faab2e.jpg","published_at":"2019-01-15T18:21:37.780+0800","body":{"videos":[{"file_name":"呆妹儿教你吃鸡没有小姐姐:女人的嘴,骗人的鬼.mp4","ums_id":"97aff448e4250d3d","page_url":"http://v.ums.uc.cn/video/v_97aff448e4250d3d.html","thumbnail":"http://img.ums.uc.cn/smart_snapshot/1547547811-1337752270-1750100306","duration":196,"width":1920,"height":1080,"bitrate":"6217","size":152837816,"status":"1","description":"呆妹儿教你吃鸡没有小姐姐: 女人的嘴, 骗人的鬼","yk_vid":"1003595284","extra":{"material_id":"","cover_from":1,"video_from":""}}]},"_extra":{"is_original":1,"covers":[],"vertical_cover_url":"","origin_cover_url":"http://image.uc.cn/s/wemedia/s/upload/2019/1b917374febb8eb03bec32147fd87c5d.jpg","customize_tags":["呆妹儿","绝地求生","吃鸡","主播","搞笑"],"second_title":"","xss_item_id":"12803331104905082604","origin_author":"","quality_score":5},"_product_info":{"settings":{"weixin_promote":false,"article_activity_id":""},"reproduce":{"open_reproduce":0},"award":{"open_award":false},"ad":{"is_show_ad":true,"video_share_status":1}},"_author":{"created_at":"2017-05-20T12:42:42.000+0800","updated_at":"2019-01-15T10:59:12.000+0800","author_id":"eafce118a8d04a7fb49edb26e67a16f4","author_name":"侠游","author_alias":"财务学长","introduction":"游戏视频创作者,玩好玩的游戏,做有趣的视频","special_introduction":"","author_type":"0","active":1,"author_level":"5","category":"游戏","avatar_url":"http://image.uc.cn/s/wemedia/s/upload/2018/27095d1b0a1d36a474233d9d5409c3e6x200x200x27.png","source":"3","biz_id":1001,"open_award":"false","open_tbk":"0","super_v":"0","xss_seed_id":"594528","extra_map":{"is_original":0,"has_opened_ad":true,"wm_weixin_id":"xiayousp"}},"_incrs":{"play":0,"A":0,"B":0,"cover_return":0,"C":0,"D":0,"dislike":0,"release":0,"buy":0,"show":0,"fav_total":0,"click_7day":0,"recommend":208,"click_total":0,"vote_keng":0,"fav":0,"share":0,"like":1,"vote_jian":0,"vote_diao":0,"click":0,"play_total":0,"click2":17,"click3":0,"comment":0,"comment_total":0,"click1":0}}}

然后我们从上面返回数据分别取出:

ums_id":"97aff448e4250d3d"; 对应视频直链接口的ums_id参数

content_id":"267399668026835968"  对应视频直链接口的wm_cid参数

author_id":"eafce118a8d04a7fb49edb26e67a16f4"  对应视频直链接口的wm_id参数

然后再访问下面链接:

http://v.mp.uc.cn/video.html?uc_param_str=frdnsnpfvecpntnwprdssskt&from=media

取出服务器响应头返回的Set-Cookie:

vpstoken=yqgmEDSvsJJeQMbupNTAVA%3D%3D; Path=/  对应视频直链接口的token参数

拼接出视频直链的接口:

http://v.mp.uc.cn/api/vps?token=yqgmEDSvsJJeQMbupNTAVA%3D%3D&ums_id=97aff448e4250d3d&wm_cid=267399668026835968&wm_id=eafce118a8d04a7fb49edb26e67a16f4

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 203,937评论 6 478
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,503评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 150,712评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,668评论 1 276
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,677评论 5 366
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,601评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,975评论 3 396
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,637评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,881评论 1 298
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,621评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,710评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,387评论 4 319
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,971评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,947评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,189评论 1 260
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 44,805评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,449评论 2 342

推荐阅读更多精彩内容