LifeActor / ykdl

a video downloader focus on China mainland video sites.(一款专注于中国大陆视频网站的视频下载器。)
https://github.com/LifeActor/ykdl
Other
1.44k stars 285 forks source link

希望添加ppbox支持 #291

Open wilsonwu opened 6 years ago

wilsonwu commented 6 years ago

ppbox是pptv机顶盒版

zhangn1985 commented 6 years ago

pptv都没有搞定。。。

wilsonwu commented 6 years ago

@zhangn1985 我给你贡献一个migu的解析逻辑,不过我不太会python,我nodejs写的。

zhangn1985 commented 6 years ago

你把代码贴上来吧。@wilsonwu

wilsonwu commented 6 years ago
node:
        let id = req.query.url;
        let formData = { cid: id };
        let url = 'http://www.miguvideo.com/wap/resource/pc/data/miguData.jsp';
        request.post({
            url: url,
            form: formData
        }, function (error, response, body) {
            if (!error && response.statusCode == 200) {
                let playData = JSON.parse(body);
                let jsFunction = playData[0].func;
                let playList = playData[0].pilotPlayList;
                res.render('parser/migu', { 
                    js: jsFunction,
                    m3u8: playList.play42
                });
            } else {
                res.send({
                    url: "OnlyTVB Get Page",
                    error: error
                });
            }
        });
pug:
extends ../layoutEmpty

block header
    meta(http-equiv='Content-Type', content='text/html; charset=GBK')
    meta(name='referrer', content='no-referrer')
    meta(content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0', name='viewport')
    script(type='text/javascript', src='/ckplayer/ckplayer.min.js?version=20180610', charset='utf-8')
    script(type='text/javascript', src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js', charset='utf-8')
    script(type='text/javascript', src='/assets/javascripts/tripledes.js?version=20180604', charset='utf-8')
    script(type='text/javascript', src='/assets/javascripts/mode-ecb-min.js?version=20180604', charset='utf-8')
    style(type='text/css').
        body, html, .ckplayer {
            padding: 0;
            margin: 0;
            width: 100%;
            height: 100%;
        }
        a {
            text-decoration: none;
        }
    script.
        var isWeChat = false;
        isWeChat = (/micromessenger/.test(navigator.userAgent.toLowerCase())) ? true : false ;
        if (isWeChat === false) {
            //xinba float bottom
            document.writeln("<script src='https:\/\/km.jianduankm.com\/69718'><\/script>");
        }
block content
    #player.ckplayer
    script(type='text/javascript').
        #{js}
        var m3u8 = _mv_addr("#{m3u8}");
        var m3u8Decode = decodeURIComponent(m3u8)
        var url = m3u8Decode;
        var videoObject = {
            container: '#player',
            variable: 'player',
            flashplayer: false,
            video: url
        };
        var player = new ckplayer(videoObject);
wilsonwu commented 6 years ago

@zhangn1985 帮我在你的项目里加个contribution哈,多谢,代码是基于express的,其实主要是node逻辑,解析出来解密js的方法后前端解密,你也可以重写一下这个算法。

airdge commented 6 years ago

@wilsonwu 那么麻烦干嘛
也就des-ecb加密,用crypto模块解密就行了 key为 CryptoJS.enc.Utf8.parse('xxxxxxxxxx');的前8位

wilsonwu commented 6 years ago

@airdge 是的,其实只要读出秘钥就行了,我这个代码是边摸编写的,后面也懒得改了

TaoziDB commented 6 years ago

这个可能有所帮助 https://github.com/wangguang2112/gvideo 可看咪咕资源的播放器 1 可免费观看电影 2 支持搜索 3 支持投屏 4 可观看部分电视剧

hbyhzx commented 6 years ago

@airdge 你的那个接口真厉害。

wnpllrzodiac commented 6 years ago

非vip的视频解析我这里有,可以通过p2p 模块播放

wilsonwu commented 6 years ago

@wnpllrzodiac 能分享一份ppbox的解析给我吗,非常感谢!