我想使用 Python 录制 apart.com 流,我正在使用 Python 中的直播流媒体包。 但直播流媒体不适用于 aparat.com 等未列出的网站。 这是我的简单代码:
def recordByLivestream ():
session = Livestreamer()
streams = session.streams("hlsvariant://https://b-hls- 11.doppiocdn.com/hls/96147065/96147065.m3u8")
stream = streams["best"]
fd = stream.open()
data = fd.read(1024)
fd.close()
我的错误显示预制插件无法正常工作。 apart 在 livestream 模块中没有插件。 如果 Livestream 不支持这个网站,哪个 Python 模块适合这项工作?
我无法发布堆栈溢出垃圾邮件检测器的所有插件错误(我想这就是 StackOverflow 中垃圾邮件错误的原因)
我的错误:
>
ImportError: cannot import name 'getargspec' from 'inspect' (C:\Users\WiTTg3n\AppData\Local\Programs\Python\Python311\Lib\inspect.py)
Failed to load plugin zdf_mediathek:
File "C:\Users\WiTTg3n\AppData\Local\Programs\Python\Python311\Lib\imp.py", line 235, in load_module
return load_source(name, filename, file)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\WiTTg3n\AppData\Local\Programs\Python\Python311\Lib\imp.py", line 172, in load_source
module = _load(spec)
^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 721, in _load
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "C:\Users\WiTTg3n\AppData\Local\Programs\Python\Python311\Lib\site-packages\livestreamer\plugins\zdf_mediathek.py", line 5, in <module>
from livestreamer.stream import HDSStream, HLSStream, RTMPStream
File "C:\Users\WiTTg3n\AppData\Local\Programs\Python\Python311\Lib\site-packages\livestreamer\stream\__init__.py", line 4, in <module>
from .akamaihd import AkamaiHDStream
File "C:\Users\WiTTg3n\AppData\Local\Programs\Python\Python311\Lib\site-packages\livestreamer\stream\akamaihd.py", line 15, in <module>
from ..packages.flashmedia import FLV, FLVError
File "C:\Users\WiTTg3n\AppData\Local\Programs\Python\Python311\Lib\site-packages\livestreamer\packages\flashmedia\__init__.py", line 4, in <module>
from .amf import *
File "C:\Users\WiTTg3n\AppData\Local\Programs\Python\Python311\Lib\site-packages\livestreamer\packages\flashmedia\amf.py", line 3, in <module>
from .types import AMF0String, AMF0Value, U8, U16BE, U32BE
File "C:\Users\WiTTg3n\AppData\Local\Programs\Python\Python311\Lib\site-packages\livestreamer\packages\flashmedia\types.py", line 6, in <module>
from inspect import getargspec
ImportError: cannot import name 'getargspec' from 'inspect' (C:\Users\WiTTg3n\AppData\Local\Programs\Python\Python311\Lib\inspect.py)
Traceback (most recent call last):
File "c:\Users\WiTTg3n\OneDrive\Desktop\New folder\test-aparat.py", line 56, in <module>
recordByLivestream()
File "c:\Users\WiTTg3n\OneDrive\Desktop\New folder\test-aparat.py", line 48, in recordByLivestream
streams = session.streams("hlsvariant://https://b-hls-11.doppiocdn.com/hls/96147065/96147065.m3u8")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\WiTTg3n\AppData\Local\Programs\Python\Python311\Lib\site-packages\livestreamer\session.py", line 354, in streams
plugin = self.resolve_url(url)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\WiTTg3n\AppData\Local\Programs\Python\Python311\Lib\site-packages\livestreamer\session.py", line 344, in resolve_url
raise NoPluginError
livestreamer.exceptions.NoPluginError
>