Sleazy Fork is available in English.

ExHentai.org自动登录

看本子更简单一点。

  1. // ==UserScript==
  2. // @name ExHentai.org自动登录
  3. // @namespace http://TouHou.DieMoe.net/
  4. // @version 0.3
  5. // @description 看本子更简单一点。
  6. // @author DieMoe
  7. // @run-at document-start
  8. // @include *://*.exhentai.org/*
  9. // @include *://exhentai.org/*
  10. // @grant unsafeWindow
  11. // @compatible firefox
  12. // @compatible chrome
  13. // @compatible edge
  14. // ==/UserScript==
  15.  
  16. (function() {
  17. 'use strict';
  18. var igneous,ipb_member_id,ipb_pass_hash,sl;
  19. igneous='322abe39d';
  20. ipb_member_id='3512590';
  21. ipb_pass_hash='cfb712ea2633f9894c5dae23146f78d0';
  22. sl='dm_1';
  23. if (location.host == 'exhentai.org' && document.cookie.split(';') .length < 2) {
  24. alert('您尚未登录私有账号,脚本将自动登录一个公共账号。');
  25. autoCookie();
  26. window.location = '';
  27. }else{
  28. igneous=getCookie('igneous');
  29. ipb_member_id=getCookie('ipb_member_id');
  30. ipb_pass_hash=getCookie('ipb_pass_hash');
  31. sl=getCookie('sl');
  32. autoCookie();
  33. }
  34.  
  35. function setCookie(c_name,value,expiredays){
  36. var exdate=new Date();
  37. exdate.setDate(exdate.getDate()+expiredays);
  38. document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : "; expires="+exdate.toGMTString());
  39. }
  40.  
  41. function getCookie(c_name)
  42. {
  43. if (document.cookie.length>0){
  44. var c_start=document.cookie.indexOf(c_name + "=");
  45. if (c_start!=-1) {
  46. c_start=c_start + c_name.length+1;
  47. var c_end=document.cookie.indexOf(";",c_start);
  48. if (c_end==-1) c_end=document.cookie.length;
  49. return unescape(document.cookie.substring(c_start,c_end));
  50. }
  51. }
  52. return "";
  53. }
  54. function autoCookie(){
  55. setCookie('igneous',igneous,365);
  56. setCookie('ipb_member_id',ipb_member_id,365);
  57. setCookie('ipb_pass_hash',ipb_pass_hash,365);
  58. setCookie('sl',sl,365);
  59. }
  60. })();