Skip to content
2 changes: 1 addition & 1 deletion ykdl/extractors/douyin/live.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Douyin(Extractor):
}

def prepare(self):
info = MediaInfo(self.name)
info = MediaInfo(self.name,True)

if 'amemv.com' in self.url:
data = get_response('https://webcast.amemv.com/webcast/room/reflow/info/',
Expand Down
4 changes: 4 additions & 0 deletions ykdl/extractors/douyu/live.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ def prepare(self):

add_header('Referer', 'https://www.douyu.com')
html = get_content(self.url)

videoloop_label = match1(
html, '\$ROOM\.room_biz_all\s*=\s*\{\"videoLoop\":(\d+)')
assert not (videoloop_label == '1') , 'Douyu重播'
Copy link
Copy Markdown
Collaborator

@SeaHOH SeaHOH Jun 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不应退出,我认为可以选择以下两个方案之一:

  • 如果可以,则重定向到 douyu/video (不确定是否有对应的视频)。

  • 修改 info = MediaInfo('斗鱼重播 (DouyuTV)'),后面的 title 也作相应修改。

Copy link
Copy Markdown
Contributor Author

@a67878813 a67878813 Jul 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.即使重定向到douyu/video,估计不会暴露视频地址。
2.info补全后,返回的MediaInfo结构需添加额外flag,需要增加命令行参数才能做出“给定直播地址,存在回放标识,停止录制”功能。这样可接受吗?
7x24全开时,开回放的直播间很麻烦。(回放-直播)的ts流结构不正常。

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ykdl 自带的 cykdl 事实上只是一个范例,ykdl 本身定位是作为库来调用的,需要保持功能完整没有无故缺失。如果有更复杂的要求,可以另行编写脚本调用 ykdl 并处理返回数据,这里的数据原则上尽可能遵循 AS-IS,如何处理则在于用户。你面临的使用场景即是后者,而不是去更改 ykdl 本身。


title = match1(html, 'Title-head\w*">([^<]+)<')
artist = match1(html, 'Title-anchorName\w*" title="([^"]+)"')
Expand Down