Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
femalemonkeyman committed May 7, 2024
1 parent 234d7fd commit 97fc260
Show file tree
Hide file tree
Showing 12 changed files with 358 additions and 357 deletions.
20 changes: 0 additions & 20 deletions lib/discord_rpc.dart

This file was deleted.

15 changes: 8 additions & 7 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:go_router/go_router.dart';
import 'package:isar/isar.dart';
import 'package:media_kit/media_kit.dart';
import 'package:path_provider/path_provider.dart';
import 'package:tokuwari/pages/settings_page.dart';
import 'package:tokuwari/viewers/Novel/media_novel.dart';
import 'package:window_manager/window_manager.dart';
import 'package:tokuwari_models/info_models.dart';
Expand Down Expand Up @@ -107,7 +108,7 @@ class Navigation extends StatelessWidget {
GoRoute(
parentNavigatorKey: _rootKey,
path: 'viewer',
onExit: (context) {
onExit: (context, state) {
SystemChrome.setEnabledSystemUIMode(
SystemUiMode.manual,
overlays: SystemUiOverlay.values,
Expand Down Expand Up @@ -189,6 +190,11 @@ class Navigation extends StatelessWidget {
),
],
),
GoRoute(
name: 'settings',
path: '/settings',
builder: (context, state) => Settings(),
),
],
);

Expand All @@ -200,12 +206,7 @@ class Navigation extends StatelessWidget {
useMaterial3: true,
darkIsTrueBlack: true,
scheme: FlexScheme.deepPurple,
pageTransitionsTheme: const PageTransitionsTheme(
builders: {
TargetPlatform.linux: OpenUpwardsPageTransitionsBuilder(),
},
),
typography: Typography.material2021(platform: Theme.of(context).platform),
//typography: Typography.material2021(platform: Theme.of(context).platform),
),
scrollBehavior: const Allow(),
debugShowCheckedModeBanner: false,
Expand Down
2 changes: 1 addition & 1 deletion lib/media/providers/anime/animepahe.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Anime paheInfo(final String id) async {
parse(i.data).getElementsByTagName('script').where((element) => element.text.contains('eval')).first.text,
).unpack().split('source=\'')[1].split('\'')[0],
].reversed,
), //qualities,
),
subtitles: {},
headers: {'referer': 'https://kwik.cx'},
);
Expand Down
96 changes: 56 additions & 40 deletions lib/media/providers/anime/anitaku.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,55 +6,71 @@ import 'package:encrypt/encrypt.dart';
import 'package:html/parser.dart';
import 'package:tokuwari_models/info_models.dart';

const String gogo = 'https://anitaku.to/';
const String gogo = 'https://anitaku.so';

Provider gogoList(final AniData data) async {
try {
final msync = await Dio()
.get(
'$anisync/${data.malid}',
options: Options(
responseType: ResponseType.plain,
),
'$anisync/${data.malid}',
options: Options(
responseType: ResponseType.plain,
),
)
.then((value) {
return jsonDecode(value.data)['Sites']['Gogoanime'].keys.first;
});
final gogoPage = await Dio().get('$gogo/category/$msync');
final goid = parse(gogoPage.data).getElementsByClassName('movie_id').first.attributes['value'];
final episodeList =
await Dio().get('https://ajax.gogocdn.net/ajax/load-list-episode?ep_start=0&ep_end=9999&id=$goid');
return [
for (final src in parse(episodeList.data).getElementsByTagName('a').reversed)
MediaProv(
provider: 'gogo',
provId: '$gogo${src.attributes['href']?.trim()}',
title: '',
number: src.getElementsByClassName('name').first.nodes[1].text!.trim(),
call: () => gogoInfo('$gogo${src.attributes['href']?.trim()}'),
)
.then(
(value) => jsonDecode(value.data)['Sites']['Gogoanime'].keys.first,
);
final gogoPage = await Dio().get('${gogo}category/$msync');
print(gogoPage);
return [];
];
} catch (e) {
print(e);
return [];
}
}

Anime gogoInfo() async {
final iv = IV.fromUtf8("3134003223491201");
final episodeResponse = await Dio().get('$gogo/mahoutsukai-no-yome-season-2-episode-7');
final episode = parse(episodeResponse.data).body?.getElementsByClassName('active')[0].attributes['data-video'];
final videoResponse = await Dio().get(episode!);
final encryptedParams = Encrypted.fromBase64(videoResponse.data.split('data-value="')[1].split('"><')[0]);
final params = String.fromCharCodes(
AES(Key.fromUtf8('37911490979715163134003223491201'), mode: AESMode.cbc).decrypt(encryptedParams, iv: iv));
final encrypt = params.split('&')[0];
final updatedParams = params.replaceAll(
'$encrypt&',
'${AES(Key.fromUtf8('37911490979715163134003223491201'), mode: AESMode.cbc).encrypt(
Uint8List.fromList(encrypt.codeUnits),
iv: iv,
).base64}&',
);
final response = await Dio()
.get(
'https://playtaku.online/encrypt-ajax.php?id=$updatedParams&alias=$encrypt',
options: Options(
headers: {'referer': episode, 'host': 'playtaku.online', 'x-requested-with': 'XMLHttpRequest'},
),
)
.then((value) => jsonDecode(value.data)['data']);
final decryptedSources = AES(Key.fromUtf8('54674138327930866480207815084989'), mode: AESMode.cbc)
.decrypt(Encrypted.fromBase64(response), iv: iv);
final sources = jsonDecode(String.fromCharCodes(decryptedSources));

return Source(qualities: sources['source'][0]['file'], subtitles: {});
Anime gogoInfo(final String id) async {
try {
final iv = IV.fromUtf8("3134003223491201");
final inst = AES(Key.fromUtf8('37911490979715163134003223491201'), mode: AESMode.cbc);
final episodeResponse = await Dio().get(id);
final episode = parse(episodeResponse.data).body?.getElementsByClassName('active')[0].attributes['data-video'];
final videoResponse = await Dio().get(episode!);
final encryptedParams = Encrypted.fromBase64(videoResponse.data.split('data-value="')[1].split('"><')[0]);
final params = String.fromCharCodes(inst.decrypt(encryptedParams, iv: iv));
final encrypt = params.split('&')[0];
final updatedParams = params.replaceFirst(
'$encrypt&',
'${inst.encrypt(
Uint8List.fromList(encrypt.codeUnits),
iv: iv,
).base64}&',
);
final response = await Dio()
.get(
'https://playtaku.online/encrypt-ajax.php?id=$updatedParams&alias=$encrypt',
options: Options(
headers: {'referer': episode, 'host': 'playtaku.online', 'x-requested-with': 'XMLHttpRequest'},
),
)
.then((value) => jsonDecode(value.data)['data']);
final decryptedSources = AES(Key.fromUtf8('54674138327930866480207815084989'), mode: AESMode.cbc)
.decrypt(Encrypted.fromBase64(response), iv: iv);
final sources = jsonDecode(String.fromCharCodes(decryptedSources));
return Source(qualities: {'default': sources['source'][0]['file']}, subtitles: {});
} catch (_, stack) {
print(stack);
return const Source(qualities: {}, subtitles: {});
}
}
27 changes: 13 additions & 14 deletions lib/media/providers/anime/aniwatch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:html/parser.dart';
import 'package:key/key.dart';
import 'package:tokuwari_models/info_models.dart';

const String zoro = "https://aniwatch.to/";
const String zoro = "https://hianime.to/";
const String mega = 'https://megacloud.tv/embed-2/ajax/e-1/getSources?id=';
int retries = 0;

Expand Down Expand Up @@ -42,20 +42,18 @@ Provider zoroList(final AniData data) async {

Anime zoroInfo(final id) async {
final Options options = Options(responseType: ResponseType.plain);
final String sId = await Dio()
.get(
'${zoro}ajax/v2/episode/servers?episodeId=$id',
options: options,
)
.then(
(value) => parse(jsonDecode(value.data)['html'])
.getElementsByClassName("item server-item")
.firstWhere(
(element) => element.text.contains('Vid'),
)
.attributes['data-id']!,
);
try {
final String sId = await Dio()
.get(
'${zoro}ajax/v2/episode/servers?episodeId=$id',
options: options,
)
.then(
(value) => parse(jsonDecode(value.data)['html'])
.getElementsByClassName("item server-item")
.first
.attributes['data-id']!,
);
final String link = await Dio()
.get(
'${zoro}ajax/v2/episode/sources?id=$sId',
Expand Down Expand Up @@ -94,6 +92,7 @@ Anime zoroInfo(final id) async {
retries++;
return await zoroInfo(id);
} else {
print(_);
return const Source(qualities: {}, subtitles: {});
}
}
Expand Down
69 changes: 34 additions & 35 deletions lib/pages/media_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ query (\$page: Int!, \$type: MediaType, \$tag: String, \$search: String, \$genre
total
currentPage
},
media(sort: [TRENDING_DESC], type: \$type, search: \$search, genre_in: \$genre, tag: \$tag) {
media(sort: [TRENDING_DESC], type: \$type, search: \$search, genre_in: \$genre, tag: \$tag, isAdult: false) {
id
title {
romaji
Expand Down Expand Up @@ -143,8 +143,9 @@ class AniPageState extends State<AniPage> {
},
),
);
loading = false;
setState(() {});
setState(() {
loading = false;
});
} catch (e) {
animeData.addAll([]);
}
Expand Down Expand Up @@ -236,42 +237,40 @@ class AniPageState extends State<AniPage> {
await queryData();
},
),
child: CustomScrollView(
slivers: [
SliverToBoxAdapter(
child: Center(
child: SearchButton(
text: "Anilist",
controller: textController,
search: () async {
await searchData();
},
),
child: SafeArea(
child: CustomScrollView(
slivers: [
SearchButton(
text: "Anilist",
controller: textController,
search: () async {
await searchData();
},
),
),
SliverToBoxAdapter(
child: Wrap(
alignment: WrapAlignment.spaceAround,
children: [
TextButton(
onPressed: () => updateGenre(),
child: const Text(
"Filter by genre",
SliverToBoxAdapter(
child: Wrap(
alignment: WrapAlignment.spaceAround,
children: [
TextButton(
onPressed: () => updateGenre(),
child: const Text(
"Filter by genre",
),
),
),
],
],
),
),
),
(animeData.isNotEmpty)
? Grid(
data: animeData,
)
: const SliverToBoxAdapter(
child: Center(
child: CircularProgressIndicator(),
(animeData.isNotEmpty)
? Grid(
data: animeData,
)
: const SliverToBoxAdapter(
child: Center(
child: CircularProgressIndicator(),
),
),
),
],
],
),
),
),
);
Expand Down
12 changes: 4 additions & 8 deletions lib/pages/novel_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,10 @@ class NovelPageState extends State<NovelPage> {
: SafeArea(
child: CustomScrollView(
slivers: [
SliverToBoxAdapter(
child: Center(
child: SearchButton(
text: 'Novels',
controller: SearchController(),
search: () {},
),
),
SearchButton(
text: 'Novels',
controller: SearchController(),
search: () {},
),
SliverToBoxAdapter(
child: Wrap(
Expand Down
9 changes: 8 additions & 1 deletion lib/pages/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ class Settings extends StatefulWidget {
class SettingsState extends State<Settings> {
@override
Widget build(context) {
return const Scaffold();
return const Scaffold(
body: Column(
children: [
BackButton(),
Placeholder(),
],
),
);
}
}
Loading

0 comments on commit 97fc260

Please sign in to comment.