@@ -105,19 +105,35 @@ class DouyinSite implements LiveSite {
105105 var ids = category.id.split (',' );
106106 var partitionId = ids[0 ];
107107 var partitionType = ids[1 ];
108+
109+ String serverUrl =
110+ "https://live.douyin.com/webcast/web/partition/detail/room/v2/" ;
111+ var uri = Uri .parse (serverUrl)
112+ .replace (scheme: "https" , port: 443 , queryParameters: {
113+ "aid" : '6383' ,
114+ "app_name" : "douyin_web" ,
115+ "live_id" : '1' ,
116+ "device_platform" : "web" ,
117+ "language" : "zh-CN" ,
118+ "enter_from" : "link_share" ,
119+ "cookie_enabled" : "true" ,
120+ "screen_width" : "1980" ,
121+ "screen_height" : "1080" ,
122+ "browser_language" : "zh-CN" ,
123+ "browser_platform" : "Win32" ,
124+ "browser_name" : "Edge" ,
125+ "browser_version" : "125.0.0.0" ,
126+ "browser_online" : "true" ,
127+ "count" : '15' ,
128+ "offset" : ((page - 1 ) * 15 ).toString (),
129+ "partition" : partitionId,
130+ "partition_type" : partitionType,
131+ "req_from" : '2'
132+ });
133+ var requestUrl = await getAbogusUrl (uri.toString ());
134+
108135 var result = await HttpClient .instance.getJson (
109- "https://live.douyin.com/webcast/web/partition/detail/room/" ,
110- queryParameters: {
111- "aid" : 6383 ,
112- "app_name" : "douyin_web" ,
113- "live_id" : 1 ,
114- "device_platform" : "web" ,
115- "count" : 15 ,
116- "offset" : (page - 1 ) * 15 ,
117- "partition" : partitionId,
118- "partition_type" : partitionType,
119- "req_from" : 2
120- },
136+ requestUrl,
121137 header: await getRequestHeaders (),
122138 );
123139
@@ -140,18 +156,34 @@ class DouyinSite implements LiveSite {
140156
141157 @override
142158 Future <LiveCategoryResult > getRecommendRooms ({int page = 1 }) async {
159+ String serverUrl =
160+ "https://live.douyin.com/webcast/web/partition/detail/room/v2/" ;
161+ var uri = Uri .parse (serverUrl)
162+ .replace (scheme: "https" , port: 443 , queryParameters: {
163+ "aid" : '6383' ,
164+ "app_name" : "douyin_web" ,
165+ "live_id" : '1' ,
166+ "device_platform" : "web" ,
167+ "language" : "zh-CN" ,
168+ "enter_from" : "link_share" ,
169+ "cookie_enabled" : "true" ,
170+ "screen_width" : "1980" ,
171+ "screen_height" : "1080" ,
172+ "browser_language" : "zh-CN" ,
173+ "browser_platform" : "Win32" ,
174+ "browser_name" : "Edge" ,
175+ "browser_version" : "125.0.0.0" ,
176+ "browser_online" : "true" ,
177+ "count" : '15' ,
178+ "offset" : ((page - 1 ) * 15 ).toString (),
179+ "partition" : '720' ,
180+ "partition_type" : '1' ,
181+ "req_from" : '2'
182+ });
183+ var requestUrl = await getAbogusUrl (uri.toString ());
184+
143185 var result = await HttpClient .instance.getJson (
144- "https://live.douyin.com/webcast/web/partition/detail/room/" ,
145- queryParameters: {
146- "aid" : 6383 ,
147- "app_name" : "douyin_web" ,
148- "live_id" : 1 ,
149- "device_platform" : "web" ,
150- "count" : 15 ,
151- "offset" : (page - 1 ) * 15 ,
152- "partition" : 720 ,
153- "partition_type" : 1 ,
154- },
186+ requestUrl,
155187 header: await getRequestHeaders (),
156188 );
157189
@@ -413,28 +445,32 @@ class DouyinSite implements LiveSite {
413445 /// 通过webRid获取直播间Web信息
414446 /// - [webRid] 直播间RID
415447 Future <Map > _getRoomDataByApi (String webRid) async {
448+ String serverUrl = "https://live.douyin.com/webcast/room/web/enter/" ;
449+ var uri = Uri .parse (serverUrl)
450+ .replace (scheme: "https" , port: 443 , queryParameters: {
451+ "aid" : '6383' ,
452+ "app_name" : "douyin_web" ,
453+ "live_id" : '1' ,
454+ "device_platform" : "web" ,
455+ "enter_from" : "web_live" ,
456+ "web_rid" : webRid,
457+ "room_id_str" : "" ,
458+ "enter_source" : "" ,
459+ "Room-Enter-User-Login-Ab" : '0' ,
460+ "is_need_double_stream" : 'false' ,
461+ "cookie_enabled" : 'true' ,
462+ "screen_width" : '1980' ,
463+ "screen_height" : '1080' ,
464+ "browser_language" : "zh-CN" ,
465+ "browser_platform" : "Win32" ,
466+ "browser_name" : "Edge" ,
467+ "browser_version" : "125.0.0.0"
468+ });
469+ var requestUrl = await getAbogusUrl (uri.toString ());
470+
416471 var requestHeader = await getRequestHeaders ();
417472 var result = await HttpClient .instance.getJson (
418- "https://live.douyin.com/webcast/room/web/enter/" ,
419- queryParameters: {
420- "aid" : 6383 ,
421- "app_name" : "douyin_web" ,
422- "live_id" : 1 ,
423- "device_platform" : "web" ,
424- "enter_from" : "web_live" ,
425- "web_rid" : webRid,
426- "room_id_str" : "" ,
427- "enter_source" : "" ,
428- "Room-Enter-User-Login-Ab" : 0 ,
429- "is_need_double_stream" : false ,
430- "cookie_enabled" : true ,
431- "screen_width" : 1980 ,
432- "screen_height" : 1080 ,
433- "browser_language" : "zh-CN" ,
434- "browser_platform" : "Win32" ,
435- "browser_name" : "Edge" ,
436- "browser_version" : "125.0.0.0"
437- },
473+ requestUrl,
438474 header: requestHeader,
439475 );
440476
0 commit comments