Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用本地文件下载时,添加的--append-url-params参数无效 #546

Open
592767809 opened this issue Dec 4, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@592767809
Copy link

592767809 commented Dec 4, 2024

使用的版本为
N_m3u8DL-RE_v0.3.0-beta_linux-x64_20241203
运行环境为win10 wsl Ubuntu 22.04.3 LTS

本地文件为:

<?xml version="1.0" encoding="utf-8"?> <MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd" xmlns:cenc="urn:mpeg:cenc:2013" xmlns:mspr="urn:microsoft:playready" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="static" mediaPresentationDuration="PT32M29.504000S" minBufferTime="PT10S" maxSegmentDuration="PT12S"> <Period duration="PT32M29.504000S"> <AdaptationSet id="1" group="1" mimeType="audio/mp4" lang="und" contentType="audio"> <ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="16be90e1-5d87-e0bb-fc2d-e8d64bfacbc4"/><ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"/> <Role schemeIdUri="urn:mpeg:dash:role:2011" value="main" /> <SegmentTemplate timescale="10000000" duration="60000000" initialization="hamivideo-2546-2546104493_f_001-$RepresentationID$-init.mp4" media="hamivideo-2546-2546104493_f_001-$RepresentationID$-$Number$.m4s" /> <Representation id="mp4a_128604=4" bandwidth="128604" audioSamplingRate="48000" codecs="mp4a.40.2"> <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2" /> </Representation> </AdaptationSet> <AdaptationSet id="2" group="2" frameRate="2997/100" mimeType="video/mp4" startWithSAP="1" contentType="video" par="16:9" minBandwidth="1479000" maxBandwidth="7800000" minWidth="960" maxWidth="1920" minHeight="540" maxHeight="1080"> <ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="16be90e1-5d87-e0bb-fc2d-e8d64bfacbc4"/><ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"/> <Role schemeIdUri="urn:mpeg:dash:role:2011" value="main" /> <SegmentTemplate timescale="10000000" duration="60000000" initialization="hamivideo-2546-2546104493_f_001-$RepresentationID$-init.mp4" media="hamivideo-2546-2546104493_f_001-$RepresentationID$-$Number$.m4s" /> <Representation id="avc1_1479000=1" bandwidth="1479000" width="960" height="540" sar="1:1" codecs="avc1.4d401f" /> <Representation id="avc1_2956000=2" bandwidth="2956000" width="1280" height="720" sar="1:1" codecs="avc1.640028" /> <Representation id="avc1_7800000=3" bandwidth="7800000" width="1920" height="1080" sar="1:1" codecs="avc1.640028" /> </AdaptationSet> </Period> </MPD>

使用的命令行:
[
"re",
"/tmp/319c1af93bce77778810bb0431a5fd4bd34e0dcaceb73e8e8e52477ae758bcf6",
"--base-url",
"https://webvod-hamivideo.cdn.hinet.net/vod/hamivideo2/hamivideo-2546-2546104493_f_001//hd_6840-da-wv-all-ma-6sv2/hamivideo-2546-2546104493_f_001.mpd?url_type=&token=ITwfH2vkmkKvYXJZKJqT1A&expires=1733317734&content_pk=OTT_VOD_0000373272&content_id=373272&product_id=23126&serial_no=1720099295-67-05-10-80-68&device_id=bdc9067d9f554902b2a61c992d4fd98b&auth_type=sn&auth_by=google_115598647509375061664&sales_plan_id=34084&ts_id=&auth_login_id=google_115598647509375061664&user_profile_id=bfea98f65e8fb66255c0d2d684bb1902@1709222400&device_os=win&device_type_name=pc&chsm=216ad6cef6e7d139b98bc997a0789b2c&record_idx=1552122616",
"--log-level",
"DEBUG",
"--append-url-params",
"True",
"--skip-merge",
"--tmp-dir",
"/home/root/out/11b7a889ca89e7cc6da0a53de32a7febfb41ffa0",
"--thread-count",
"16",
"--download-retry-count",
"3",
"--custom-proxy",
"http://192.168.2.220:7890",
"-sv",
"id="avc1_7800000=3""
]

从控制台窗口打印的日志:
......
09:09:08.712 DEBUG: Fetch: https://webvod-hamivideo.cdn.hinet.net/vod/hamivideo2/hamivideo-2546-2546104493_f_001/_/hd_6840-da-wv-all-ma-6sv2/hamivideo-2546-2546104493_f_001-avc1_7800000=3-init.mp4
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36

Vid 1920x1080 | 7800 Kbps | 29.97 | Main ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0/326 0.00% - 0.00Bps --:--:--
Vid 1920x1080 | 7800 Kbps | 29.97 | Main ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0/326 0.00% - 0.00Bps --:--:--
09:09:09.074 DEBUG: Response status code does not indicate success: 451. retryCount: 3
09:09:09.079 DEBUG:
Vid 1920x1080 | 7800 Kbps | 29.97 | Main ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0/326 0.00% - 0.00Bps(1) --:--:--https://webvod-hamivideo.cdn.hinet.net/vod/hamivideo2/hamivideo-2546-2546104493_f_001/_/hd_6840-da-wv-all-ma-6sv2/hamivideo-2546-2546104493_f_001-avc1_7800000=3-init.mp4 System.Net.Http.HttpRequestException: Response status code does not indicate success: 451.
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() + 0xe2
at N_m3u8DL_RE.Util.DownloadUtil.d__2.MoveNext() + 0x77b
--- End of stack trace from previous location ---
at N_m3u8DL_RE.Downloader.SimpleDownloader.d__3.MoveNext() + 0x45d
......

可以看到请求的地址后面,并没有被添加上查询参数,设置的--append-url-params参数并没有生效

预期想要的想过为请求的链接添加上--base-url参数后面的查询参数,例如
https://webvod-hamivideo.cdn.hinet.net/vod/hamivideo2/hamivideo-2546-2546104493_f_001/_/hd_6840-da-wv-all-ma-6sv2/hamivideo-2546-2546104493_f_001-avc1_7800000=3-init.mp4?url_type=&token=ITwfH2vkmkKvYXJZKJqT1A&expires=1733317734&content_pk=OTT_VOD_0000373272&content_id=373272&product_id=23126&serial_no=1720099295-67-05-10-80-68&device_id=bdc9067d9f554902b2a61c992d4fd98b&auth_type=sn&auth_by=google_115598647509375061664&sales_plan_id=34084&ts_id=&auth_login_id=google_115598647509375061664&user_profile_id=bfea98f65e8fb66255c0d2d684bb1902@1709222400&device_os=win_&device_type_name=pc&chsm=216ad6cef6e7d139b98bc997a0789b2c&record_idx=1552122616

@nilaoda nilaoda added the bug Something isn't working label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants