找回密码
 立即注册
查看: 3021|回复: 0

[C#] 皮皮虾 无水印解析视频 官方接口

[复制链接]
发表于 2022-10-23 12:50:02 | 显示全部楼层 |阅读模式

复制粘贴直接调用简单粗暴

[C#] 纯文本查看 复制代码
Ppx p = new Ppx("https://h5.pipix.com/s/MmdstMo/");
       //  p.GetAuthorHeadImage(); 得到作者头像
       //p.GetTitle(); 得到视频标题
       Console.WriteLine(p.GetMp4());
         //得到原视频


封装好的类

[C#] 纯文本查看 复制代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Net;
using Newtonsoft.Json.Linq;
 
namespace Ppx_Jx
{
    public class Ppx
    {
 
        JObject Json;
        //json
 
        public Ppx(string url)
        {
 
            GetLong(ref url);//长链接
            GetMp4Id(ref url);//视频ID
            GetData(url); //得到json
 
        }
 
 
        public void GetLong(ref string url)
        {
 
            var Beg = (HttpWebRequest)WebRequest.Create(url);
 
            Beg.AllowAutoRedirect = false;
            using (HttpWebResponse Ret = (HttpWebResponse)Beg.GetResponse())
                url = Ret.Headers["location"];
 
 
 
        }
        //得到长链接
 
 
        public void GetMp4Id(ref string url)
        {
            url = url.Substring(26, 19);
            //得到视频ID      
        }
 
        public string GetData(string mp4Id)
        {
            var Beg = (HttpWebRequest)WebRequest.Create($"https://ib-hl.snssdk.com/bds/cell/detail/?version_code=4.2.7&app_name=super&device_id=1988391945639406&channel=App%20Store&resolution=1170*2532&aid=1319&last_channel=App%20Store&last_update_version_code=42691&recommend_disable=0&update_version_code=42780&ac=WIFI&os_version=15.5&device_platform=iphone&iid=805274026772804&device_type=iPhone%2012&cell_id={mp4Id}&cell_type=1&api_version=1");
            var Ret = (HttpWebResponse)Beg.GetResponse();
            var Read = new StreamReader(Ret.GetResponseStream(), Encoding.UTF8);
            string json = Read.ReadToEnd();
 
 
            //序列化
            Json = JObject.Parse(json);
 
 
            Read.Dispose();
            Ret.Dispose();
            return json;
            //得到JSON
        }
 
        public string GetCreateTime()
        {
            DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
 
            return startTime.AddSeconds(Convert.ToInt64(Json["data"]["data"]["display_time"])).ToString("yyy-MM-dd hh:mm:ss");
 
            //得到发布时间
        }
 
 
        public string GetMp4()
        {
            return Json["data"]["data"]["item"]["video"]["video_high"]["url_list"][0]["url"].ToString();
        }//得到原视频
 
        public string GetTitle()
        {
            return Json["data"]["data"]["item"]["content"].ToString();
        }//视频标题
 
        public string GetHeightCover()
        {
            return "https://p9-ppx.byteimg.com/img/" + Json["data"]["data"]["item"]["cover"]["uri"].ToString() + "~1280x720.jpg";
            //得到高清封面图 720
        }
 
 
        public string GetAouthorName()
        {
            return Json["data"]["data"]["item"]["author"]["name"].ToString();
 
            //名称
        }
 
        public string GetAuthorHeadImage()
        {
        return "https://p3-ppx.byteimg.com/img/" + Json["data"]["data"]["item"]["author"]["avatar"]["uri"].ToString()+ "~tplv-ppx-avatar:200:200:q100.jpg";
            //作者头像 jpg类型
        }
 
    }
}


1.png





上一篇:给你网站加密码访问页面源码,分享4款
下一篇:b站评论区土味情话生成器
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|27CaT资源论坛

GMT+8, 2024-9-22 16:47

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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