Giter Club home page Giter Club logo

xstreamdl-cli's Introduction

下载最新版本请查看Actions


ENGLISH README

XstreamDL-CLI

基于python 3.7.4的,命令行版本的,HLS/DASH流下载器,仅支持HLS标准AES-128-CBC解密

使用

首先将ffmpegmp4decrypt的可执行文件放置在binaries文件夹中

可执行文件下载链接点此

安装必要的库

pip install -r requirements.txt

使用样式示例

python -m XstreamDL_CLI.cli [OPTION]... URL/FILE/FOLDER...

简单示例

python -m XstreamDL_CLI.cli --b64key oKi/hwKVuLveo/hISX1PQw== --hexiv b3d5ca56926d49d8e96b70aa5c7b358e --name 第一节总论 https://hls.videocc.net/d06ae002cb/2/d06ae002cb4a0bed78fb912c874fdbb2_2.m3u8

一些概念

README中存在一些对于新人不友好的术语或者我使用的名词,这里写一点说明,希望有帮助

元数据

通常情况下,直接访问m3u8/mpd链接可以看到含有完整或部分分段链接的文本内容,这些内容被称为元数据

通过元数据和m3u8/mpd链接,软件可以转换出全部分段链接,最终用于下载

也就是说软件所需要的链接是存放元数据的链接

分段链接

怎么会有人不知道什么是分段链接?根据我收到的反馈,真的有...

所谓分段链接就是媒体文件的链接,如果你下载某个链接,然后使用文本编辑器打开,例如记事本

发现显示在你眼前的是一些看不懂的乱码,恭喜你,你下载的是分段链接

初始分段链接/init分段

怎么知道一个分段链接是不是初始分段链接?

通常情况下,在加载元数据链接之后紧接着加载的分段链接,就是初始分段链接

当然上面的说法不是百分百正确,另一个判断方法是检查链接中?之前(如果有?的话)的末尾部分,是不是诸如map.xxx以及init.xxx的字符

如果是,那么这就是一个初始分段链接

更加准确的判断方法?

当然有,你下载这个分段链接后,使用mediainfo这一类工具查看其属性,如果有时间码率等信息,并且这个文件只有几KB大小

那么这就是一个初始分段链接

如何反馈

首先,请在使用软件前仔细阅读此README的详细说明,本软件在使用上存在一定门槛

当你确实遭遇到无法下载的链接,请先检查下面的问题

  • 输入链接是不是不被软件支持?
    • 案例一,有用户想下载dash流中的字幕,但传入的链接是init分段的链接。软件需要的是mpd链接而不是分段链接
    • 案例二,用户希望下载m3u8直播流,但下载失败。阅读下面的详细说明的直播录制后你就会知道目前还没有实现m3u8直播下载
  • 是不是和浏览器/抓包结果中链接不一样?
    • 链接一样,请阅读访问受限
    • raw.json中的链接是正确链接的一部分,请阅读链接鉴权
    • raw.json中的链接后半部分是正确链接的一部分,请阅读未成功下载任何文件
    • raw.json中的链接前半部分是正确链接的一部分,但后半部分和正确链接八竿子打不着,请提issue
  • 是不是没有使用代理?
    • 案例一,用户开启了全局代理,但无法下载视频。注意软件目前仅支持http代理,并且默认不走系统代理

为了方便理解彼此的意图,反馈时请尽可能提供下面的信息

  • 目标链接
  • 你所使用的完整命令
  • 正确的初始分段链接,除初始分段外的任意一个分段链接
  • 是否存在ip访问限制,如果存在这种可能性,请务必说明可以访问该链接的的地区
  • 是否存在时效性限制,特别是直播流
  • 对于存在鉴权、时效性较短的链接,请提供m3u8/mpd(元数据)文件
    • 你可以通过抓包/浏览器F12查看响应得到内容,然后复制保存到本地
  • 目标链接对应的在线网页地址

如果不想暴露目标链接/网站,请发送信息到我的邮箱

详细说明

下载默认/指定流

当前软件提供了--select选项用于辅助用户选择需要下载的流

但更多的用户希望可以通过指定分辨率、最佳质量一类选项进行下载

如果希望指定下载最佳质量/特定类型/特定分辨率流,请使用下面的选项

--resolution
--best-quality
--video-only
--audio-only
--all-videos
--all-audios
--all-subtitles

未成功下载任何文件

对于这种情况,请检查浏览器中的分段链接是否与raw.json文件中的一致

不一致,请上报详细信息给我

下载加速

如果要下载的目标文件所在的服务器与下载器直接的连接性较差,比如在你使用代理的时候,你可以选择

  • 增大--limit-per-host数值,以提升下载速度
  • 开启--disable-force-close选项,提升下载速度

如果连接性较好,则保持默认就好,当然--disable-force-close也是推荐开启的

Q: 为什么--disable-force-close选项不是默认开启

A: 之前在编写软件过程中,出现过bug,某个循环异常,开启该选项后导致在极短时间内网络连接数耗尽,然后网络瘫痪,所以默认强制关闭链接,以确保不会发生这种情况

直播录制

目前仅支持dash流的录制,可以通过--live选项指明这是直播流

通过--live-duration指明要录制的时长,该选项不是特别准确,最终文件时长通常大于期望的时长

如果是回放类型的dash流,可以尝试普通模式下载

代理

目前--proxy选项支持设定socks5http代理,示例

  • socks5://127.0.0.1:10808
  • http://127.0.0.1:10809

m3u8解密

下载器会自动尝试下载key,但目前绝大部分网站是不提供可直接用于解密的key的

所以需要手动指定解密所使用的keyiv

  • --b64key base64编码的解密key字符串
  • --hexiv 16进制形式的解密iv字符串,如果不设置则默认是二进制0

dash流解密

下载器调用mp4decrypt解密,请通过--key设置解密key,不设置则会强制二进制合并

访问受限

某些网站需要携带cookies、referer或者特定的请求头才能访问分段文件,这种情况可以通过设置--headers实现正常下载

链接鉴权

某些网站会在常规的链接后面增加一系列参数,用于检查用户是否有权限访问,通常情况下和流本身无关,往往是相同的内容,常见于dash类型流

遇到这种情况,可以使用--url-patch设置这部分内容,例如mpd域名是nammaflix-streams.streamready.in

仅解析

--parse-only表明仅仅解析流,而不会进行任何下载,使用该选项,只会产生raw.json文件

重复流

如果经常使用本下载器下载dash流,可能会发现有的网站两条流名字完全一样,实际上查看mpd内容,确实如此

--index-to-name正是为了处理这一问题而设置的

此外可以与--show-init搭配使用,将会显示对应的初始分段链接,辅助选择需要下载的流

日志

目前下载器添加了详细的日志记录,用于辅助程序异常定位,输出日志在logs文件夹中

--log-level选项用于指定要显示输出的日志级别,无论如何设置,完整的日志总是会记录到logs文件夹

GUI支持

已有基于PySide6的GUI计划

C#版写起来非常不顺手,搁置了

混流支持

已在计划中,将使用mp4box进行混流

下载重试

下载器重试次数为5

如果遇到图中这样的情况,即进度没有达到100%,说明下载并没有完成,请按之前的步骤重复操作,下载器会自动下载未完成的分段

最终成功的进度示意

HELP INFO

version 1.4.3, A downloader that download the HLS/DASH stream.
usage: XstreamDL-CLI [OPTION]... URL/FILE/FOLDER...

A downloader that download the HLS/DASH stream

positional arguments:
  URI                   URL/FILE/FOLDER string

optional arguments:
  -v, --version         print version and exit
  -h, --help            print help message and exit
  --speed-up            speed up at end
  --speed-up-left SPEED_UP_LEFT
                        speed up when left count less than this value
  --live                live mode
  --compare-with-url    use full url to compare with last segments to get new
                        segments
  --dont-split-discontinuity
                        dont take #EXT-X-DISCONTINUITY tag as a new stream
  --name-from-url       get name from segment url
  --live-duration LIVE_DURATION
                        live record time, format HH:MM:SS, example 00:00:30
                        will record about 30s
  --live-utc-offset LIVE_UTC_OFFSET
                        the value is used to correct utc time
  --live-refresh-interval LIVE_REFRESH_INTERVAL
                        live refresh interval
  --name NAME           specific stream base name
  --base-url BASE_URL   set base url for Stream
  --ad-keyword AD_KEYWORD
                        skip #EXT-X-DISCONTINUITY which segment url has this
                        keyword
  --resolution {,270,360,480,540,576,720,1080,2160}
                        auto choose target quality
  --best-quality        auto choose best quality for dash streams
  --video-only          only choose video stream when use --best-quality
  --audio-only          only choose audio stream when use --best-quality
  --all-videos          choose all video stream to download
  --all-audios          choose all audio stream to download
  --all-subtitles       choose all subtitle stream to download
  --service SERVICE     set serviceLocation for BaseURL choose
  --save-dir SAVE_DIR   set save dir for Stream
  --select              show stream to select and download, default is to
                        download all
  --multi-s             use this option when S tag number > 0
  --disable-force-close
                        default make all connections closed securely, but it
                        will make DL speed slower
  --limit-per-host LIMIT_PER_HOST
                        increase the value if your connection to the stream
                        host is poor, suggest >100 for DASH stream
  --headers HEADERS     read headers from headers.json, you can also use
                        custom config
  --url-patch URL_PATCH
                        add some custom strings for all segments link
  --overwrite           overwrite output files
  --raw-concat          concat content as raw
  --disable-auto-concat
                        disable auto-concat
  --enable-auto-delete  enable auto-delete files after concat success
  --disable-auto-decrypt
                        disable auto-decrypt segments before dump to disk
  --key KEY             <id>:<k>, <id> is either a track ID in decimal or a
                        128-bit KID in hex, <k> is a 128-bit key in hex
  --b64key B64KEY       base64 format aes key, only for HLS standard
                        AES-128-CBC encryption
  --hexiv HEXIV         hex format aes iv
  --proxy PROXY         use socks/http proxy, e.g. socks5://127.0.0.1:10808 or
                        http://127.0.0.1:10809
  --disable-auto-exit   disable auto exit after download end, GUI will use
                        this option
  --parse-only          parse only, not to download
  --show-init           show initialization to help you identify same name
                        stream
  --index-to-name       some dash live have the same name for different
                        stream, use this option to avoid
  --log-level {DEBUG,INFO,WARNING,ERROR}
                        set log level, default is INFO
  --redl-code REDL_CODE
                        re-download set of response status codes , e.g.
                        408,500,502,503,504
  --hide-load-metadata  hide `Load #EXT-X-MEDIA metadata` balabala

pyinstaller打包

pyinstaller -i logo.ico -n XstreamDL-CLI_v1.4.3 -F XstreamDL_CLI\__main__.py

已添加自动构建,可前往Actions页面下载最新dev版本程序

特性

  • 基于aiohttp

其他

  • 逐步完善中

反馈 & FeedBack

Pay For Feature

...

xstreamdl-cli's People

Contributors

gyozaaaa avatar xhlove 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

xstreamdl-cli's Issues

--live-duration has been set but still getting no attribute 'timestamp'

您好,不好意思打扰了
想请问 Key & Key ID 都放了
--live-duration 也放了可是还是提示 AttributeError: 'str' object has no attribute 'timestamp' [2588] Failed to execute script '__main__' due to unhandled exception!
具体如下:

2022-02-14 18:08:25,626 XstreamDL log.py 41 : INFO  log file -> C:/Users/Sam Sam/Desktop/Widevine Livestream Test/logs/XstreamDL-2022-02-14_180825.log
2022-02-14 18:08:25,628 XstreamDL default.py 19 : WARNING  headers is not exists, put your config file to C:/Users/Sam Sam/Desktop
2022-02-14 18:08:25,629 XstreamDL cli.py 158 : INFO  use 1.4.0, set URI to ['https://rest-as.ott.kaltura.com/api_v3/service/assetFile/action/playManifest/partnerId/147/assetId/340313/assetType/media/assetFileId/11460225/contextType/PLAYBACK/isAltUrl/False/a.mpd']
Traceback (most recent call last):
  File "XstreamDL_CLI\__main__.py", line 4, in <module>
  File "XstreamDL_CLI\cli.py", line 161, in main
  File "XstreamDL_CLI\daemon.py", line 30, in daemon
  File "XstreamDL_CLI\extractor.py", line 48, in fetch_metadata
  File "XstreamDL_CLI\extractor.py", line 95, in raw2streams
  File "XstreamDL_CLI\extractor.py", line 127, in parse_as_dash
  File "XstreamDL_CLI\extractors\dash\parser.py", line 133, in parse
  File "XstreamDL_CLI\extractors\dash\parser.py", line 150, in walk_period
  File "XstreamDL_CLI\extractors\dash\parser.py", line 178, in walk_adaptationset
  File "XstreamDL_CLI\extractors\dash\parser.py", line 242, in walk_representation
  File "XstreamDL_CLI\extractors\dash\parser.py", line 318, in walk_segmenttemplate
  File "XstreamDL_CLI\extractors\dash\parser.py", line 328, in walk_segmenttimeline
  File "XstreamDL_CLI\extractors\dash\parser.py", line 358, in walk_s
AttributeError: 'str' object has no attribute 'timestamp'
[2588] Failed to execute script '__main__' due to unhandled exception! ```

是我的指令有问题吗?版本为 v1.4.0
感谢

Can't download dynamic mpd live

Hi, I can't download this mpd., its a live stream
Its a dynamic mpd, if I don't put the --live option, it download only a few seconds.
I tried to put a headers.json file with headers from the mpd url but it doesnt work too

with headers :
with_headers

without headers :
without_headers

webm mpd format support

https://ok6-13.vkuser.net/?expires=1635476421867&srcIp=154.17.6.60&srcAg=CHROME&ms=95.142.206.140&type=4&sig=KLaiZvOWr6E&ct=6&urls=185.226.52.24%3B45.136.21.33&clientType=0&zs=43&id=1041551264421

`_video_VP9_1920x1080_2078.60kbps 下载开始.
_video_VP9_1920x1080_2078.60kbps 0.00/0_video_VP9_1920x1080_2078.60kbps ████████████████████████████████████████████████████████████████████████████████ 0.00/0.00MB • 0.00MB/s • 1/1 • 100.00%

ffmpeg version 4.3.2-2021-02-27-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000016c7e70cf80] Format mov,mp4,m4a,3gp,3g2,mj2 detected only with low score of 1, misdetection possible!
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000016c7e70cf80] moov atom not found
concat:0000.mp4: Invalid data found when processing input
_audio_OPUS_194.19kbps 下载开始.
audio_OPUS_194.19kbps 0.00/0.00MB • 0.00MB/s • 0/1 • 0.00% Traceback (most recent call last):
File "XstreamDL_CLI_main
.py", line 4, in
File "XstreamDL_CLI\cli.py", line 148, in main
File "XstreamDL_CLI\daemon.py", line 33, in daemon
File "XstreamDL_CLI\downloader.py", line 204, in download_streams
File "asyncio\base_events.py", line 579, in run_until_complete
File "XstreamDL_CLI\downloader.py", line 314, in do_with_progress
File "XstreamDL_CLI\downloader.py", line 140, in to_stop
File "XstreamDL_CLI\downloader.py", line 122, in update_progress
File "XstreamDL_CLI\downloader.py", line 100, in calc_speed
ZeroDivisionError: float division by zero
[14688] Failed to execute script main`

Hi! I have the binary in place but the script can't find it

Hi! When I use Linux, Debian to be exact, The script fail to call the mp4decrypt binary. The binary for Linux is in there. This did not happen in Windows

08:04:47.172 XstreamDL_CLI/cli.py:162 INFO: use 1.4.1, set URI to ['https://tglmp02.akamaized.net/out/v1/9fd968b813e5405194a4fc3db1baae0e/manifest.mpd'] 08:04:47.228 XstreamDL_CLI/daemon.py:78 INFO: refresh link https://tglmp02.akamaized.net/out/v1/9fd968b813e5405194a4fc3db1baae0e/manifest.mpd 0 total 10 segments 36.00s mlpang2_video_H264_960x540_1800.00kbps 1 total 10 segments 36.00s mlpang2_video_H264_1280x720_2800.00kbps 2 total 10 segments 36.00s mlpang2_video_H264_1920x1080_4499.97kbps 3 total 10 segments 36.01s mlpang2_audio_AAC_und_95.25kbps 08:04:50.255 XstreamDL_CLI/downloader.py:309 INFO: mlpang2_video_H264_1920x1080_4499.97kbps download start. 08:04:50.256 XstreamDL_CLI/downloader.py:453 INFO: 12 tasks start mlpang2_video_H264_1920x1080_4499.97kbps ██████████████████████████████ 23.76/23.76MB • 69.99MB/s • 12/12 • 100.00% 08:04:50.636 XstreamDL_CLI/downloader.py:459 INFO: tasks end, time used 0.38s 08:04:50.638 XstreamDL_CLI/downloader.py:309 INFO: mlpang2_audio_AAC_und_95.25kbps download start. 08:04:50.640 XstreamDL_CLI/downloader.py:453 INFO: 12 tasks start mlpang2_audio_AAC_und_95.25kbps ██████████████████████████████ 0.54/0.54MB • 3.43MB/s • 12/12 • 100.00% 08:04:50.798 XstreamDL_CLI/downloader.py:459 INFO: tasks end, time used 0.16s 08:04:53.335 XstreamDL_CLI/downloader.py:309 INFO: mlpang2_video_H264_1920x1080_4499.97kbps download start. 08:04:53.337 XstreamDL_CLI/downloader.py:453 INFO: 1 tasks start mlpang2_video_H264_1920x1080_4499.97kbps ██████████████████████████████ 25.81/25.81MB • 39.63MB/s • 13/13 • 100.00% 08:04:53.388 XstreamDL_CLI/downloader.py:459 INFO: tasks end, time used 0.05s 08:04:53.390 XstreamDL_CLI/downloader.py:309 INFO: mlpang2_audio_AAC_und_95.25kbps download start. 08:04:53.391 XstreamDL_CLI/downloader.py:453 INFO: 1 tasks start mlpang2_audio_AAC_und_95.25kbps ██████████████████████████████ 0.59/0.59MB • 2.92MB/s • 13/13 • 100.00% 08:04:53.408 XstreamDL_CLI/downloader.py:459 INFO: tasks end, time used 0.02s ^C08:04:56.474 XstreamDL_CLI/models/stream.py:233 INFO: /root/XstreamDL-CLI/Downloads/mlpang2_video_H264_1920x1080_4499.97kbps.mp4 was merged successfully start decrypt sh: 1: /root/XstreamDL-CLI/binaries/mp4decrypt --show-progress --key [redacted] /root/XstreamDL-CLI/Downloads/mlpang2_video_H264_1920x1080_4499.97kbps.mp4 /root/XstreamDL-CLI/Downloads/mlpang2_video_H264_1920x1080_4499.97kbps_decrypted.mp4: not found 08:04:56.480 XstreamDL_CLI/models/stream.py:233 INFO: /root/XstreamDL-CLI/Downloads/mlpang2_audio_AAC_und_95.25kbps.m4a was merged successfully start decrypt sh: 1: /root/XstreamDL-CLI/binaries/mp4decrypt --show-progress --key [redacted] /root/XstreamDL-CLI/Downloads/mlpang2_audio_AAC_und_95.25kbps.m4a /root/XstreamDL-CLI/Downloads/mlpang2_audio_AAC_und_95.25kbps_decrypted.m4a: not found

Is there anything that I need to do? thank you!

我發現直播有兩種下載模式,而其中一種會錄製失敗。

我發現使用同一條命令進行直播錄製,但會有兩種不同的下載模式,使用版本是目前最新的1.4.3:

第一種模式是「即使沒有新的直播片段,程式也會下載之前已下載過的直播片段,最終導致錄製失敗」。
從下圖可見,第1-4次下載都是「3/3」,第4-8次下載都是「4/4」,最終到「5/5」時發生錯誤。
螢幕擷取畫面 2022-09-05 133652
螢幕擷取畫面 2022-09-05 133701

第二種模式是「如果沒有新的直播片段,程式就會略過下載,直到遇到新的直播片段,最後成功錄製並合併」。
從下圖可見,當沒有新的直播片段時,程式只會顯示「download start」,但並沒有顯示下載數量,所以所有直播片段都是只下載了一遍,而最後沒有發生任何錯誤。
螢幕擷取畫面 2022-09-05 133719
螢幕擷取畫面 2022-09-05 133820

can't download mpd

Hello.
Xstream can't download such mpd

https://ads-cdn-dash-1.blim.com/v1/dash/942b5dcb4f33f2d7bcfe75473f6d9bed3d3d2ff0/avod_prod_ts/201712054084/dash/671210_46e6ebdf0aabd6dcfcaf6bcf7dc4fa14/mpds/671210.mpd

No track ID - problem

Hi.
I have a question.

I downloaded the same manifest file using yt-dlp and XstreamDL.
XstreamDL is much faster and I like this app more.
However, the output files are different.

yt-dlp gives video.ismv and XstreamDL video.mp4

mediainfo

The problem is that both videos cannot be decrypted because they don't have init files.
I can get init files but to mux them I need to know video track ID.
In this case it is 9. But video downloaded by XstreamDL doesn't show any information.

Can you explain it, please?

解密下载失败

aiohttp request meet 403 response

在下载某厂商的m3u8时,返回403:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head><title>403 Forbidden</title></head>
<body>
<h1>403 Forbidden</h1>
<p>You don't have permission to access the URL on this server.<hr/>Powered by Tengine</body>
</html>

改用urllib或curl后都可以正常下载,推测是aiohttp的问题。

我看代码中均未用到aiohttp的异步特性,是否考虑替换为同步的HTTP请求库,或者直接调用curl(这样其实更方便调试)?

Concat

2022-03-18 16:09:56,427 XstreamDL stream.py 198 : INFO try to concat new_video_H264_699x360_1200.00kbps but file already exists

How to manually concat now ??? please help

please help

Hello,
every time i tried to download the video i keep getting this error
Screenshot_2
could please tell me where did i go wrong? i follow ever step but still this

WINDOWS BINARIES?

Hello, 'xhlove'!

Would you mind, creating Windows binaries, occasionally (and also working, on Windows XP, 64 bit, system/PC, if possible)?

Thus I can actively test your programme, because I often play different live streams (like "AES-128" encrypted, and "SAMPLE-AES" encrypted, too)!?

Good luck!!!!!

Peter

1.3.3

XstreamDL-CLI_v1.3.3.exe --select --overwrite --enable-auto-delete --limit-per-host 16 "https://vd274.mycdn.me/?expires=1636023294517&srcIp=52.79.177.110&srcAg=CHROME&ms=185.226.52.24&type=4&sig=JCrWhG1bmBo&ct=6&urls=45.136.21.33&clientType=0&zs=43&id=1041551264421"
2021-11-03 19:11:50,893 XstreamDL log.py 41 : INFO log file -> D:/App/Widevine/XstreamDL/logs/XstreamDL-2021-11-03_191150.log
2021-11-03 19:11:50,894 XstreamDL cli.py 63 : WARNING binaries folder is not exist > D:\App\Widevine\XstreamDL\binaries
2021-11-03 19:11:50,894 XstreamDL cli.py 140 : INFO set URI to ['https://vd274.mycdn.me/?expires=1636023294517&srcIp=52.79.177.110&srcAg=CHROME&ms=185.226.52.24&type=4&sig=JCrWhG1bmBo&ct=6&urls=45.136.21.33&clientType=0&zs=43&id=1041551264421']
0 共计 1 个分段 0.00s _video_VP9_426x240_238.72kbps
1 共计 1 个分段 0.00s _video_VP9_256x144_319.18kbps
2 共计 1 个分段 0.00s _video_VP9_640x360_427.55kbps
3 共计 1 个分段 0.00s _video_VP9_852x480_693.08kbps
4 共计 1 个分段 0.00s _video_VP9_1280x720_1245.54kbps
5 共计 1 个分段 0.00s _video_VP9_1920x1080_2078.60kbps
6 共计 1 个分段 0.00s _audio_OPUS_34.66kbps
7 共计 1 个分段 0.00s _audio_OPUS_130.71kbps
8 共计 1 个分段 0.00s _audio_OPUS_194.19kbps
请输入要下载流的序号:
0
only one segment, please download it manually =>
https://vd274.mycdn.me/?expires=1636023294517&srcIp=52.79.177.110&srcAg=CHROME&ms=185.226.52.24&type=0&sig=0VhQSZhEQrM&ct=21&urls=45.136.21.33&clientType=0&zs=43&id=1041551264421/?expires=1636023294517&srcIp=52.79.177.110&srcAg=CHROME&ms=185.226.52.24&type=0&sig=0VhQSZhEQrM&ct=21&urls=45.136.21.33&clientType=0&zs=43&id=1041551264421`

when use --overwrite --enable-auto-delete --limit-per-host 16 "https://vd274.mycdn.me/?expires=1636023294517&srcIp=52.79.177.110&srcAg=CHROME&ms=185.226.52.24&type=4&sig=JCrWhG1bmBo&ct=6&urls=45.136.21.33&clientType=0&zs=43&id=1041551264421"

XstreamDL-CLI_v1.3.3.exe "https://vd274.mycdn.me/?expires=1636023294517&srcIp=52.79.177.110&srcAg=CHROME&ms=185.226.52.24&type=0&sig=0VhQSZhEQrM&ct=21&urls=45.136.21.33&clientType=0&zs=43&id=1041551264421/?expires=1636023294517&srcIp=52.79.177.110&srcAg=CHROME&ms=185.226.52.24&type=0&sig=0VhQSZhEQrM&ct=21&urls=45.136.21.33&clientType=0&zs=43&id=1041551264421"
2021-11-03 19:12:37,035 XstreamDL log.py 41 : INFO log file -> D:/App/Widevine/XstreamDL/logs/XstreamDL-2021-11-03_191237.log
2021-11-03 19:12:37,036 XstreamDL cli.py 63 : WARNING binaries folder is not exist > D:\App\Widevine\XstreamDL\binaries
2021-11-03 19:12:37,036 XstreamDL cli.py 140 : INFO set URI to ['https://vd274.mycdn.me/?expires=1636023294517&srcIp=52.79.177.110&srcAg=CHROME&ms=185.226.52.24&type=0&sig=0VhQSZhEQrM&ct=21&urls=45.136.21.33&clientType=0&zs=43&id=1041551264421/?expires=1636023294517&srcIp=52.79.177.110&srcAg=CHROME&ms=185.226.52.24&type=0&sig=0VhQSZhEQrM&ct=21&urls=45.136.21.33&clientType=0&zs=43&id=1041551264421']
2021-11-03 19:12:38,367 XstreamDL extractor.py 95 : WARNING 无法获取视频流信息

请问下载的临时文件在哪

我下载的是直播dash流,看这个工具的命令反馈是一边下载直播一边合并dash片段,请问在不暂停直播下载的情况下怎么把合并的临时文件(视频流和音频流)找出来

直播无法下载

已解决

我用了你的软件解析出来了视频和音频 然后我用MP4decrypt解密没成功 我解析出来的视频和音频对吗 应该怎么解密啊 求大佬帮助

Plis help :)

Hi

I used download and decrypt example:
python -m XstreamDL_CLI.cli --select --disable-force-close --limit-per-host 100 --key f31203576a323d09d0c305d236a0c793:00fa546ee19f98fc0044237d2ceb820b "https://akamaicdn.hbogo.eu/a9626f47-b065-2a26-43f9-a3094fb7c4d3_hbo/COMP/29223422_hun_comp_d35eda69-a367-4b47-aa0c-a51032d94be2_3400000_v2.ism/manifest"
And i have a bug, sorry i'm a beginner:

image

Thank you for your answer

Live doesn't work

Hi, when I try to record live MPD stream, I've been told to report it because it seems to not work

D:\XstreamDL-CLI-master>python -m XstreamDL_CLI.cli --live --name "test2" "https://tglmp02.akamaized.net/out/v1/9fd968b813e5405194a4fc3db1baae0e/manifest.mpd"
2021-11-28 17:57:38,199 XstreamDL log.py 41 : INFO  log file -> D:/XstreamDL-CLI-master/logs/XstreamDL-2021-11-28_175738.log
2021-11-28 17:57:38,215 XstreamDL cli.py 152 : INFO  set URI to ['https://tglmp02.akamaized.net/out/v1/9fd968b813e5405194a4fc3db1baae0e/manifest.mpd']
Traceback (most recent call last):
  File "C:\Users\ryank\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\ryank\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "D:\XstreamDL-CLI-master\XstreamDL_CLI\cli.py", line 160, in <module>
    main()
  File "D:\XstreamDL-CLI-master\XstreamDL_CLI\cli.py", line 154, in main
    daemon.daemon()
  File "D:\XstreamDL-CLI-master\XstreamDL_CLI\daemon.py", line 30, in daemon
    streams = extractor.fetch_metadata(self.args.URI[0])
  File "D:\XstreamDL-CLI-master\XstreamDL_CLI\extractor.py", line 48, in fetch_metadata
    return self.raw2streams('url', *loop.run_until_complete(self.fetch(uri)), parent_stream)
  File "D:\XstreamDL-CLI-master\XstreamDL_CLI\extractor.py", line 95, in raw2streams
    return self.parse_as_dash(uri_type, uri, content, parent_stream)
  File "D:\XstreamDL-CLI-master\XstreamDL_CLI\extractor.py", line 127, in parse_as_dash
    streams = self.parser.parse(uri, content)
  File "D:\XstreamDL-CLI-master\XstreamDL_CLI\extractors\dash\parser.py", line 132, in parse
    return self.walk_period(mpd, uri_item.new_base_url(base_url))
  File "D:\XstreamDL-CLI-master\XstreamDL_CLI\extractors\dash\parser.py", line 149, in walk_period
    _streams = self.walk_adaptationset(period, len(streams), uri_item.new_base_url(base_url))
  File "D:\XstreamDL-CLI-master\XstreamDL_CLI\extractors\dash\parser.py", line 177, in walk_adaptationset
    _streams = self.walk_representation(adaptationset, period, sindex + len(streams), current_uri_item)
  File "D:\XstreamDL-CLI-master\XstreamDL_CLI\extractors\dash\parser.py", line 236, in walk_representation
    self.walk_segmenttemplate(representation, period, stream)
  File "D:\XstreamDL-CLI-master\XstreamDL_CLI\extractors\dash\parser.py", line 296, in walk_segmenttemplate
    self.walk_segmenttimeline(segmenttemplates[0], representation, period, stream)
  File "D:\XstreamDL-CLI-master\XstreamDL_CLI\extractors\dash\parser.py", line 306, in walk_segmenttimeline
    self.walk_s(segmenttimelines[0], segmenttemplate, representation, period, stream)
  File "D:\XstreamDL-CLI-master\XstreamDL_CLI\extractors\dash\parser.py", line 335, in walk_s
    assert isinstance(self.root.availabilityStartTime, float), 'report mpd to me'
AssertionError: report mpd to me

I hope you can help on this, thank you!

I cannot using command "DL" when using newest version!

Hi,

I just used your software recently and I see, in the latest version I cannot run the "DL" command when I have entered the key, kid, file name and stream link. When I click to "DL" button, I see that they will auto show popup but just 2 second and off, I have try again but it still that problem! But, on a previous version is v.1.2.7 is can run command "DL" but when I download video, I see it can download to 80-90% only they cannot download to 100%, just for video, audio I can download in 100% normally! I dont know why, can you help me ?

I cannot download full 100%

Thanks!

鹅大这是什么问题?

D:\Axiaoli\XstreamDL-CLI-master\XstreamDL-CLI-master>py -m XstreamDL_CLI.cli https://ols-ww100-cp.akamaized.net/manifest/master/46bac75a-1c4b-11ec-a25c-023391da732a/65794a72596d6c30496a6f7a4e6a67324e4441774d444173496e42735958526d62334a74496a6f695a47567a6133527663434973496d526c646d6c6a5a565235634755694f694a335a5749694c434a746232526c62434936496e6470626d527664334d694c434a7663315235634755694f694a6a61484a76625755694c434a7663794936496a6b354c6a41754e4467304e434973496d467763434936496a4d754d434a39/dash.mpd?cpatoken=exp=1648226827~acl=/manifest/master/46bac75a-1c4b-11ec-a25c-023391da732a/*~hmac=b4c94d2018ccc040e8fdc6fdf5065f783f1ff40330f73dcfc4c1143ff023cc73&access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkZXZpY2VfaWQiOm51bGwsIndhdGNoX3R5cGUiOiJQUkVNSVVNIiwicHJvZ3JhbV9pZCI6IjViZGFmMzYzLTM0YjItNDA5NS1hZmQ1LTI2MDlkYmMyYjk2OCIsInBhcmVudF9wcm9ncmFtX2lkIjoiZWExMDRkMDItYTZkNC0xMWU5LWJhN2EtMDZkNTQ0MDJkZDBjIiwiY2xpZW50X2lkIjoiNGQ3MDViZTQtYTQ5ZS0xMWVhLWJiMzctMDI0MmFjMTMwMDAyIiwidmlkZW9fdHlwZSI6InZvZCIsImdyYW50X3R5cGUiOiJwbGF5X3ZpZGVvIiwidXNlcl9pZCI6ImU3NDQ5M2E2LWRlOGUtNGI1ZS1hNTM1LTA0N2JhZTMyNTZhYSIsImN1cnJlbnRfc2Vjb25kIjo2ODYsInJlcG9ydF9pZCI6IlhZOTQiLCJzY29wZSI6WyJwdWJsaWM6LioiLCJtZTouKiJdLCJleHAiOjE2NDgzOTk2MjQsImRldGVjdGlvbl9pZCI6bnVsbCwidmlkZW9faWQiOiI0NmIyMWQ3Ni0xYzRiLTExZWMtYTI1Yy0wMjMzOTFkYTczMmEiLCJpc3MiOiJBc2lhcGxheS1PQXV0aC1TZXJ2ZXIiLCJpYXQiOjE2NDgxNDA0MjQsInRlcnJpdG9yeSI6IlRXIn0.lw0xVALOrK-cWhaJY6-x6YNfkeRlCor0EqBmTG1v01s
00:49:03.195 XstreamDL_CLI\cli.py:161 INFO: use 1.4.1, set URI to ['https://ols-ww100-cp.akamaized.net/manifest/master/46bac75a-1c4b-11ec-a25c-023391da732a/65794a72596d6c30496a6f7a4e6a67324e4441774d444173496e42735958526d62334a74496a6f695a47567a6133527663434973496d526c646d6c6a5a565235634755694f694a335a5749694c434a746232526c62434936496e6470626d527664334d694c434a7663315235634755694f694a6a61484a76625755694c434a7663794936496a6b354c6a41754e4467304e434973496d467763434936496a4d754d434a39/dash.mpd?cpatoken=exp=1648226827~acl=/manifest/master/46bac75a-1c4b-11ec-a25c-023391da732a/*~hmac=b4c94d2018ccc040e8fdc6fdf5065f783f1ff40330f73dcfc4c1143ff023cc73']
00:49:04.125 XstreamDL_CLI\extractor.py:104 WARNING: 无法获取视频流信息
'access_token' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

下载长视频容易中断

m3u8url = 'http://58.222.51.151/vipts.tc.qq.com/A53DH4JO0WA6HF-yGkWDAlJ3MZJQcasVauzM1iEIupBk/uwMROfz2r55goaQXGdGnC2de64gtX89GT746tcTJVnDpJgsD/svp_50112/GquHDAOkA7rx4Twr13V0_6Gm0UOcM1Y7NuPcpo6keTiLDvhC_0t-XR3YqFPdMQtE39dVgo3S0Ks2cuzatMW9RSA6G5md6O3_vRa-mi_xcJ-hxo0fByBUGEkrwUA8pkmeU7Aso-kDV4Dp8tXnOZI-78bm-Kktoo7qstxWToYb1ssRA6RthPusdw/gzc_1000102_0b53taaawaaaymaiekw2tbq4bggdbokaad2a.f321004.ts.m3u8?ver=4'

例如这个链接,总是下载到62%就会断,但是接着下载又能完全下载完

37_1 ██████████████████ 921.03/1007.86MB • 0.33MB/s • 153/244 • 62.70% 2022-01-10 21:22:30,044 XstreamDL stream.py 212 : ERROR 尝试合并 37_1 但是未下载完成

File

Couldn't download an existed .m3u8 file

input
XstreamDL-CLI.exe C:\User\Downloads\test.m3u8

error

01:39:09.461 XstreamDL_CLI\headers\default.py:26 DEBUG: use headers:
{
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36"
}
01:39:09.462 XstreamDL_CLI\cli.py:77 DEBUG: ffmpeg C:/Users/plan2/Downloads/test/XstreamDL-CLI-master/binaries/ffmpeg.exe
01:39:09.462 XstreamDL_CLI\cli.py:78 DEBUG: mp4decrypt C:/Users/plan2/Downloads/test/XstreamDL-CLI-master/binaries/mp4decrypt.exe
01:39:09.462 XstreamDL_CLI\cli.py:79 DEBUG: mp4box C:/Users/plan2/Downloads/test/XstreamDL-CLI-master/binaries/mp4box.exe
01:39:09.462 XstreamDL_CLI\cli.py:161 INFO: use 1.4.1, set URI to ['https://cdn208.stm.trueid.net/svod_wv/ASS202005000380_m_auto.smil/manifest.mpd?appid=trueid&type=svod&visitor=web&drm=wv3&uid=108364973&did=MTY0OTYxNDE0Mg&sid=aafbc4170f&rt=1649614141&tk=ylwsz0dc3gEViS4KceleacXkBbIm1pa4r1g9i5bH7zQ']
01:39:09.463 XstreamDL_CLI\cli.py:162 DEBUG: args => Namespace(version=False, help=False, speed_up=False, speed_up_left=10, live=False, compare_with_url=False, dont_split_discontinuity=False, name_from_url=False, live_duration=0.0, live_utc_offset=0, live_refresh_interval=3, name='', base_url='', ad_keyword='', resolution='', best_quality=True, video_only=False, audio_only=False, all_videos=False, all_audios=False, service='', save_dir=WindowsPath('Downloads'), select=True, multi_s=False, disable_force_close=False, limit_per_host=4, headers={'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36'}, url_patch='', overwrite=False, raw_concat=False, disable_auto_concat=False, enable_auto_delete=False, disable_auto_decrypt=False, key='67e5babd0e785cd0bccdbae46f10b3c6:ac9cac0caf7dffd96e32e1ea0bd8c238', b64key=None, hexiv=None, proxy='', disable_auto_exit=True, parse_only=False, show_init=False, index_to_name=False, log_level='INFO', redl_code=[], hide_load_metadata=False, URI=['https://cdn208.stm.trueid.net/svod_wv/ASS202005000380_m_auto.smil/manifest.mpd?appid=trueid&type=svod&visitor=web&drm=wv3&uid=108364973&did=MTY0OTYxNDE0Mg&sid=aafbc4170f&rt=1649614141&tk=ylwsz0dc3gEViS4KceleacXkBbIm1pa4r1g9i5bH7zQ'], ffmpeg='C:/Users/plan2/Downloads/test/XstreamDL-CLI-master/binaries/ffmpeg.exe', mp4decrypt='C:/Users/plan2/Downloads/test/XstreamDL-CLI-master/binaries/mp4decrypt.exe', mp4box='C:/Users/plan2/Downloads/test/XstreamDL-CLI-master/binaries/mp4box.exe')
01:39:09.667 XstreamDL_CLI\extractors\base.py:36 DEBUG: start parse uri for: https://cdn208.stm.trueid.net/svod_wv/ASS202005000380_m_auto.smil/manifest.mpd?appid=trueid&type=svod&visitor=web&drm=wv3&uid=108364973&did=MTY0OTYxNDE0Mg&sid=aafbc4170f&rt=1649614141&tk=ylwsz0dc3gEViS4KceleacXkBbIm1pa4r1g9i5bH7zQ
01:39:09.667 XstreamDL_CLI\extractors\base.py:64 DEBUG: parse uri result:
    name manifest
    home_url https://cdn208.stm.trueid.net
    base_url https://cdn208.stm.trueid.net/svod_wv/ASS202005000380_m_auto.smil
01:39:09.667 XstreamDL_CLI\extractors\base.py:29 DEBUG: save content to C:/Users/plan2/Downloads/test/XstreamDL-CLI-master/Downloads/manifest.mpd, size 28834
01:39:09.672 XstreamDL_CLI\extractors\dash\parser.py:201 DEBUG: current_base_url https://cdn208.stm.trueid.net/svod_wv/ASS202005000380_m_auto.smil
01:39:09.675 XstreamDL_CLI\extractors\dash\parser.py:201 DEBUG: current_base_url https://cdn208.stm.trueid.net/svod_wv/ASS202005000380_m_auto.smil
01:39:09.678 XstreamDL_CLI\extractors\dash\parser.py:201 DEBUG: current_base_url https://cdn208.stm.trueid.net/svod_wv/ASS202005000380_m_auto.smil
01:39:09.680 XstreamDL_CLI\extractors\dash\parser.py:201 DEBUG: current_base_url https://cdn208.stm.trueid.net/svod_wv/ASS202005000380_m_auto.smil
01:39:09.683 XstreamDL_CLI\extractors\dash\parser.py:201 DEBUG: current_base_url https://cdn208.stm.trueid.net/svod_wv/ASS202005000380_m_auto.smil
01:39:09.686 XstreamDL_CLI\extractors\dash\parser.py:201 DEBUG: current_base_url https://cdn208.stm.trueid.net/svod_wv/ASS202005000380_m_auto.smil
01:39:09.689 XstreamDL_CLI\extractors\dash\parser.py:201 DEBUG: current_base_url https://cdn208.stm.trueid.net/svod_wv/ASS202005000380_m_auto.smil
01:39:09.691 XstreamDL_CLI\extractors\dash\parser.py:201 DEBUG: current_base_url https://cdn208.stm.trueid.net/svod_wv/ASS202005000380_m_auto.smil
01:39:16.144 XstreamDL_CLI\downloader.py:284 DEBUG: selected is [6]
01:39:16.147 XstreamDL_CLI\downloader.py:310 INFO: manifest_audio_AAC_tha_125.44kbps download start.
01:39:16.155 XstreamDL_CLI\downloader.py:435 DEBUG: downloaded count 0, downloaded size 0, left count 357
01:39:16.156 XstreamDL_CLI\downloader.py:454 INFO: 357 tasks start
01:39:16.237 XstreamDL_CLI\downloader.py:487 DEBUG: init.m4s response Content-length => 782
01:39:16.237 XstreamDL_CLI\downloader.py:530 DEBUG: init.m4s download end, size => 782
01:39:16.249 XstreamDL_CLI\downloader.py:487 DEBUG: 0002.m4s response Content-length => 66409
01:39:16.251 XstreamDL_CLI\downloader.py:487 DEBUG: 0000.m4s response Content-length => 66318
01:39:16.251 XstreamDL_CLI\downloader.py:487 DEBUG: 0001.m4s response Content-length => 66035
01:39:16.263 XstreamDL_CLI\downloader.py:530 DEBUG: 0001.m4s download end, size => 66035
01:39:16.264 XstreamDL_CLI\downloader.py:530 DEBUG: 0000.m4s download end, size => 66318
01:39:16.264 XstreamDL_CLI\downloader.py:530 DEBUG: 0002.m4s download end, size => 66409
01:39:16.303 XstreamDL_CLI\downloader.py:487 DEBUG: 0003.m4s response Content-length => 66022
01:39:16.314 XstreamDL_CLI\downloader.py:530 DEBUG: 0003.m4s download end, size => 66022
01:39:16.325 XstreamDL_CLI\downloader.py:487 DEBUG: 0004.m4s response Content-length => 66341
01:39:16.327 XstreamDL_CLI\downloader.py:487 DEBUG: 0005.m4s response Content-length => 66053
01:39:16.327 XstreamDL_CLI\downloader.py:487 DEBUG: 0006.m4s response Content-length => 66381
01:39:16.335 XstreamDL_CLI\downloader.py:530 DEBUG: 0004.m4s download end, size => 66341
01:39:16.339 XstreamDL_CLI\downloader.py:530 DEBUG: 0005.m4s download end, size => 66053
01:39:16.340 XstreamDL_CLI\downloader.py:530 DEBUG: 0006.m4s download end, size => 66381
01:39:16.381 XstreamDL_CLI\downloader.py:487 DEBUG: 0007.m4s response Content-length => 66010
01:39:16.393 XstreamDL_CLI\downloader.py:530 DEBUG: 0007.m4s download end, size => 66010
01:39:16.394 XstreamDL_CLI\downloader.py:487 DEBUG: 0008.m4s response Content-length => 66387
01:39:16.397 XstreamDL_CLI\downloader.py:487 DEBUG: 0009.m4s response Content-length => 66005
01:39:16.400 XstreamDL_CLI\downloader.py:487 DEBUG: 0010.m4s response Content-length => 66395
01:39:16.405 XstreamDL_CLI\downloader.py:530 DEBUG: 0008.m4s download end, size => 66387
01:39:16.408 XstreamDL_CLI\downloader.py:530 DEBUG: 0009.m4s download end, size => 66005
01:39:16.412 XstreamDL_CLI\downloader.py:530 DEBUG: 0010.m4s download end, size => 66395
01:39:16.457 XstreamDL_CLI\downloader.py:487 DEBUG: 0011.m4s response Content-length => 66028
01:39:16.457 XstreamDL_CLI\downloader.py:519 ERROR: ! -> https://cdn208.stm.trueid.net/svod_wv/ASS202005000380_m_auto.smil/segment_ctaudio_ridp0aa0br125437_cs2112528_mpd.m4s?ccuid=c99i8jbgf2dbnh7e1vlg&appid=trueid&type=svod&visitor=web&drm=wv3&uid=108364973&did=MTY0OTYxNDE0Mg&sid=aafbc4170f&rt=1649614141&tk=ylwsz0dc3gEViS4KceleacXkBbIm1pa4r1g9i5bH7zQ
Traceback (most recent call last):
  File "C:\Users\plan2\Downloads\test\XstreamDL-CLI-master\XstreamDL_CLI\downloader.py", line 488, in download
    self.xprogress.update_total_size(stream.filesize)
  File "C:\Users\plan2\Downloads\test\XstreamDL-CLI-master\XstreamDL_CLI\downloader.py", line 195, in update_total_size
    self.update_progress(self.downloaded_count, self.total_size, self.downloaded_size)
  File "C:\Users\plan2\Downloads\test\XstreamDL-CLI-master\XstreamDL_CLI\downloader.py", line 223, in update_progress
    sys.stdout.write(text)
  File "C:\Users\plan2\AppData\Local\Programs\Python\Python310\lib\encodings\cp874.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2588' in position 35: character maps to <undefined>

Error message "only one segment, please download it manually"

Hi, I'm getting the error message "only one segment, please download it manually" when I try to download using mpd URL, this problem started from this commit, before this commit I could download without any problems.

fa6fcfc

55

The mpd link expires very fast, but here is the mpd file

717575237053-1617969874401-master.zip

and here is the debug log

XstreamDL-2021-12-18_053151.zip

I used the master branch.

https://codeload.github.com/xhlove/XstreamDL-CLI/zip/refs/heads/master

can't download ism

I cannot download ism url.
Example
https://r.cdn-ncplus.pl/vod/store01/NOV_R4OYTzmruX3PKLRHkTAu/_/hd4-hssdrm02.ism/manifest

是否可以通过 mp4decrypt 加密 DASH 分片后使用 FFMPEG 合成导出HLS

您好
感谢大佬的这个工具,非常实用,可以通过提供Key的方式录制加密DASH.
看了看原理基本是先下载分片 - merge所有分片 - mp4decrypt解密
那是否可以通过
下载3个分片 - merge 3个分片 - mp4decrypt解密 [解密1]- 再下载3个分片 - merge 3个分片 - mp4decrypt解密 [解密2] - ffmpeg 导出HLS
虽然会有延迟,可是我貌似找不到可以直接通过 ffmpeg 解密的方法
还有请大佬研究研究,有需要我帮忙也可以(虽然我也不是很会😢)
感谢

ZeroDivisionError: float division by zero

MPD URL: https://skylatam-vod4.akamaized.net/sky/007/1f201578-c5fe-4f0c-80a5-c87ede3451b3/dash/001/1f201578-c5fe-4f0c-80a5-c87ede3451b3.mpd

2022-01-16 20:39:47,189 XstreamDL log.py 41 : INFO log file -> C:/Users/Administrator/Downloads/XstreamDL-CLI-1.3.8/XstreamDL-CLI-1.3.8/logs/XstreamDL-2022-01-16_203947.log
2022-01-16 20:39:47,196 XstreamDL cli.py 152 : INFO set URI to ['https://skylatam-vod4.akamaized.net/sky/007/1f201578-c5fe-4f0c-80a5-c87ede3451b3/dash/001/1f201578-c5fe-4f0c-80a5-c87ede3451b3.mpd']
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\Administrator\Downloads\XstreamDL-CLI-1.3.8\XstreamDL-CLI-1.3.8\XstreamDL_CLI_main
.py", line 4, in
cli.main()
File "C:\Users\Administrator\Downloads\XstreamDL-CLI-1.3.8\XstreamDL-CLI-1.3.8\XstreamDL_CLI\cli.py", line 154, in main
daemon.daemon()
File "C:\Users\Administrator\Downloads\XstreamDL-CLI-1.3.8\XstreamDL-CLI-1.3.8\XstreamDL_CLI\daemon.py", line 30, in daemon
streams = extractor.fetch_metadata(self.args.URI[0])
File "C:\Users\Administrator\Downloads\XstreamDL-CLI-1.3.8\XstreamDL-CLI-1.3.8\XstreamDL_CLI\extractor.py", line 48, in fetch_metadata
return self.raw2streams('url', *loop.run_until_complete(self.fetch(uri)), parent_stream)
File "C:\Users\Administrator\Downloads\XstreamDL-CLI-1.3.8\XstreamDL-CLI-1.3.8\XstreamDL_CLI\extractor.py", line 95, in raw2streams
return self.parse_as_dash(uri_type, uri, content, parent_stream)
File "C:\Users\Administrator\Downloads\XstreamDL-CLI-1.3.8\XstreamDL-CLI-1.3.8\XstreamDL_CLI\extractor.py", line 127, in parse_as_dash
streams = self.parser.parse(uri, content)
File "C:\Users\Administrator\Downloads\XstreamDL-CLI-1.3.8\XstreamDL-CLI-1.3.8\XstreamDL_CLI\extractors\dash\parser.py", line 132, in parse
return self.walk_period(mpd, uri_item.new_base_url(base_url))
File "C:\Users\Administrator\Downloads\XstreamDL-CLI-1.3.8\XstreamDL-CLI-1.3.8\XstreamDL_CLI\extractors\dash\parser.py", line 149, in walk_period
_streams = self.walk_adaptationset(period, len(streams), uri_item.new_base_url(base_url))
File "C:\Users\Administrator\Downloads\XstreamDL-CLI-1.3.8\XstreamDL-CLI-1.3.8\XstreamDL_CLI\extractors\dash\parser.py", line 177, in walk_adaptationset
_streams = self.walk_representation(adaptationset, period, sindex + len(streams), current_uri_item)
File "C:\Users\Administrator\Downloads\XstreamDL-CLI-1.3.8\XstreamDL-CLI-1.3.8\XstreamDL_CLI\extractors\dash\parser.py", line 254, in walk_representation
self.generate_v1(period, representation.id, segmenttemplates[0], stream)
File "C:\Users\Administrator\Downloads\XstreamDL-CLI-1.3.8\XstreamDL-CLI-1.3.8\XstreamDL_CLI\extractors\dash\parser.py", line 405, in generate_v1
repeat = math.ceil(period.duration / interval)
ZeroDivisionError: float division by zero

error

Hello,
everytime i tried to download the video but it only download m4a i tried so many time but still getting this error
i'm not able to download mp4 file
https://www.viki.com/videos/1192527v-assistant-of-superstar-episode-1

51.43kbps 674.78/4077.48MB • 0.37MB/s • 0/1 • 0.00% 2022-03-23 14:57:08,689 XstreamDL downloader.py 457 : INFO tasks end, time used 301.05s
2022-03-23 14:57:08,692 XstreamDL stream.py 212 : ERROR try to concat manifest_video_H264_1920x1080_5251.43kbps buf download not completely
2022-03-23 14:57:08,692 XstreamDL downloader.py 296 : WARNING only one segment, download speed maybe slow =>
https://cloudfront.viki.net/1192527v/dash/1192527v_dash_high_1080p_drm_9e2b99_2202140542-audio-en-mp4a.mp4
2022-03-23 14:57:08,695 XstreamDL downloader.py 307 : INFO manifest_audio_AAC_en_200.50kbps download start.
2022-03-23 14:57:08,698 XstreamDL downloader.py 451 : INFO 1 tasks start
Screenshot_2

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.