Giter VIP home page Giter VIP logo

seam's Introduction

Seam

Seam

SBtream 项目, 经历 python 不成熟的模仿, Java 重构烂尾, 目前使用 rust 进行重构开发

多平台直播源地址获取

待办

欢迎各位大佬 PR , 积极响应, 友善沟通, 快速 CR, 给您最好的开源体验

  • GUI 从获取模式切换为订阅模式
  • 添加日志模块, 以便于用户反馈问题
    • 输出日志文件
  • 链接识别
    • 规定每个平台都需要实现判断一个链接是否是自己的, 并返回正确的 rid
  • 提取 CLI GUI 公共模块
    • util
    • config
      • 即使 cli 和 gui 有部分不重叠的部分, 但应该还是重叠部分更多
  • I18N
  • GUI action 添加便携版本, 方便已经安装了 WebView2 的用户使用

GUI

GUI

CLI

❯ .\seam.exe -l douyu -i 88080
http://url1

http://url2

下载

Releases · seam 下载 GUI/CLI可执行文件

使用

平台 代号 <RID> 位置 详情 弹幕
B 站 bili https://live.bilibili.com/<RID>
斗鱼 douyu https://www.douyu.com/<RID>https://www.douyu.com/xx/xx?rid=<RID>
抖音 douyin https://live.douyin.com/<RID>
虎牙 huya https://huya.com/<RID>
快手 ks https://live.kuaishou.com/u/<RID>
CC cc https://cc.163.com/<RID>
花椒 huajiao https://www.huajiao.com/l/<RID>
艺气山 yqs https://www.173.com/<RID>
棉花糖 mht https://www.2cq.com/<RID>
kk kk https://www.kktv5.com/show/<RID>
千帆 qf https://qf.56.com/<RID>
Now now https://now.qq.com/pcweb/story.html?roomid=<RID>
映客 inke https://www.inke.cn/liveroom/index.html?uid=<RID>
afreeca afreeca https://bj.afreecatv.com/<RID>
panda panda https://www.pandalive.co.kr/channel/<RID>
flex flex https://www.flextv.co.kr/channels/<RID>
wink wink https://www.winktv.co.kr/channel/<RID>

配置

config.toml 放置在 seam 可执行文件所在目录下

# 播放器路径或命令
# 请自行安装播放器, 请确认它可以通过命令行+链接打开视频文件
[play]
# potplayer 样例
# bin = "C:\\Program Files (x86)\\Pure Codec\\x64\\PotPlayerMini64.exe"
bin = "mpv"
# 播放器参数
args = []

# headers 支持所有合法 http 请求头字段
# global 为全局请求头, 会被各平台请求头覆盖
# 请注意 不要覆盖虎牙的 user-agent, 否则会导致获取失败
[headers.global]
# user-agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.1901.200"

# 抖音 cookie 必须
[headers.douyin]
cookie = "xxxx"

# 快手 cookie 必须
[headers.ks]
cookie = "xxxx"

# 斗鱼设置登录账户 cookie 情况下可以获取到备用线路高清源
[headers.douyu]
cookie = "xxxx"

# [rid]: 房间号
# [title]: 标题
# [time]: 时间戳
# [date]: 日期
[file_name]
# 录制文件标题
video = "[rid]-[title]-[date]-[time]"
# danmu文件标题
danmu = "[rid]-[title]-[date]-[time]"

cookie 获取方法: 额外说明

路线

seam

相关项目

贡献者

GitHub Contributors

感谢

Star History

Star History Chart

seam's People

Contributors

borber avatar cxumol avatar dependabot[bot] avatar eweca-d avatar fwqaaq avatar h3fang avatar justdoiting avatar kirito41dd avatar springzilan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

seam's Issues

抖音直播源的清晰度

直播地址
https://live.douyin.com/732385677810

如果没开播的话从主机游戏区找个画质好的就行
https://live.douyin.com/category/1_4609

目前只能获取到一个 720P 的清晰度,而且只有 30 帧,有没有办法获取到所有清晰度,或者用参数获取不同的清晰度?

这条直播源是网页源码里找到的,1080P 60FPS
http://pull-l3.douyincdn.com/third/stream-112528671176917471.m3u8?auth_key=1677416524-0-0-d413c445f15c28acb23adab388ec7a2b

这条直播源是用 seam 获取到的,720P 30FPS
http://pull-l3.douyincdn.com/third/stream-112528671176917471_hd.m3u8?auth_key=1677417994-0-0-e249d4460ee6c4ef12dc1af039f700e5

另外输出打印的时候可以优化一下排版吗? 让直播源独占一行,这样可以用 ctrl+shift+→快速选取
"title":"xxxxx"
"format":"flv"
"url":
http://xxxxxxxxxxxxx

Node结构体是否可以增强一下,以及是否可以使用trait bound约束接口

Node结构体是否可以增强一下,现在的标准Node结构体是:

#[derive(Serialize, Debug)]
pub struct Node {
    /// 清晰度
    pub rate: String,
    /// 直播源地址 后续考虑使用数组来安装
    pub url: String,
}

这个结构体太过简略了,大部分情况下,我们至少还希望获取直播流的格式,比如BILIBILI经常能获取的可选直播流格式为“TS/FLV...”,在之前的pr中我强行将rate格式为"[格式]-[清晰度][线路编号]”,这或许不是一个较好的选择。一个我建议的构建思路如下:

#[derive(Debug)]
pub enum ShowType {
    /// 返回直播源地址
    On(NodeList),
    Off,
    Error(String),
}

#[derive(Serialize, Debug)]
pub struct NodeList {
    pub nodes: Vec<Node>,
}

#[derive(Serialize, Debug)]
pub struct Node {
    /// 格式
    pub format: Format,
    /// 清晰度
    pub rate: Rate,
    /// 线路(虚拟)
    pub channel: usize,
    /// 直播源地址 后续考虑使用数组来安装
    pub url: String,
}

#[derive(Serialize, Debug)]
pub struct Rate{
    pub rate: usize,
    pub label: String,
}

#[derive(Serialize, Debug)]
pub enum Format {
    FLV,
    TS,
    Other(String),
}

同上,此时我们有了详细的Rate信息(以usize计),意味着我们可以使用std::cmp::PartialOrd这一类的标注库trait进行Node的排序,从而完成路线中“根据画质排序”的承诺。另外label用来标记“原画/高清”之类的tag,由于每个平台可能使用的tag不同,这个需要由各个直播模块自行指定。

Format格式进行type化则是有利于以后假如引入下载功能后的程序编写。

以上各struct可以使用的new,push之类的impl以便各直播子模块使用。


另一个提案是有关于接口规范化的。目前的程序其实内含一个强制性约定的get函数,所以要不要尝试下比如trait bound一类的东西,比如引入:

use async_trait::async_trait;

#[async_trait]
pub trait URL {
    async fn get_url(&self) -> Result<ShowType>;
}

#[async_trait]
pub trait Download {
    async fn download(&self) -> Result<()>;
}

然后对于每个直播模块,可以有:

use async_trait::async_trait;

pub struct Bilibili(String);

impl From<String> for Bilibili {
    fn from(rid: String) -> Self {
        Self(rid)
    }
}

#[async_trait]
impl URL for Bilibili {
    async fn get_url(&self) -> Result<ShowType> {
        get(self.0.as_str()).await
    }
}

这个其实意义不大,我就是觉得蛮有意思的,而且更rustacean。

同样有个蛮有意思的就是使用宏来match arg.command。match的command太多略丑陋,写个宏应该能实现类似match_command!(Bili, Douyu, Huya)这种格式,这个也是纯娱乐,实际对于程序的性能没啥提高。

最后,modle.rs是不是应该是model.rs,貌似单词拼错啦?

linux如何使用

之前使用的是streamlink
偶然发现大佬的项目
使用release:seam-v0.1.23.aarch64-unknown-linux-musl.tar.xz
系统:ubuntu 22.04
测试直播平台:pandalive
下载后解压两次,得到seam和config.json
安装ffmpeg
之后用./seam panda giyoming
输出结果:-bash: ./seam: cannot execute binary file: Exec format error�
再请作者帮忙解说一下linux用法
谢谢
另外请问19禁直播间是否需要登入才能录制呢?
如果可以录制会协助增强这个repo的

未完成列表中的爬取主播名称建议取消

因为有一些官方的直播间的标题会撞,然后有一些主播的ID反而比较复杂,更适合自定义,可以作为保留选项,但是希望还是能够使用自定义命名,另外图形界面我可以试试,看看能不能做出来,目前倾向于electron-vue或者qt到时候看看。

Bilibili获取直播间信息出错

请尝试长期直播的直播间id:

  • "6" LOL
  • "13" DOTA2

使用这两个RID会错误的提示直播间不存在,经过检查,这是由于get_real_room_info返回了None。此函数中resp确实返回了数据,但是在紧接着的一步正则提取时,发生了问题。

此外,real-url是可以正确的获取直播流的url的。

映客直播存在错误

映客直播监听,假设1点监听,主播2点开播,录制的只有声音,并且官方客户端也存在此问题,解决办法为映客直播开启以后,监听一分钟,自动结束,然后再监听录制,即可解决

录播方案的讨论

最近在考虑是不是可以着手开始实现最基础的直播下载功能了?

录播使用ffmpeg我想应当是没啥疑问,但是具体怎么使用不知道@Borber有没有想法呢?是直接使用二进制文件,还是使用动态库,还是通过cc库使用静态链接到ffmpeg源代码?

直接使用二进制文件应当是最容易的,只要command执行,"ffmpeg -i [url] -c copy [output.mp4]"就完事了。但是掌控力会降低,而且如果使用tauri的话估计可能还会有终端的黑框跳出来?其他两个估计都会有点复杂,但是不会弹黑框。静态链接最麻烦,但是也最清爽,不仅可以精简掉不用的代码,还能把二者整合成一个可执行文件。

如果作为初版实现进行考虑,我提议暂且先直接配置ffmpeg二进制文件?

探讨一下douyin获取直链的方案。

douyin现阶段找到两个接口,其中一个就是本项目用的,请求需要携带cookie,这一行 ,我也是用自己抓的固定的cookie做请求,现阶段是公共API每天很多人用,还是想改为随机获取cookie,就是先请求一次,从服务端获取cookie然后保存,第二次请求时候携带上一次获取的cookie,这样就能避免每次都是相同的cookie,不过我现阶段获取到的值还是有些问题

现在一直用以下的接口,不需要携带cookie,不过需要获取room_id
https://live.douyin.com/webcast/room/info_by_scene/?aid=6383&live_id=1&device_platform=web&language=zh-CN&enter_from=web_search&cookie_enabled=true&screen_width=1920&screen_height=1080&browser_language=zh-CN&browser_name=Chrome&room_id=xxxxxxxxxxxxxxxxx&scene=pc_stream_4k

是否可以尝试用 Boa 作为内嵌的 JS 执行引擎?

boa 是一个纯 Rust 实现的 JS 引擎,虽然目前尚不完善,但有测试一下的价值;如果可用,那么所有现在或未来存在的需要执行 js 才能获取直播流地址的场合都可以降低服务器开销和地址获取延迟。

希望大家可以推荐一些不错的主播,

推荐的优质主播, 直接加到config 里面 作为默认主播列表.

如果数量比较多的话 , 可以考虑 不是按照平台来分类,而是 按照直播类型来分类 就可能比较好一点

直播码率

部分直播只能获取720P的直播源,而且码率也很低,不知道有没有什么办法可以实现获取不同码率的直播源

关于使用Tauri作为GUI框架的一个提议

我看关于“线路”部分的说明里包含有GUI,然后作者的repos有不少使用TS/JS作为主力语言,再加上本项目对UI性能也不是特别敏感,所以我提议使用Tauri作用GUI的备选项甚至首选项。

同时提议将现有代码封装成为一个库,变成类似:

seam
|- seam_core(核心代码)
|- seam_cli(命令行程序)
|- seam_tauri (GUI程序)
|- ....

其中seam_core作为核心库供cli和tauri调用。

转化成JS无法运行

image
如图我已经获取到了sing
image
可我请求的时候会提示非法请求
image

这是我的代码,可以帮我找一下问题吗?

const finalRoomID = ’房间id输入这里‘
const dt = Math.floor(new Date().getTime() / 1e3);
const html = await axios.get(https://www.douyu.com/${finalRoomID});
let str = "10000000000000000000000000001501";
let reg =
/var vdwdae325w_64we.?function ub98484234(.?return eval(strc)(.?);}/;
let info = reg.exec(html.data);
info = info[0];
info = info.replace(/eval(strc)(\w+,\w+,.\w+);/, "strc;");
let signFunc = eval(info + ub98484234(0,0,0));
let funData = signFunc.replace("(function", "let ccc = function");
let v = signFunc.match(/\w{12}/);
v = v[0];
funData = funData.replace(
"rt;})",
rt;}; ccc(${finalRoomID}, "${str}", ${dt})
);
let cb = ${finalRoomID}, "${str}", ${dt}${v};
let rb = md5(cb);
funData = funData.replace("CryptoJS.MD5(cb).toString();", "${rb}\";);
let sign = eval(funData);
let obj = {};
reg = /(v=)[0-9]
/;
obj.v = reg.exec(sign);
obj.v = obj.v[0].replace("v=", "");
reg = /(tt=)[0-9]/;
obj.tt = reg.exec(sign);
obj.tt = obj.tt[0].replace("tt=", "");
reg = /(sign=).
/;
obj.sign = reg.exec(sign);
obj.sign = obj.sign[0].replace("sign=", "");
obj.rid = finalRoomID;
obj.did = str;

const value = await axios({
url: https://m.douyu.com/api/room/ratestream,
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"User-Agent":
"Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/111.0.0.0",
},
data: obj,
method: "post",
});

一些直播源失效

一些直播源失效,比如 douyu、huya、now。看到 real-url 项目有更新,希望作者大大能跟进一下,非常感谢。

关于更详细的启动步骤

感谢作者的分享,
但我可能因为没有rust经历,
我读完readMe也没看明白我应该按哪几步走,seam.exe又是哪来的😭
可以有更详细的说明嘛,我觉得会有利于广泛使用和反馈

试了一下,可以直接使用 `cargo install --git https://github.com/Borber/seam.git --locked` 全局安装 seam

如题,感觉可以加入到 Readme.md 中作为安装方式的一种?
另附编译安装日志,编译后大小 4,283,904 字节:

C:\Users\XXXX>cargo install --git https://github.com/Borber/seam.git --locked
    Updating git repository `https://github.com/Borber/seam.git`
  Installing seam v0.1.16 (https://github.com/Borber/seam.git#d272937a)
    Updating crates.io index
  Downloaded tower-service v0.3.2
  Downloaded utf-8 v0.7.6
  Downloaded tungstenite v0.18.0
  Downloaded async-trait v0.1.63
  Downloaded dyn-clone v1.0.10
  Downloaded unicode-bidi v0.3.10
  Downloaded hyper-tls v0.5.0
  Downloaded http-body v0.4.5
  Downloaded ipnet v2.7.1
  Downloaded phf_generator v0.11.1
  Downloaded phf v0.11.1
  Downloaded reqwest v0.11.14
  Downloaded regress v0.4.1
  Downloaded phf_shared v0.11.1
  Downloaded try-lock v0.2.4
  Downloaded tokio-native-tls v0.3.0
  Downloaded unicode-general-category v0.6.0
  Downloaded tokio-tungstenite v0.18.0
  Downloaded winreg v0.10.1
  Downloaded urlencoding v2.1.2
  Downloaded boa_gc v0.16.0
  Downloaded boa_profiler v0.16.0
  Downloaded synstructure v0.12.6
  Downloaded tokio v1.25.0
  Downloaded boa_interner v0.16.0
  Downloaded boa_engine v0.16.0
  Downloaded hyper v0.14.23
  Downloaded ryu-js v0.2.2
  Downloaded proc-macro2 v1.0.50
  Downloaded clap v4.1.4
  Downloaded gc v0.4.1
  Downloaded gc_derive v0.4.1
  Downloaded phf_macros v0.11.1
  Downloaded native-tls v0.2.11
  Downloaded md-5 v0.10.5
  Downloaded boa_unicode v0.16.0
  Downloaded fast-float v0.2.0
  Downloaded colored v2.0.0
  Downloaded 38 crates (2.4 MB) in 4.70s
   Compiling proc-macro2 v1.0.50
   Compiling quote v1.0.23
   Compiling unicode-ident v1.0.6
   Compiling autocfg v1.1.0
   Compiling syn v1.0.107
   Compiling cfg-if v1.0.0
   Compiling winapi v0.3.9
   Compiling windows_x86_64_msvc v0.42.1
   Compiling version_check v0.9.4
   Compiling memchr v2.5.0
   Compiling windows-sys v0.42.0
   Compiling log v0.4.17
   Compiling lock_api v0.4.9
   Compiling parking_lot_core v0.9.6
   Compiling pin-project-lite v0.2.9
   Compiling itoa v1.0.5
   Compiling bytes v1.3.0
   Compiling smallvec v1.10.0
   Compiling typenum v1.16.0
   Compiling scopeguard v1.1.0
   Compiling futures-core v0.3.25
   Compiling generic-array v0.14.6
   Compiling tokio v1.25.0
   Compiling once_cell v1.17.0
   Compiling parking_lot v0.12.1
   Compiling socket2 v0.4.7
   Compiling mio v0.8.5
   Compiling slab v0.4.7
   Compiling serde_derive v1.0.152
   Compiling num_cpus v1.15.0
   Compiling futures-task v0.3.25
   Compiling tinyvec_macros v0.1.0
   Compiling fnv v1.0.7
   Compiling tinyvec v1.6.0
   Compiling http v0.2.8
   Compiling tokio-macros v1.8.2
   Compiling indexmap v1.9.2
   Compiling futures-util v0.3.25
   Compiling native-tls v0.2.11
   Compiling httparse v1.8.0
   Compiling serde v1.0.152
   Compiling futures-sink v0.3.25
   Compiling unicode-normalization v0.1.22
   Compiling tracing-core v0.1.30
   Compiling schannel v0.1.21
   Compiling getrandom v0.2.8
   Compiling num-traits v0.2.15
   Compiling siphasher v0.3.10
   Compiling hashbrown v0.12.3
   Compiling pin-utils v0.1.0
   Compiling rand_core v0.6.4
   Compiling percent-encoding v2.2.0
   Compiling form_urlencoded v1.1.0
   Compiling rand v0.8.5
   Compiling phf_shared v0.11.1
   Compiling tracing v0.1.37
   Compiling block-buffer v0.10.3
   Compiling crypto-common v0.1.6
   Compiling proc-macro-error-attr v1.0.4
   Compiling num-integer v0.1.45
   Compiling ppv-lite86 v0.2.17
   Compiling unicode-bidi v0.3.10
   Compiling futures-channel v0.3.25
   Compiling unicode-xid v0.2.4
   Compiling libc v0.2.139
   Compiling synstructure v0.12.6
   Compiling idna v0.3.0
   Compiling rand_chacha v0.3.1
   Compiling digest v0.10.6
   Compiling tokio-util v0.7.4
   Compiling phf_generator v0.11.1
   Compiling proc-macro-error v1.0.4
   Compiling io-lifetimes v1.0.4
   Compiling serde_json v1.0.91
   Compiling unicode-general-category v0.6.0
   Compiling try-lock v0.2.4
   Compiling ryu v1.0.12
   Compiling thiserror v1.0.38
   Compiling want v0.3.0
   Compiling h2 v0.3.15
   Compiling phf_macros v0.11.1
   Compiling gc_derive v0.4.1
   Compiling url v2.3.1
   Compiling tokio-native-tls v0.3.0
   Compiling http-body v0.4.5
   Compiling thiserror-impl v1.0.38
   Compiling num-bigint v0.4.3
   Compiling winreg v0.10.1
   Compiling encoding_rs v0.8.31
   Compiling httpdate v1.0.2
   Compiling cpufeatures v0.2.5
   Compiling tower-service v0.3.2
   Compiling sha1 v0.10.5
   Compiling hyper v0.14.23
   Compiling phf v0.11.1
   Compiling time v0.1.45
   Compiling gc v0.4.1
   Compiling winapi-util v0.1.5
   Compiling iana-time-zone v0.1.53
   Compiling bitflags v1.3.2
   Compiling utf-8 v0.7.6
   Compiling rustc-hash v1.1.0
   Compiling base64 v0.13.1
   Compiling async-trait v0.1.63
   Compiling heck v0.4.0
   Compiling static_assertions v1.1.0
   Compiling paste v1.0.11
   Compiling os_str_bytes v6.4.1
   Compiling byteorder v1.4.3
   Compiling anyhow v1.0.68
   Compiling tungstenite v0.18.0
   Compiling clap_lex v0.3.1
   Compiling clap_derive v4.1.0
   Compiling boa_interner v0.16.0
   Compiling chrono v0.4.23
   Compiling boa_unicode v0.16.0
   Compiling termcolor v1.2.0
   Compiling hyper-tls v0.5.0
   Compiling is-terminal v0.4.2
   Compiling boa_gc v0.16.0
   Compiling serde_urlencoded v0.7.1
   Compiling atty v0.2.14
   Compiling aho-corasick v0.7.20
   Compiling regress v0.4.1
   Compiling regex-syntax v0.6.28
   Compiling adler v1.0.2
   Compiling mime v0.3.16
   Compiling boa_profiler v0.16.0
   Compiling lazy_static v1.4.0
   Compiling dyn-clone v1.0.10
   Compiling base64 v0.21.0
   Compiling ryu-js v0.2.2
   Compiling fast-float v0.2.0
   Compiling strsim v0.10.0
   Compiling tap v1.0.1
   Compiling ipnet v2.7.1
   Compiling boa_engine v0.16.0
   Compiling reqwest v0.11.14
   Compiling clap v4.1.4
   Compiling regex v1.7.1
   Compiling colored v2.0.0
   Compiling miniz_oxide v0.6.2
   Compiling tokio-tungstenite v0.18.0
   Compiling md-5 v0.10.5
   Compiling hex v0.4.3
   Compiling urlencoding v2.1.2
   Compiling seam v0.1.16 (C:\Users\XXXX\.cargo\git\checkouts\seam-4d25336006d5b41c\d272937)
    Finished release [optimized] target(s) in 7m 41s
  Installing C:\Users\XXXX\.cargo\bin\seam.exe
   Installed package `seam v0.1.16 (https://github.com/Borber/seam.git#d272937a)` (executable `seam.exe`)

抖音返回的json格式有点问题

{"default_resolution":"HD1","extra":{"anchor_interact_profile":0,"audience_interact_profile":0,"bframe_enable":false,"bitrate_adapt_strategy":0,"bytevc1_enable":false,"default_bitrate":0,"fps":0,"gop_sec":0,"h265_enable":false,"hardware_encode":false,"height":1080,"max_bitrate":0,"min_bitrate":0,"roi":false,"sw_roi":false,"video_profile":0,"width":1920},"flv_pull_url":{"FULL_HD1":"http://pull-l3.douyincdn.com/third/stream-112894897391927775_uhd.flv?auth_key=1682881138-0-0-45f43cf02cf7d21f731d6651ba777a7e","HD1":"http://pull-l3.douyincdn.com/third/stream-112894897391927775_hd.flv?auth_key=1682881138-0-0-e66c5df85749620fbaf3ba7aceb9055a","SD1":"http://pull-l3.douyincdn.com/third/stream-112894897391927775_ld.flv?auth_key=1682881138-0-0-3da644010272ffe02c7cf79d572a1bdc","SD2":"http://pull-l3.douyincdn.com/third/stream-112894897391927775_sd.flv?auth_key=1682881138-0-0-5e2e22e8dd75c160979481fd40163d07"},"hls_pull_url":"http://pull-l3.douyincdn.com/third/stream-112894897391927775_hd.m3u8?auth_key=1682881138-0-0-57e26e847fe730bf18066b37a8d7e58b","hls_pull_url_map":{"FULL_HD1":"http://pull-l3.douyincdn.com/third/stream-112894897391927775_uhd.m3u8?auth_key=1682881138-0-0-aa10816dd85a5803c5809ce769c5ca57","HD1":"http://pull-l3.douyincdn.com/third/stream-112894897391927775_hd.m3u8?auth_key=1682881138-0-0-57e26e847fe730bf18066b37a8d7e58b","SD1":"http://pull-l3.douyincdn.com/third/stream-112894897391927775_ld.m3u8?auth_key=1682881138-0-0-8005e4937111ef97df7bd0e2db4df8f1","SD2":"http://pull-l3.douyincdn.com/third/stream-112894897391927775_sd.m3u8?auth_key=1682881138-0-0-d18b29cd25dce106ae63275051725592"},"live_core_sdk_data":{"pull_data":{"options":{"default_quality":{"additional_content":"","disable":0,"fps":0,"level":3,"name":"超清","resolution":"1280x720","sdk_key":"hd","v_bit_rate":0,"v_codec":"264"},"qualities":[{"additional_content":"","disable":0,"fps":25,"level":1,"name":"标清","resolution":"960x540","sdk_key":"ld","v_bit_rate":1000000,"v_codec":"264"},{"additional_content":"","disable":0,"fps":30,"level":2,"name":"高清","resolution":"1280x720","sdk_key":"sd","v_bit_rate":2000000,"v_codec":"264"},{"additional_content":"","disable":0,"fps":30,"level":3,"name":"超清","resolution":"1280x720","sdk_key":"hd","v_bit_rate":4000000,"v_codec":"264"},{"additional_content":"","disable":0,"fps":45,"level":4,"name":"蓝光","resolution":"1920x1080","sdk_key":"uhd","v_bit_rate":6417000,"v_codec":"264"},{"additional_content":"","disable":0,"fps":0,"level":5,"name":"原画","resolution":"1920x1080","sdk_key":"origin","v_bit_rate":6417000,"v_codec":"264"}]},"stream_data":"{\"common\":{\"session_id\":\"037-202304240328588C62055B3546270B088B\",\"rule_ids\":\"{\\\"ab_version_trace\\\":null,\\\"sched\\\":\\\"{\\\\\\\"result\\\\\\\":{\\\\\\\"hit\\\\\\\":\\\\\\\"default\\\\\\\",\\\\\\\"cdn\\\\\\\":541}}\\\"}\",\"app_id\":\"100102\"},\"data\":{\"uhd\":{\"main\":{\"flv\":\"http://pull-l3.douyincdn.com/third/stream-112894897391927775_uhd.flv?auth_key=1682881138-0-0-45f43cf02cf7d21f731d6651ba777a7e\",\"hls\":\"http://pull-l3.douyincdn.com/third/stream-112894897391927775_uhd.m3u8?auth_key=1682881138-0-0-aa10816dd85a5803c5809ce769c5ca57\",\"cmaf\":\"\",\"dash\":\"\",\"lls\":\"http://pull-lls-l3.douyincdn.com/third/stream-112894897391927775_uhd.sdp?auth_key=1682881138-0-0-e46c60b1b637060e73322453f8c0738a\",\"tsl\":\"\",\"tile\":\"\",\"sdk_params\":\"{\\\"VCodec\\\":\\\"h264\\\",\\\"vbitrate\\\":6000000,\\\"resolution\\\":\\\"1920x1080\\\",\\\"gop\\\":4,\\\"drType\\\":\\\"sdr\\\"}\"}},\"hd\":{\"main\":{\"flv\":\"http://pull-l3.douyincdn.com/third/stream-112894897391927775_hd.flv?auth_key=1682881138-0-0-e66c5df85749620fbaf3ba7aceb9055a\",\"hls\":\"http://pull-l3.douyincdn.com/third/stream-112894897391927775_hd.m3u8?auth_key=1682881138-0-0-57e26e847fe730bf18066b37a8d7e58b\",\"cmaf\":\"\",\"dash\":\"\",\"lls\":\"http://pull-lls-l3.douyincdn.com/third/stream-112894897391927775_hd.sdp?auth_key=1682881138-0-0-6e0a802e9e9a5e502bc124087cb7cd3d\",\"tsl\":\"\",\"tile\":\"\",\"sdk_params\":\"{\\\"VCodec\\\":\\\"h264\\\",\\\"vbitrate\\\":4000000,\\\"resolution\\\":\\\"1280x720\\\",\\\"gop\\\":4,\\\"drType\\\":\\\"sdr\\\"}\"}},\"sd\":{\"main\":{\"flv\":\"http://pull-l3.douyincdn.com/third/stream-112894897391927775_sd.flv?auth_key=1682881138-0-0-5e2e22e8dd75c160979481fd40163d07\",\"hls\":\"http://pull-l3.douyincdn.com/third/stream-112894897391927775_sd.m3u8?auth_key=1682881138-0-0-d18b29cd25dce106ae63275051725592\",\"cmaf\":\"\",\"dash\":\"\",\"lls\":\"http://pull-lls-l3.douyincdn.com/third/stream-112894897391927775_sd.sdp?auth_key=1682881138-0-0-57f50d0387ed6d406fbaa08638825208\",\"tsl\":\"\",\"tile\":\"\",\"sdk_params\":\"{\\\"VCodec\\\":\\\"h264\\\",\\\"vbitrate\\\":2000000,\\\"resolution\\\":\\\"1280x720\\\",\\\"gop\\\":4,\\\"drType\\\":\\\"sdr\\\"}\"}},\"ao\":{\"main\":{\"flv\":\"http://pull-l3.douyincdn.com/third/stream-112894897391927775.flv?auth_key=1682881138-0-0-e68eaa6da362b7010b9bb510f434bd39\\u0026only_audio=1\",\"hls\":\"\",\"cmaf\":\"\",\"dash\":\"\",\"lls\":\"\",\"tsl\":\"\",\"tile\":\"\",\"sdk_params\":\"{\\\"VCodec\\\":\\\"h264\\\",\\\"vbitrate\\\":0,\\\"resolution\\\":\\\"\\\",\\\"gop\\\":4,\\\"drType\\\":\\\"sdr\\\"}\"}},\"ld\":{\"main\":{\"flv\":\"http://pull-l3.douyincdn.com/third/stream-112894897391927775_ld.flv?auth_key=1682881138-0-0-3da644010272ffe02c7cf79d572a1bdc\",\"hls\":\"http://pull-l3.douyincdn.com/third/stream-112894897391927775_ld.m3u8?auth_key=1682881138-0-0-8005e4937111ef97df7bd0e2db4df8f1\",\"cmaf\":\"\",\"dash\":\"\",\"lls\":\"http://pull-lls-l3.douyincdn.com/third/stream-112894897391927775_ld.sdp?auth_key=1682881138-0-0-33f529aafa060bda9f9810e095ea20cc\",\"tsl\":\"\",\"tile\":\"\",\"sdk_params\":\"{\\\"VCodec\\\":\\\"h264\\\",\\\"vbitrate\\\":1000000,\\\"resolution\\\":\\\"960x540\\\",\\\"gop\\\":4,\\\"drType\\\":\\\"sdr\\\"}\"}},\"md\":{\"main\":{\"flv\":\"https://pull-l3-admin.douyincdn.com/third/stream-112894897391927775_md.flv?auth_key=1682881138-0-0-b362f5380fc7567e1c1846c7a9dfda8f\",\"hls\":\"http://pull-l3.douyincdn.com/third/stream-112894897391927775_md.m3u8?auth_key=1682881138-0-0-cd40b38123c664d8b011065c3a9b17e2\",\"cmaf\":\"\",\"dash\":\"\",\"lls\":\"http://pull-lls-l3.douyincdn.com/third/stream-112894897391927775_md.sdp?auth_key=1682881138-0-0-8791998d111137e959a66dee6e9d7cef\",\"tsl\":\"\",\"tile\":\"\",\"sdk_params\":\"{\\\"VCodec\\\":\\\"h264\\\",\\\"vbitrate\\\":800000,\\\"resolution\\\":\\\"640x360\\\",\\\"gop\\\":4,\\\"drType\\\":\\\"sdr\\\"}\"}},\"origin\":{\"main\":{\"flv\":\"http://pull-l3.douyincdn.com/third/stream-112894897391927775_or4.flv?auth_key=1682881138-0-0-dec203cf131be27638f3baecd1ad45a2\",\"hls\":\"http://pull-l3.douyincdn.com/third/stream-112894897391927775_or4.m3u8?auth_key=1682881138-0-0-9d8100a5c53dddceaeb20556fa5edad5\",\"cmaf\":\"\",\"dash\":\"\",\"lls\":\"http://pull-lls-l3.douyincdn.com/third/stream-112894897391927775_or4.sdp?auth_key=1682881138-0-0-1bce251e01e3507a257480694eb99e55\",\"tsl\":\"\",\"tile\":\"\",\"sdk_params\":\"{\\\"VCodec\\\":\\\"h264\\\",\\\"vbitrate\\\":6417000,\\\"resolution\\\":\\\"1920x1080\\\",\\\"gop\\\":4,\\\"drType\\\":\\\"sdr\\\"}\"}}}}"}},"pull_datas":{},"stream_orientation":2} { "title": "今天是爱谁谁猫", "nodes": [ { "format": "flv", "url": "http://pull-l3.douyincdn.com/third/stream-112894897391927775_uhd.flv?auth_key=1682881138-0-0-45f43cf02cf7d21f731d6651ba777a7e" }, { "format": "m3u", "url": "http://pull-l3.douyincdn.com/third/stream-112894897391927775_uhd.m3u8?auth_key=1682881138-0-0-aa10816dd85a5803c5809ce769c5ca57" } ] }

看起来是两个json拼接到一起了,用程序去解析会出错。

请问打开软件就闪退

小白请问,每次点开seam.exe闪出一个黑色dos视窗半秒后消失,然后什么事都没发生,软件也没启动,是不是我使用方式错误呢??

【协作】压缩弹幕的解压是否会导致弹幕顺序错位

seam/src/live/bili.rs

Lines 192 to 206 in a0f5d63

} else if ver == 2 {
dm_list_compressed.push(&data[sptr + 16..sptr + packet_len as usize]);
}
if data[sptr..].len() == packet_len as usize {
break;
} else {
sptr += packet_len as usize;
}
}
let dm_list_decompressed = dm_list_compressed
.iter()
.map(|dm| decompress_to_vec_zlib(dm).unwrap())
.collect::<Vec<_>>();

这块是翻译 real-url 而来的, 我在考虑是否会出现压缩弹幕后面再重新插入会否导致顺序错位的问题, 我上周曾尝试解决,但在解压后数据的生命周期这块栽了跟头 😭

Bili-弹幕支持-协作

@eweca-d 晚上好, 我发现 #28 合并之后无法直接编译运行, 应该有两个点卡住了, 一个是 ws 的地址可能不对, 我修改完ws地址 ( wss://dsa-cn-live-comet-01.chat.bilibili.com:2245/sub 通过下方api可获取) 之后开始不再卡住而是在下方位置报 message: Err(Protocol(ResetWithoutClosingHandshake)), 所以我认为应该是旧的地址没法返回有效数据所以卡住.

seam/src/live/bili.rs

Lines 197 to 199 in 33e5444

ws.for_each(|message| async {
let data = message.unwrap().into_data();
for m in Self::decode_msg(&data).iter() {

我找到了一个更好的 api https://api.live.bilibili.com/xlive/web-room/v1/index/getDanmuInfo?id=<RID> 可以获取 ws 地址,

对于 message: Err(Protocol(ResetWithoutClosingHandshake)) , 我目前不是很清楚, 稍微搜了一下可能与这个, 即使用了sleep有关, 还麻烦大佬再抽时间看看,

发现一个虎牙的问题

在调试的时候发现虎牙平台有重播,导致了在重播的时候会返回正在直播,但是那个直播员是不能播放的,因为是重播。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.