@@ -15,6 +15,21 @@ namespace Lampac.Controllers.LITE
15
15
{
16
16
public class Filmix : BaseController
17
17
{
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
+
18
33
[ HttpGet ]
19
34
[ Route ( "lite/filmix" ) ]
20
35
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
26
41
string memKey = $ "filmix:{ postid } ";
27
42
if ( ! memoryCache . TryGetValue ( memKey , out RootObject root ) )
28
43
{
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 ) ;
30
45
if ( root ? . player_links == null )
31
46
return Content ( string . Empty ) ;
32
47
@@ -45,19 +60,22 @@ async public Task<ActionResult> Index(string title, string original_title, int y
45
60
string streansquality = string . Empty ;
46
61
List < ( string link , string quality ) > streams = new List < ( string , string ) > ( ) ;
47
62
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 } )
49
64
{
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 )
51
69
continue ;
52
70
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") ;
54
72
l = AppInit . conf . Filmix . streamproxy ? $ "{ AppInit . Host ( HttpContext ) } /proxy/{ l } " : l ;
55
73
56
74
if ( link == null )
57
75
link = l ;
58
76
59
- streams . Add ( ( l , q . Replace ( "," , "p" ) ) ) ;
60
- streansquality += $ "\" { q . Replace ( "," , "p" ) } \" :\" " + l + "\" ," ;
77
+ streams . Add ( ( l , $ " { q } p" ) ) ;
78
+ streansquality += $ "\" { $ " { q } p" } \" :\" " + l + "\" ," ;
61
79
}
62
80
63
81
streansquality = "\" quality\" : {" + Regex . Replace ( streansquality , ",$" , "" ) + "}" ;
@@ -109,7 +127,7 @@ async public Task<ActionResult> Index(string title, string original_title, int y
109
127
110
128
foreach ( int lq in episode . Value . qualities . OrderByDescending ( i => i ) )
111
129
{
112
- if ( lq > 720 )
130
+ if ( string . IsNullOrWhiteSpace ( AppInit . conf . Filmix . token ) && lq > 720 )
113
131
continue ;
114
132
115
133
string l = episode . Value . link . Replace ( "_%s.mp4" , $ "_{ lq } .mp4") ;
0 commit comments