Skip to content

Commit 5b77be8

Browse files
committed
filmix pro
1 parent 0c91fa5 commit 5b77be8

File tree

3 files changed

+33
-12
lines changed

3 files changed

+33
-12
lines changed

AppInit.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public class AppInit
9090

9191
public OnlinesSettings Kinotochka = new OnlinesSettings("https://kinotochka.co", false);
9292

93-
public OnlinesSettings Filmix = new OnlinesSettings("http://filmixapp.cyou", false);
93+
public FilmixSettings Filmix = new FilmixSettings("http://filmixapp.cyou");
9494

9595
public VCDNSettings VCDN = new VCDNSettings("https://videocdn.tv", "3i40G5TSECmLF77oAqnEgbx61ZWaOYaE", "http://58.svetacdn.in", false);
9696

Controllers/LITE/Filmix.cs

+25-7
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,21 @@ namespace Lampac.Controllers.LITE
1515
{
1616
public class Filmix : BaseController
1717
{
18+
#region filmixpro
19+
[HttpGet]
20+
[Route("lite/filmixpro")]
21+
async public Task<ActionResult> Pro()
22+
{
23+
var token_request = await HttpClient.Get<JObject>($"{AppInit.conf.Filmix.host}/api/v2/token_request?user_dev_apk=1.1.3&user_dev_id=&user_dev_name=Xiaomi&user_dev_os=11&user_dev_vendor=Xiaomi&user_dev_token=");
24+
25+
string html = "1. Откройте <a href='https://filmix.ac/consoles'>https://filmix.ac/consoles</a> <br>";
26+
html += $"2. Введите код <b>{token_request.Value<string>("user_code")}</b><br>";
27+
html += $"3. В init.conf укажите token <b>{token_request.Value<string>("code")}</b>";
28+
29+
return Content(html, "text/html; charset=utf-8");
30+
}
31+
#endregion
32+
1833
[HttpGet]
1934
[Route("lite/filmix")]
2035
async public Task<ActionResult> Index(string title, string original_title, int year, int postid, int t, int s = -1)
@@ -26,7 +41,7 @@ async public Task<ActionResult> Index(string title, string original_title, int y
2641
string memKey = $"filmix:{postid}";
2742
if (!memoryCache.TryGetValue(memKey, out RootObject root))
2843
{
29-
root = await HttpClient.Get<RootObject>($"{AppInit.conf.Filmix.host}/api/v2/post/{postid}?user_dev_apk=2.0.1&user_dev_id=&user_dev_name=Xiaomi&user_dev_os=11&user_dev_token=&user_dev_vendor=Xiaomi", timeoutSeconds: 8, IgnoreDeserializeObject: true, useproxy: AppInit.conf.Filmix.useproxy);
44+
root = await HttpClient.Get<RootObject>($"{AppInit.conf.Filmix.host}/api/v2/post/{postid}?user_dev_apk=2.0.1&user_dev_id=&user_dev_name=Xiaomi&user_dev_os=11&user_dev_token={AppInit.conf.Filmix.token}&user_dev_vendor=Xiaomi", timeoutSeconds: 8, IgnoreDeserializeObject: true, useproxy: AppInit.conf.Filmix.useproxy);
3045
if (root?.player_links == null)
3146
return Content(string.Empty);
3247

@@ -45,19 +60,22 @@ async public Task<ActionResult> Index(string title, string original_title, int y
4560
string streansquality = string.Empty;
4661
List<(string link, string quality)> streams = new List<(string, string)>();
4762

48-
foreach (string q in new string[] { /*"2160,", "1440,", "1080,",*/ "720,", "480,", "360," })
63+
foreach (int q in new int[] { 2160, 1440, 1080, 720, 480, 360 })
4964
{
50-
if (!v.link.Contains(q))
65+
if (!v.link.Contains($"{q},"))
66+
continue;
67+
68+
if (string.IsNullOrWhiteSpace(AppInit.conf.Filmix.token) && q > 720)
5169
continue;
5270

53-
string l = Regex.Replace(v.link, "_\\[[0-9,]+\\]\\.mp4$", $"_{q.Replace(",", "")}.mp4");
71+
string l = Regex.Replace(v.link, "_\\[[0-9,]+\\]\\.mp4$", $"_{q}.mp4");
5472
l = AppInit.conf.Filmix.streamproxy ? $"{AppInit.Host(HttpContext)}/proxy/{l}" : l;
5573

5674
if (link == null)
5775
link = l;
5876

59-
streams.Add((l, q.Replace(",", "p")));
60-
streansquality += $"\"{q.Replace(",", "p")}\":\"" + l + "\",";
77+
streams.Add((l, $"{q}p"));
78+
streansquality += $"\"{$"{q}p"}\":\"" + l + "\",";
6179
}
6280

6381
streansquality = "\"quality\": {" + Regex.Replace(streansquality, ",$", "") + "}";
@@ -109,7 +127,7 @@ async public Task<ActionResult> Index(string title, string original_title, int y
109127

110128
foreach (int lq in episode.Value.qualities.OrderByDescending(i => i))
111129
{
112-
if (lq > 720)
130+
if (string.IsNullOrWhiteSpace(AppInit.conf.Filmix.token) && lq > 720)
113131
continue;
114132

115133
string l = episode.Value.link.Replace("_%s.mp4", $"_{lq}.mp4");

Models/LITE/Filmix/FilmixSettings.cs

+7-4
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@
22
{
33
public class FilmixSettings
44
{
5-
public FilmixSettings(string apihost, bool useproxy)
5+
public FilmixSettings(string host)
66
{
7-
this.apihost = apihost;
8-
this.useproxy = useproxy;
7+
this.host = host;
98
}
109

1110

12-
public string apihost { get; set; }
11+
public string host { get; set; }
12+
13+
public string token { get; set; }
1314

1415
public bool useproxy { get; set; }
16+
17+
public bool streamproxy { get; set; }
1518
}
1619
}

0 commit comments

Comments
 (0)