抖音C#版,自己抓第三方抖音网站

namespace Trill
{
    partial class Main_Window
    {
        /// <summary>
        /// 必需的设计器变量。
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// 清理所有正在使用的资源。
        /// </summary>
        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows 窗体设计器生成的代码

        /// <summary>
        /// 设计器支持所需的方法 - 不要修改
        /// 使用代码编辑器修改此方法的内容。
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Main_Window));
            this.video_player = new AxWMPLib.AxWindowsMediaPlayer();
            this.Refresh = new System.Windows.Forms.Timer(this.components);
            this.last = new System.Windows.Forms.Button();
            this.about = new System.Windows.Forms.Button();
            this.message = new System.Windows.Forms.GroupBox();
            this.icon = new System.Windows.Forms.PictureBox();
            this.ID = new System.Windows.Forms.Label();
            this.Message_Text = new System.Windows.Forms.Label();
            this.Group = new System.Windows.Forms.GroupBox();
            ((System.ComponentModel.ISupportInitialize)(this.video_player)).BeginInit();
            this.message.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.icon)).BeginInit();
            this.Group.SuspendLayout();
            this.SuspendLayout();
            //
            // video_player
            //
            this.video_player.Enabled = true;
            this.video_player.Location = new System.Drawing.Point(12, 12);
            this.video_player.Name = "video_player";
            this.video_player.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("video_player.OcxState")));
            this.video_player.Size = new System.Drawing.Size(232, 412);
            this.video_player.TabIndex = 4;
            //
            // Refresh
            //
            this.Refresh.Enabled = true;
            this.Refresh.Tick += new System.EventHandler(this.Refresh_Tick);
            //
            // last
            //
            this.last.Location = new System.Drawing.Point(260, 439);
            this.last.Name = "last";
            this.last.Size = new System.Drawing.Size(186, 30);
            this.last.TabIndex = 1;
            this.last.Text = "下一个Video";
            this.last.UseVisualStyleBackColor = true;
            this.last.Click += new System.EventHandler(this.last_Click);
            //
            // about
            //
            this.about.Location = new System.Drawing.Point(12, 439);
            this.about.Name = "about";
            this.about.Size = new System.Drawing.Size(100, 30);
            this.about.TabIndex = 2;
            this.about.Text = "关于";
            this.about.UseVisualStyleBackColor = true;
            this.about.Click += new System.EventHandler(this.about_Click);
            //
            // message
            //
            this.message.Controls.Add(this.icon);
            this.message.Controls.Add(this.ID);
            this.message.Location = new System.Drawing.Point(250, 12);
            this.message.Name = "message";
            this.message.Size = new System.Drawing.Size(220, 97);
            this.message.TabIndex = 6;
            this.message.TabStop = false;
            this.message.Text = "作品信息:";
            //
            // icon
            //
            this.icon.Location = new System.Drawing.Point(142, 20);
            this.icon.Name = "icon";
            this.icon.Size = new System.Drawing.Size(52, 52);
            this.icon.TabIndex = 1;
            this.icon.TabStop = false;
            //
            // ID
            //
            this.ID.AutoSize = true;
            this.ID.Location = new System.Drawing.Point(6, 39);
            this.ID.Name = "ID";
            this.ID.Size = new System.Drawing.Size(29, 12);
            this.ID.TabIndex = 0;
            this.ID.Text = "Data";
            //
            // Message_Text
            //
            this.Message_Text.AutoSize = true;
            this.Message_Text.Location = new System.Drawing.Point(8, 19);
            this.Message_Text.Name = "Message_Text";
            this.Message_Text.Size = new System.Drawing.Size(29, 12);
            this.Message_Text.TabIndex = 7;
            this.Message_Text.Text = "Text";
            //
            // Group
            //
            this.Group.Controls.Add(this.Message_Text);
            this.Group.Location = new System.Drawing.Point(250, 121);
            this.Group.Name = "Group";
            this.Group.Size = new System.Drawing.Size(220, 303);
            this.Group.TabIndex = 8;
            this.Group.TabStop = false;
            this.Group.Text = "评论";
            //
            // Main_Window
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(482, 481);
            this.Controls.Add(this.Group);
            this.Controls.Add(this.message);
            this.Controls.Add(this.about);
            this.Controls.Add(this.video_player);
            this.Controls.Add(this.last);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.MaximizeBox = false;
            this.Name = "Main_Window";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Trill";
            this.Load += new System.EventHandler(this.Main_Window_Load);
            ((System.ComponentModel.ISupportInitialize)(this.video_player)).EndInit();
            this.message.ResumeLayout(false);
            this.message.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.icon)).EndInit();
            this.Group.ResumeLayout(false);
            this.Group.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion
        private AxWMPLib.AxWindowsMediaPlayer video_player;
        private System.Windows.Forms.Timer Refresh;
        private System.Windows.Forms.Button last;
        private System.Windows.Forms.Button about;
        private System.Windows.Forms.GroupBox message;
        private System.Windows.Forms.PictureBox icon;
        private System.Windows.Forms.Label ID;
        private System.Windows.Forms.Label Message_Text;
        private System.Windows.Forms.GroupBox Group;
    }
}

然后是C#代码:

using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Windows.Forms;

namespace Trill
{
    public partial class Main_Window : Form
    {
        public Main_Window()
        {
            InitializeComponent();
        }

        private void Main_Window_Load(object sender, EventArgs e)
        {
            String video = "https://dy.lujianqiang.com/web";

            //MessageBox.Show(video);
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(video);
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            Stream ResStream = response.GetResponseStream();
            Encoding encoding = Encoding.GetEncoding("utf-8");
            StreamReader streamReader = new StreamReader(ResStream, encoding);
            var jObject = JObject.Parse(streamReader.ReadToEnd());

            var nickname = jObject["nickname"].ToString();
            nickname = nickname.Replace("\"", "");
            ID.Text = "作者ID:" + nickname;

            var icon_address = jObject["avatar"].ToString();
            icon_address = icon_address.Replace("\"", "");
            //icon_address = icon_address.Replace("/", "\\");
            //icon_address = icon_address.Replace("https", "http");
            //MessageBox.Show(icon_address);
            icon.Image = Image.FromStream(System.Net.WebRequest.Create(icon_address).GetResponse().GetResponseStream());

            var address = jObject["video"].ToString();
            address = address.Replace("\"", "");
            address = address.Replace("/", "\\");
            address = address.Replace("https", "http");
            video_player.URL = address;
            video_player.Ctlcontrols.play();

            var comments = jObject["comments"].ToString();
            comments = comments.Replace(",", "");
            comments = comments.Replace("\"", "");

            comments = comments.Replace("[", "");
            comments = comments.Replace("]", "");
            this.Message_Text.Text = comments;
            //MessageBox.Show(comments);

        }

        private void last_Click(object sender, EventArgs e)
        {
            String video = "https://dy.lujianqiang.com/web";//json in

            //MessageBox.Show(video);
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(video);
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            Stream ResStream = response.GetResponseStream();
            Encoding encoding = Encoding.GetEncoding("utf-8");
            StreamReader streamReader = new StreamReader(ResStream, encoding);
            var jObject = JObject.Parse(streamReader.ReadToEnd());

            var nickname = jObject["nickname"].ToString();
            nickname = nickname.Replace("\"", "");
            ID.Text = "作者ID:" + nickname;

            var icon_address = jObject["avatar"].ToString();
            icon_address = icon_address.Replace("\"", "");
            //icon_address = icon_address.Replace("/", "\\");
            //icon_address = icon_address.Replace("https", "http");
            //MessageBox.Show(icon_address);
            icon.Image = Image.FromStream(System.Net.WebRequest.Create(icon_address).GetResponse().GetResponseStream());

            var address = jObject["video"].ToString();//json如何使用
            address = address.Replace("\"", "");
            address = address.Replace("/", "\\");
            address = address.Replace("https", "http");
            video_player.URL = address;
            video_player.Ctlcontrols.play();

            var comments = jObject["comments"].ToString();
            comments = comments.Replace(",", "");
            comments = comments.Replace("[", "");
            comments = comments.Replace("]", "");
            comments = comments.Replace("\"", "");//转化符号

            this.Message_Text.Text = comments;

        }

        private void previous_Click(object sender, EventArgs e)
        {

        }
        private void about_Click(object sender, EventArgs e)
        {
            MessageBox.Show("这是一个抖音第三方客户端...:]","About");
        }

        private void Refresh_Tick(object sender, EventArgs e)
        {
            if (video_player.playState == WMPLib.WMPPlayState.wmppsStopped)
            {
                video_player.Ctlcontrols.play();
            }
        }

    }

然后就完成啦

------------------------------------转载请注明出处

原文地址:https://www.cnblogs.com/Frank-dev-blog/p/9406826.html

时间: 2024-08-30 13:15:48

抖音C#版,自己抓第三方抖音网站的相关文章

一篇文章教会你用Python抓取抖音app热点数据

今天给大家分享一篇简单的安卓app数据分析及抓取方法.以抖音为例,我们想要抓取抖音的热点榜数据. 要知道,这个数据是没有网页版的,只能从手机端下手. 首先我们要安装charles抓包APP数据,它是一款收费的抓包修改工具,易上手,数据请求容易控制,修改简单,抓取数据的开始暂停方便等优势,网上也有汉化版,下载地址为http://www.zdfans.com/html/42074.html,一路默认安装就ok了. 安装完成后要设置代理,依次点击代理——代理设置. 然后在手机端设置代理,如下图所示:

一篇文章教会你用Python抓取抖音app热点数据!

今天给大家分享一篇简单的安卓app数据分析及抓取方法.以抖音为例,我们想要抓取抖音的热点榜数据. 要知道,这个数据是没有网页版的,只能从手机端下手. 首先我们要安装charles抓包APP数据,它是一款收费的抓包修改工具,易上手,数据请求容易控制,修改简单,抓取数据的开始暂停方便等优势,网上也有汉化版,下载地址为http://www.zdfans.com/html/42074.html,一路默认安装就ok了. 安装完成后要设置代理,依次点击代理——代理设置. 然后在手机端设置代理,如下图所示:

autoJS抖音极速版自动刷频

环境:安卓7.0以上 auto.waitFor(); app.launchApp('抖音极速版') sleep(4000); youngWin(); newVersion() i = 1; while (true) { toast("滑动" + i + '次') WidthOne = random(300, 800); HeightOne = random(1600, 1800); WidthTwo = random(300, 800); HeightTwo = random(500,

C#版的抓包软件

C#版的抓包软件 [创建时间:2015-09-10 22:37:04] NetAnalyzer下载地址 不好意思啊,NetAnalyzer停更有点长了,今天继续填坑^&^ NetAnalyzer实现结构 在上一篇中介绍一点VC++开发环境的配置,与基本的运行方式.因为NetAnalyzer使用的C#作为开发语言,所以在此主要介绍一些在C#环境下的开发环境的配置,与一些基本开发情况,力求在完成本篇后后,读者可以制作一个简单的抓包程序. 在开始编程前先要介绍连个.Net类库SharpPcap.dll

CODEVS——T1332 上白泽慧音 || 洛谷——P1726 上白泽慧音

http://codevs.cn/problem/1332/|| https://www.luogu.org/problem/show?pid=1726#sub 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题解 查看运行结果 题目描述 Description 在幻想乡,上白泽慧音是以知识渊博闻名的老师.春雪异变导致人间之里的很多道路都被大雪堵塞,使有的学生不能顺利地到达慧音所在的村庄.因此慧音决定换一个能够聚集最多人数的村庄作为新的教学地点.人间之里由N个村

Dota2ex国内第三方Dota2开箱网站教程,玄学开箱,氪金改命!

Dota2ex国内第三方Dota2开箱网站教程,玄学开箱,氪金改命! dota2ex是dota2case的纯中文版,充值方式,文字,各种说明都有优化成了国内玩家喜欢的形式,方便国内用户玩dota2开箱.点击访问网站.使用推荐码dota2sites能获取5%的充值加成. 单击右上角登陆 选择使用手机号或微信扫码登陆 这里有一个每日奖金新注册用户会自动获得赠送金额以及可以抽取免费奖金或饰品 这个网站相比于其他网站的亮点在于其有一个更有可玩性的模式叫做汰换合约单击左上角Hot图标即可进行汰换合约,玩家

HTML面抓速度取对网站的影响有哪些

HTML面抓速度取对网站的影响有哪些1.网站改版 如果你的网站升级改版,并且针对部分URL进行了修正,那么它可能急需搜索引擎抓取,重新对页面内容进行评估. 这个时候其实有一个便捷的小技巧:那就是主动添加URL到sitemap,并且在百度后台更新,第一时间告知搜索引擎它的变化. 2.网站排名 大部分站长认为,自百度熊掌号上线以来,它解决了收录问题,实际上目标URL,只有不停的被抓取,它才可以不断的重新评估权重,从而提升排名. 因此,当你有需要参与排名的页面,你有必要将其放在抓取频率较高的栏目. 3

抖音引流:六个抖音爆粉攻略,带你疯狂打造精准流量池!

要是说2013年.2014年,是微商的鼎盛时代,那么2019年必定就是短视频的红利期.抖音作为流量聚集最大的一个平台,日活跃用户能够达到1.5亿,这个数据可以说是非常的惊人.其实无论是微商时代,还是抖音时代,他们都有爆粉快速引流的特点.那么在短视频天下,又该如何用抖音快速引流精准粉?精准流量=客源,无论是实体店铺还是互联网新型企业,关于流量聚集能力这一方面,都是摆在商家面前的一大难题.但是有需求必定会带动供应链的产生,抖音短视频的营销模式,帯动了不少引流行业兴起,比如流量星球的抖音群控系统.抖音

微信电脑版怎么修改信息提示音

微信电脑版修改信息提示音的方法如下: 1.安装最新版的电脑微信 微信文件安装在 D:/software/weChat文件夹中 2.安装eXeScope软件,这个网上可以找到. 3.电脑微信关闭状态,打开eXeScope.exe文件. 4.打开微信根目录,找到WeChatResource.dll文件 5.用eXeScope打开WeChatResource.dll,并如图找到wave中的118.118就是微信的通知文件. 6.找到我们想要更改的铃声.并重命名为118.wav 7.导入我们新的铃声文件