mirror of
https://github.com/kodjodevf/mangayomi-extensions.git
synced 2026-02-14 10:51:17 +00:00
update anime_index
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import '../../../../model/source.dart';
|
import '../../../../model/source.dart';
|
||||||
|
|
||||||
Source get wcostreamSource => _wcostreamSource;
|
Source get wcostreamSource => _wcostreamSource;
|
||||||
const wcostreamVersion = "0.0.1";
|
const wcostreamVersion = "0.0.11";
|
||||||
const wcostreamSourceCodeUrl =
|
const wcostreamSourceCodeUrl =
|
||||||
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/anime/src/en/wcostream/wcostream-v$wcostreamVersion.dart";
|
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/anime/src/en/wcostream/wcostream-v$wcostreamVersion.dart";
|
||||||
Source _wcostreamSource = Source(
|
Source _wcostreamSource = Source(
|
||||||
|
|||||||
@@ -2,25 +2,30 @@ import 'dart:convert';
|
|||||||
import 'package:bridge_lib/bridge_lib.dart';
|
import 'package:bridge_lib/bridge_lib.dart';
|
||||||
|
|
||||||
getPopularAnime(MangaModel anime) async {
|
getPopularAnime(MangaModel anime) async {
|
||||||
return await getLatestUpdatesManga(anime);
|
return await getLatestUpdatesAnime(anime);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<MangaModel> getLatestUpdatesManga(MangaModel anime) async {
|
Future<MangaModel> getLatestUpdatesAnime(MangaModel anime) async {
|
||||||
final data = {
|
final data = {
|
||||||
"url": anime.baseUrl,
|
"url": anime.baseUrl,
|
||||||
"headers": {"Referer": "https://wcostream.org/"},
|
"headers": {"referer": "https://wcostream.org/"},
|
||||||
"sourceId": anime.sourceId
|
"sourceId": anime.sourceId
|
||||||
};
|
};
|
||||||
final res = await MBridge.http(json.encode(data), 0);
|
final res = await MBridge.http(json.encode(data), 0);
|
||||||
if (res.isEmpty) {
|
if (res.isEmpty) {
|
||||||
return anime;
|
return anime;
|
||||||
}
|
}
|
||||||
anime.urls = MBridge.xpath(
|
final urlss = MBridge.xpath(
|
||||||
res,
|
res,
|
||||||
'//*[@id="content"]/div/div[contains(text(),"Recent Releases")]/div/ul/li/div[@class="img"]/a/@href',
|
'//*[@id="content"]/div/div[contains(text(),"Recent Releases")]/div/ul/li/div[@class="img"]/a/img/@alt',
|
||||||
'._')
|
'._')
|
||||||
.split('._');
|
.split('._');
|
||||||
|
List<String> urls = [];
|
||||||
|
for (var url in MBridge.listParse(urlss, 0)) {
|
||||||
|
urls.add(
|
||||||
|
"/anime/${MBridge.regExp(url, "[^A-Za-z0-9 ]", "", 0, 0).replaceAll(" ", "-").toLowerCase()}/");
|
||||||
|
}
|
||||||
|
anime.urls = urls;
|
||||||
final imagess = MBridge.xpath(
|
final imagess = MBridge.xpath(
|
||||||
res,
|
res,
|
||||||
'//*[@id="content"]/div/div[contains(text(),"Recent Releases")]/div/ul/li/div[@class="img"]/a/img/@src',
|
'//*[@id="content"]/div/div[contains(text(),"Recent Releases")]/div/ul/li/div[@class="img"]/a/img/@src',
|
||||||
Reference in New Issue
Block a user