Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
XianxinMao
Yt Dlp
提交
71baa490
Y
Yt Dlp
项目概览
XianxinMao
/
Yt Dlp
10 个月 前同步成功
通知
27
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
Yt Dlp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
71baa490
编写于
7月 20, 2023
作者:
B
bashonly
提交者:
GitHub
7月 20, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[networking] Fix POST requests with zero-length payloads (#7648)
Bugfix for
227bf1a3
Authored by: bashonly
上级
613dbce1
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
14 addition
and
3 deletion
+14
-3
test/test_networking.py
test/test_networking.py
+11
-0
yt_dlp/extractor/ettutv.py
yt_dlp/extractor/ettutv.py
+1
-1
yt_dlp/networking/_urllib.py
yt_dlp/networking/_urllib.py
+1
-1
yt_dlp/networking/common.py
yt_dlp/networking/common.py
+1
-1
未找到文件。
test/test_networking.py
浏览文件 @
71baa490
...
...
@@ -1280,6 +1280,17 @@ def test_content_type_header(self):
req
.
data
=
b
'test3'
assert
req
.
headers
.
get
(
'Content-Type'
)
==
'application/x-www-form-urlencoded'
def
test_update_req
(
self
):
req
=
Request
(
'http://example.com'
)
assert
req
.
data
is
None
assert
req
.
method
==
'GET'
assert
'Content-Type'
not
in
req
.
headers
# Test that zero-byte payloads will be sent
req
.
update
(
data
=
b
''
)
assert
req
.
data
==
b
''
assert
req
.
method
==
'POST'
assert
req
.
headers
.
get
(
'Content-Type'
)
==
'application/x-www-form-urlencoded'
def
test_proxies
(
self
):
req
=
Request
(
url
=
'http://example.com'
,
proxies
=
{
'http'
:
'http://127.0.0.1:8080'
})
assert
req
.
proxies
==
{
'http'
:
'http://127.0.0.1:8080'
}
...
...
yt_dlp/extractor/ettutv.py
浏览文件 @
71baa490
...
...
@@ -41,7 +41,7 @@ def _real_extract(self, url):
'device'
:
'desktop'
,
})
stream_response
=
self
.
_download_json
(
player_settings
[
'streamAccess'
],
video_id
,
data
=
{}
)
stream_response
=
self
.
_download_json
(
player_settings
[
'streamAccess'
],
video_id
,
data
=
b
''
)
formats
,
subtitles
=
self
.
_extract_m3u8_formats_and_subtitles
(
stream_response
[
'data'
][
'stream'
],
video_id
,
'mp4'
)
...
...
yt_dlp/networking/_urllib.py
浏览文件 @
71baa490
...
...
@@ -315,7 +315,7 @@ def get_method(self):
def
update_Request
(
req
,
url
=
None
,
data
=
None
,
headers
=
None
,
query
=
None
):
req_headers
=
req
.
headers
.
copy
()
req_headers
.
update
(
headers
or
{})
req_data
=
data
or
req
.
data
req_data
=
data
if
data
is
not
None
else
req
.
data
req_url
=
update_url_query
(
url
or
req
.
get_full_url
(),
query
)
req_get_method
=
req
.
get_method
()
if
req_get_method
==
'HEAD'
:
...
...
yt_dlp/networking/common.py
浏览文件 @
71baa490
...
...
@@ -425,7 +425,7 @@ def headers(self, new_headers: Mapping):
raise
TypeError
(
'headers must be a mapping'
)
def
update
(
self
,
url
=
None
,
data
=
None
,
headers
=
None
,
query
=
None
):
self
.
data
=
data
or
self
.
data
self
.
data
=
data
if
data
is
not
None
else
self
.
data
self
.
headers
.
update
(
headers
or
{})
self
.
url
=
update_url_query
(
url
or
self
.
url
,
query
or
{})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录