Skip to content

Commit

Permalink
Fix cookie key name
Browse files Browse the repository at this point in the history
  • Loading branch information
TaYaKi71751 committed Dec 20, 2023
1 parent a6714a2 commit f1396cd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions lib/component/eh/eh_bookmark.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import 'dart:collection';

import 'package:violet/component/eh/eh_headers.dart';
import 'package:violet/log/log.dart';

class EHBookmark {
static List<HashSet<int>>? bookmarkInfo;
Expand All @@ -12,15 +13,16 @@ class EHBookmark {
// https://exhentai.org/favorites.php?page=0&favcat=0

var result = <HashSet<int>>[];
var rr = RegExp(r'https://exhentai\.org/g/\d+/');
var r2 = RegExp(r'https://e\-hentai\.org/g/\d+/');
var rr = RegExp(r'https://exhentai\.org/g/\d+/a-zA-Z0-9+');
var r2 = RegExp(r'https://e\-hentai\.org/g/\d+/a-zA-Z0-9+');

for (int i = 0; i < 10; i++) {
var hh = HashSet<int>();
try {
for (int j = 0; j < 1000; j++) {
var html = await EHSession.requestString(
'https://exhentai.org/favorites.php?page=$j&favcat=$i');
Logger.info(html);
var matched = rr.allMatches(html).map((e) => e.group(0));
if (matched.isEmpty) break;
for (var element in matched) {
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/settings/login/ehentai_login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class _LoginScreenState extends State<LoginScreen> {
developer.log('Get cookies: $cookies');

if (cookies.containsKey('ipb_member_id') &&
cookies.containsKey('igneous') &&
cookies.containsKey('sk') &&
cookies.containsKey('ipb_pass_hash')) {
// await sessionStore.setSession(cookieString);
// await _cookieManager.clearCookies();
Expand Down
6 changes: 3 additions & 3 deletions lib/pages/settings/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2269,7 +2269,7 @@ class _SettingsPageState extends State<SettingsPage>

var iController = TextEditingController(
text:
cookie != null ? parseCookies(cookie)['igneous'] : '');
cookie != null ? parseCookies(cookie)['sk'] : '');
var imiController = TextEditingController(
text: cookie != null
? parseCookies(cookie)['ipb_member_id']
Expand Down Expand Up @@ -2304,7 +2304,7 @@ class _SettingsPageState extends State<SettingsPage>
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Row(children: [
const Text('igneous: '),
const Text('sk: '),
Expanded(
child: TextField(
controller: iController,
Expand Down Expand Up @@ -2334,7 +2334,7 @@ class _SettingsPageState extends State<SettingsPage>

if (dialog != null && dialog == true) {
var ck =
'igneous=${iController.text};ipb_member_id=${imiController.text};ipb_pass_hash=${iphController.text};';
'sk=${iController.text};ipb_member_id=${imiController.text};ipb_pass_hash=${iphController.text};';
await prefs.setString('eh_cookies', ck);
}
}
Expand Down

0 comments on commit f1396cd

Please sign in to comment.