吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 2743|回复: 15
收起左侧

[求助] PHP调用逍遥一仙m3u8下载器下载部分失败

[复制链接]
huanxiong 发表于 2022-4-10 17:29
本帖最后由 huanxiong 于 2022-4-10 17:38 编辑

求大佬指点

刚学习PHP,拿某讯课堂练手

已经可以获取到课程名称和视频m3u8的地址,整理成类似这样
[JavaScript] 纯文本查看 复制代码
[
    {
        "title":"截面法",
        "url":[
            "https://1258712167.vod2.myqcloud.com/5a81e359vodtranssh1258712167/e6800d125285890813737225495/drm/voddrm.token.dWluPTIyMzUxMTMxOTY7c2tleT07cHNrZXk9O3Bsc2tleT0wMDA0MDAwMDYyOGQ0ZjI0ZDhkNTZjYTZlM2Y2NGIwMDgxZjE4MGM1YTViODcxNmNiMTdmNjA5ZjNmMzRlMTlhMmEyZTE2ZjY5ZGFiMTFhYmU5MWRjODBlO2V4dD07dWlkX3R5cGU9MDt1aWRfb3JpZ2luX3VpZF90eXBlPTA7dWlkX29yaWdpbl9hdXRoX3R5cGU9MDtjaWQ9NDQyNTgxO3Rlcm1faWQ9MTAyMTMwMjYyO3ZvZF90eXBlPTA=.v.f30742.m3u8?t=625D29C4&exper=0&us=2029940670762813336&sign=fba547a53891c5855635df83805a9470",
            "https://1258712167.vod2.myqcloud.com/5a81e359vodtranssh1258712167/e6800d125285890813737225495/drm/voddrm.token.dWluPTIyMzUxMTMxOTY7c2tleT07cHNrZXk9O3Bsc2tleT0wMDA0MDAwMDYyOGQ0ZjI0ZDhkNTZjYTZlM2Y2NGIwMDgxZjE4MGM1YTViODcxNmNiMTdmNjA5ZjNmMzRlMTlhMmEyZTE2ZjY5ZGFiMTFhYmU5MWRjODBlO2V4dD07dWlkX3R5cGU9MDt1aWRfb3JpZ2luX3VpZF90eXBlPTA7dWlkX29yaWdpbl9hdXRoX3R5cGU9MDtjaWQ9NDQyNTgxO3Rlcm1faWQ9MTAyMTMwMjYyO3ZvZF90eXBlPTA=.v.f30741.m3u8?t=625D29C4&exper=0&us=7127235518283542733&sign=b6736c6bb3c4075ffea406a2f302adea",
            "https://1258712167.vod2.myqcloud.com/5a81e359vodtranssh1258712167/e6800d125285890813737225495/drm/voddrm.token.dWluPTIyMzUxMTMxOTY7c2tleT07cHNrZXk9O3Bsc2tleT0wMDA0MDAwMDYyOGQ0ZjI0ZDhkNTZjYTZlM2Y2NGIwMDgxZjE4MGM1YTViODcxNmNiMTdmNjA5ZjNmMzRlMTlhMmEyZTE2ZjY5ZGFiMTFhYmU5MWRjODBlO2V4dD07dWlkX3R5cGU9MDt1aWRfb3JpZ2luX3VpZF90eXBlPTA7dWlkX29yaWdpbl9hdXRoX3R5cGU9MDtjaWQ9NDQyNTgxO3Rlcm1faWQ9MTAyMTMwMjYyO3ZvZF90eXBlPTA=.v.f30740.m3u8?t=625D29C4&exper=0&us=4698840354260634299&sign=87dbbb556b381ba5c70b5444195223f3"
        ]
    },
    {
        "title":"拉压变形",
        "url":[
            "https://1258712167.vod2.myqcloud.com/5a81e359vodtranssh1258712167/e65d958c5285890813737208920/drm/voddrm.token.dWluPTIyMzUxMTMxOTY7c2tleT07cHNrZXk9O3Bsc2tleT0wMDA0MDAwMDYyOGQ0ZjI0ZDhkNTZjYTZlM2Y2NGIwMDgxZjE4MGM1YTViODcxNmNiMTdmNjA5ZjNmMzRlMTlhMmEyZTE2ZjY5ZGFiMTFhYmU5MWRjODBlO2V4dD07dWlkX3R5cGU9MDt1aWRfb3JpZ2luX3VpZF90eXBlPTA7dWlkX29yaWdpbl9hdXRoX3R5cGU9MDtjaWQ9NDQyNTgxO3Rlcm1faWQ9MTAyMTMwMjYyO3ZvZF90eXBlPTA=.v.f30742.m3u8?t=625D29C4&exper=0&us=5867580516719428455&sign=8361f81c321cd11bdedebff4b90a5f13",
            "https://1258712167.vod2.myqcloud.com/5a81e359vodtranssh1258712167/e65d958c5285890813737208920/drm/voddrm.token.dWluPTIyMzUxMTMxOTY7c2tleT07cHNrZXk9O3Bsc2tleT0wMDA0MDAwMDYyOGQ0ZjI0ZDhkNTZjYTZlM2Y2NGIwMDgxZjE4MGM1YTViODcxNmNiMTdmNjA5ZjNmMzRlMTlhMmEyZTE2ZjY5ZGFiMTFhYmU5MWRjODBlO2V4dD07dWlkX3R5cGU9MDt1aWRfb3JpZ2luX3VpZF90eXBlPTA7dWlkX29yaWdpbl9hdXRoX3R5cGU9MDtjaWQ9NDQyNTgxO3Rlcm1faWQ9MTAyMTMwMjYyO3ZvZF90eXBlPTA=.v.f30741.m3u8?t=625D29C4&exper=0&us=4608941062324352942&sign=16c93a8fa992475133ae0e06499560e6",
            "https://1258712167.vod2.myqcloud.com/5a81e359vodtranssh1258712167/e65d958c5285890813737208920/drm/voddrm.token.dWluPTIyMzUxMTMxOTY7c2tleT07cHNrZXk9O3Bsc2tleT0wMDA0MDAwMDYyOGQ0ZjI0ZDhkNTZjYTZlM2Y2NGIwMDgxZjE4MGM1YTViODcxNmNiMTdmNjA5ZjNmMzRlMTlhMmEyZTE2ZjY5ZGFiMTFhYmU5MWRjODBlO2V4dD07dWlkX3R5cGU9MDt1aWRfb3JpZ2luX3VpZF90eXBlPTA7dWlkX29yaWdpbl9hdXRoX3R5cGU9MDtjaWQ9NDQyNTgxO3Rlcm1faWQ9MTAyMTMwMjYyO3ZvZF90eXBlPTA=.v.f30740.m3u8?t=625D29C4&exper=0&us=1532996741176086724&sign=17e873523b9ca9926ab7192379a49b61"
        ]
    }
]

但是在调用逍遥一仙大佬的m3u8下载器的时候,出现了部分课程下载提示m3u8无效,或者是文件名称中部分字符变成“?”的问题

QQ图片20220410171206.png
文件名称有问号应该是编码的问题。而m3u8失效问题看下载器保存的失败详情,m3u8地址多出来这么一些奇怪的字符,感觉也是编码的问题

QQ截图20220410171554.png
代码里面已经把字符编码从utf8转换成了下载器要的gbk

[PHP] 纯文本查看 复制代码
for ($i=0;$i<count($result);$i++) {
	$j = $i + 1;
	$data = $j.'.'.$result[$i]['title'].','.$result[$i]['url'][$definition];
	$data = iconv("UTF-8","gbk//TRANSLIT",$data);
	$data = base64_encode($data);
	$data = iconv("UTF-8","gbk//TRANSLIT",'data='.$data.',type=2');
	if (json_decode(postSubmit('127.0.0.1:8787',$data,[]),true)['stat'] == true) {
		$number++;
	}
}


求助大佬们看看这是我代码里面编码转换的问题还是哪里出错了,或者说怎么能解决这个问题
在此拜谢了!

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

a634085832 发表于 2022-4-10 18:45
PHP 直接调用ffmpeg比调用软件来得方便
 楼主| huanxiong 发表于 2022-4-10 19:00
a634085832 发表于 2022-4-10 18:45
PHP 直接调用ffmpeg比调用软件来得方便

刚刚突然感觉本地跑PHP不是很合适,
还是把这个写成一个获取信息的接口比较好
具体下载什么的用易语言之类写
a634085832 发表于 2022-4-10 19:07
huanxiong 发表于 2022-4-10 19:00
刚刚突然感觉本地跑PHP不是很合适,
还是把这个写成一个获取信息的接口比较好
具体下载什么的用易语言 ...

我个人在用的都是直接写bat的
逍遥一仙 发表于 2022-4-10 19:20
使用type=2的情况下不需要转gbk吧
逍遥一仙 发表于 2022-4-10 19:23
如果改回utf8后依旧出现失败的问题。尝试直接导出请求内容,保存为txt上传下看看
 楼主| huanxiong 发表于 2022-4-10 19:40
逍遥一仙 发表于 2022-4-10 19:23
如果改回utf8后依旧出现失败的问题。尝试直接导出请求内容,保存为txt上传下看看

QQ截图20220410193835.png
刚试了下用易语言模块调用没问题,先吃个饭再试试PHP
头像被屏蔽
xiadongming 发表于 2022-4-10 20:21
提示: 作者被禁止或删除 内容自动屏蔽
 楼主| huanxiong 发表于 2022-4-10 22:36
逍遥一仙 发表于 2022-4-10 19:23
如果改回utf8后依旧出现失败的问题。尝试直接导出请求内容,保存为txt上传下看看

QQ截图20220410223516.png
不是gbk编码的话,中文字符都是乱码
wasd3152 发表于 2022-4-10 23:01
可以可以,突然觉得自己又行了
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-25 14:45

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表