auqhjjqdo / LiveRecorder

基于Streamlink的全自动直播录制工具,已支持哔哩哔哩、斗鱼、虎牙、抖音、YouTube、Twitch等
MIT License
536 stars 57 forks source link

抖音 - if a streamer starts a private broadcast (for testing), then the application tries to connect without a timeout, and the IP address is banned #70

Closed AvrilL161 closed 8 months ago

AvrilL161 commented 8 months ago

运行环境

版本号:2.29 运行平台:Windows 10 运行架构:x64 Python版本:not installed

配置文件

{
  "output": "D:/Records",
  "user": [
    {
      "platform": "Douyin",
      "id": "Fengtimo1219",
      "name": "冯提莫"
    },
    {
      "platform": "Douyin",
      "id": "hanhantimo",
      "name": "冯莫提"
    },
    {
      "platform": "Douyin",
      "id": "timogame1219",
      "name": "冯莫宝"
    }
  ]
}

复现步骤(可选)

No response

错误描述

抖音 - if a streamer starts a private broadcast (for testing), then the application tries to connect without a timeout, and the IP address is banned.

is it possible to add a timeout for such scenarios?

错误日志

------
KeyError: 'data'
[2023-12-19 10:26:31][ERROR][__main__][start:58][Douyin][冯提莫]直播检测错误
KeyError('data')
Traceback (most recent call last):

  File "live_recorder.py", line 467, in <module>

  File "asyncio\runners.py", line 44, in run

  File "asyncio\base_events.py", line 636, in run_until_complete

  File "asyncio\windows_events.py", line 321, in run_forever

  File "asyncio\base_events.py", line 603, in run_forever

  File "asyncio\base_events.py", line 1909, in _run_once

  File "asyncio\events.py", line 80, in _run

> File "live_recorder.py", line 50, in start

  File "live_recorder.py", line 273, in run

KeyError: 'data'
[2023-12-19 10:26:32][ERROR][__main__][start:58][Douyin][冯提莫]直播检测错误
KeyError('data')
Traceback (most recent call last):

  File "live_recorder.py", line 467, in <module>

  File "asyncio\runners.py", line 44, in run

  File "asyncio\base_events.py", line 636, in run_until_complete

  File "asyncio\windows_events.py", line 321, in run_forever

  File "asyncio\base_events.py", line 603, in run_forever

  File "asyncio\base_events.py", line 1909, in _run_once

  File "asyncio\events.py", line 80, in _run

> File "live_recorder.py", line 50, in start

  File "live_recorder.py", line 273, in run

KeyError: 'data'
[2023-12-19 10:26:32][ERROR][__main__][start:58][Douyin][冯提莫]直播检测错误
KeyError('data')
Traceback (most recent call last):

  File "live_recorder.py", line 467, in <module>

  File "asyncio\runners.py", line 44, in run

  File "asyncio\base_events.py", line 636, in run_until_complete

  File "asyncio\windows_events.py", line 321, in run_forever

  File "asyncio\base_events.py", line 603, in run_forever

  File "asyncio\base_events.py", line 1909, in _run_once

  File "asyncio\events.py", line 80, in _run

> File "live_recorder.py", line 50, in start

  File "live_recorder.py", line 273, in run

KeyError: 'data'

etc.

[2023-12-19 14:00:48][ERROR][__main__][start:58][Douyin][冯提莫]直播检测错误
KeyError('FULL_HD1')
Traceback (most recent call last):

  File "live_recorder.py", line 467, in <module>

  File "asyncio\runners.py", line 44, in run

  File "asyncio\base_events.py", line 636, in run_until_complete

  File "asyncio\windows_events.py", line 321, in run_forever

  File "asyncio\base_events.py", line 603, in run_forever

  File "asyncio\base_events.py", line 1909, in _run_once

  File "asyncio\events.py", line 80, in _run

> File "live_recorder.py", line 50, in start

  File "live_recorder.py", line 279, in run

KeyError: 'FULL_HD1'
[2023-12-19 14:00:48][ERROR][__main__][start:58][Douyin][冯提莫]直播检测错误
KeyError('FULL_HD1')
Traceback (most recent call last):

  File "live_recorder.py", line 467, in <module>

  File "asyncio\runners.py", line 44, in run

  File "asyncio\base_events.py", line 636, in run_until_complete

  File "asyncio\windows_events.py", line 321, in run_forever

  File "asyncio\base_events.py", line 603, in run_forever

  File "asyncio\base_events.py", line 1909, in _run_once

  File "asyncio\events.py", line 80, in _run

> File "live_recorder.py", line 50, in start

  File "live_recorder.py", line 279, in run

KeyError: 'FULL_HD1'
[2023-12-19 14:00:49][ERROR][__main__][start:58][Douyin][冯提莫]直播检测错误
KeyError('FULL_HD1')
Traceback (most recent call last):

  File "live_recorder.py", line 467, in <module>

  File "asyncio\runners.py", line 44, in run

  File "asyncio\base_events.py", line 636, in run_until_complete

  File "asyncio\windows_events.py", line 321, in run_forever

  File "asyncio\base_events.py", line 603, in run_forever

  File "asyncio\base_events.py", line 1909, in _run_once

  File "asyncio\events.py", line 80, in _run

> File "live_recorder.py", line 50, in start

  File "live_recorder.py", line 279, in run

KeyError: 'FULL_HD1'

错误截图(可选)

No response

auqhjjqdo commented 8 months ago

连接超时是有的,interval字段就是检测是否开播的时间间隔同时是连接超时的时长,IP被ban通常是请求次数过多被判定为爬虫导致触发了服务器风控,针对部分风控机制较为严格的直播平台建议将interval字段设置到30秒或更长时间