You've already forked N_m3u8DL-CLI
mirror of
https://github.com/nilaoda/N_m3u8DL-CLI
synced 2025-09-09 09:20:52 +02:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f69978bd82 | ||
![]() |
d9fd526886 | ||
![]() |
1cc8ecfaaf | ||
![]() |
2bc2dde2ad | ||
![]() |
c3ddcf9e0e | ||
![]() |
ba5d20dd02 |
@@ -32,7 +32,7 @@ namespace N_m3u8DL_CLI
|
||||
/*===============================================================================*/
|
||||
static Version ver = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
|
||||
static string nowVer = $"{ver.Major}.{ver.Minor}.{ver.Build}";
|
||||
static string nowDate = "20201122";
|
||||
static string nowDate = "20201123";
|
||||
public static void WriteInit()
|
||||
{
|
||||
Console.Clear();
|
||||
@@ -110,7 +110,7 @@ namespace N_m3u8DL_CLI
|
||||
HttpWebRequest webRequest = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(url);
|
||||
webRequest.Method = "GET";
|
||||
if (NoProxy) webRequest.Proxy = null;
|
||||
webRequest.UserAgent = "Mozilla/5.0 (Linux; U; Android 7.0; zh-cn; 15 Plus Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/9.4 Mobile Safari/537.36";
|
||||
webRequest.UserAgent = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36";
|
||||
webRequest.Accept = "*/*";
|
||||
webRequest.Headers.Add("Accept-Encoding", "gzip, deflate, br");
|
||||
webRequest.Timeout = TimeOut; //设置超时
|
||||
@@ -120,7 +120,7 @@ namespace N_m3u8DL_CLI
|
||||
{
|
||||
webRequest.UserAgent = "";
|
||||
if (!url.Contains("/internettv/"))
|
||||
webRequest.Referer = "https://player.mgtv.com/mgtv_v6_player/PlayerCore.swf";
|
||||
webRequest.Referer = "https://www.mgtv.com";
|
||||
webRequest.Headers.Add("Cookie", "MQGUID");
|
||||
}
|
||||
//添加headers
|
||||
@@ -158,7 +158,7 @@ namespace N_m3u8DL_CLI
|
||||
}
|
||||
|
||||
//文件过大则认为不是m3u8
|
||||
if (webResponse.ContentLength != -1 && webRequest.ContentLength > 50 * 1024 * 1024) return "";
|
||||
if (webResponse.ContentLength != -1 && webResponse.ContentLength > 50 * 1024 * 1024) return "";
|
||||
|
||||
if (webResponse.ContentEncoding != null
|
||||
&& webResponse.ContentEncoding.ToLower() == "gzip") //如果使用了GZip则先解压
|
||||
@@ -427,7 +427,7 @@ namespace N_m3u8DL_CLI
|
||||
if (NoProxy) req.Proxy = null;
|
||||
req.Headers.Add("Accept-Encoding", "gzip, deflate");
|
||||
req.Accept = "*/*";
|
||||
req.UserAgent = "Mozilla/5.0 (Linux; U; Android 7.0; zh-cn; 15 Plus Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/9.4 Mobile Safari/537.36";
|
||||
req.UserAgent = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36";
|
||||
//添加headers
|
||||
if (headers != "")
|
||||
{
|
||||
@@ -536,11 +536,11 @@ namespace N_m3u8DL_CLI
|
||||
{
|
||||
request.UserAgent = "";
|
||||
if (!url.Contains("/internettv/"))
|
||||
request.Referer = "https://player.mgtv.com/mgtv_v6_player/PlayerCore.swf";
|
||||
request.Referer = "https://www.mgtv.com";
|
||||
request.Headers.Add("Cookie", "MQGUID");
|
||||
}
|
||||
else
|
||||
request.UserAgent = "Mozilla/5.0 (Linux; U; Android 7.0; zh-cn; 15 Plus Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/9.4 Mobile Safari/537.36";
|
||||
request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36";
|
||||
//下载部分字节
|
||||
if (expectByte != -1)
|
||||
request.AddRange("bytes", startByte, startByte + expectByte - 1);
|
||||
|
@@ -864,9 +864,7 @@ namespace N_m3u8DL_CLI
|
||||
/// <returns></returns>
|
||||
public static string GetBaseUrl(string m3u8url, string headers)
|
||||
{
|
||||
if (!isQiQiuYun && Global.Get302(m3u8url, headers) != m3u8url)
|
||||
m3u8url = Global.Get302(m3u8url, headers);
|
||||
string url = Global.Get302(m3u8url);
|
||||
string url = Global.Get302(m3u8url, headers);
|
||||
if (url.Contains("?"))
|
||||
url = url.Remove(url.LastIndexOf('?'));
|
||||
url = url.Substring(0, url.LastIndexOf('/') + 1);
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -287,4 +287,7 @@
|
||||
- 修复BUG
|
||||
2020年11月22日
|
||||
- 解决HTTPS协议自动重定向后,Referer丢失问题
|
||||
- 新的任务速度监控逻辑
|
||||
- 新的任务速度监控逻辑
|
||||
2020年11月23日
|
||||
- 将默认UA修改为 Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36
|
||||
- 修改芒果TV请求头
|
Reference in New Issue
Block a user