MissAVMasuk otomatis

DeteksiMisssAVnegara,dan secara otomatis login ketika tidak login

Pada tanggal 31 Agustus 2024. Lihat %(latest_version_link).

  1. // ==UserScript==
  2. // @name MissAVAutomatic login
  3. // @description DetectionMisssAVstate,and automatically log in when not logged in
  4. // @name:ar MissAVتسجيل الدخول التلقائي
  5. // @description:ar كشفMisssAVولاية,وتسجيل الدخول تلقائيًا في حالة عدم تسجيل الدخول
  6. // @name:bg MissAVАвтоматично влизане
  7. // @description:bg ОткриванеMisssAVсъстояние,и автоматично влизане, когато не сте влезли
  8. // @name:cs MissAVAutomatické přihlášení
  9. // @description:cs DetekceMisssAVstát,a automaticky se přihlásit, když nejste přihlášeni
  10. // @name:da MissAVAutomatisk login
  11. // @description:da OpdagelseMisssAVtilstand,og logger automatisk på, når du ikke er logget ind
  12. // @name:de MissAVAutomatische Anmeldung
  13. // @description:de ErkennungMisssAVZustand,und melden Sie sich automatisch an, wenn Sie nicht angemeldet sind
  14. // @name:el MissAVΑυτόματη σύνδεση
  15. // @description:el ΑνίχνευσηMisssAVκατάσταση,και αυτόματα συνδέεστε όταν δεν είστε συνδεδεμένοι
  16. // @name:en MissAVAutomatic login
  17. // @description:en DetectionMisssAVstate,and automatically log in when not logged in
  18. // @name:eo MissAVAŭtomata ensaluto
  19. // @description:eo DetektoMisssAVstato,kaj aŭtomate ensalutu kiam ne ensalutinta
  20. // @name:es MissAVInicio de sesión automático
  21. // @description:es DetecciónMisssAVestado,e iniciar sesión automáticamente cuando no haya iniciado sesión
  22. // @name:fi MissAVAutomaattinen sisäänkirjautuminen
  23. // @description:fi HavaitseminenMisssAVosavaltio,ja kirjaudu sisään automaattisesti, kun et ole kirjautunut sisään
  24. // @name:fr MissAVConnexion automatique
  25. // @description:fr DétectionMisssAVÉtat,et connectez-vous automatiquement lorsque vous n’êtes pas connecté
  26. // @name:he MissAVכניסה אוטומטית
  27. // @description:he איתורMisssAVמְדִינָה,והתחבר אוטומטית כאשר לא מחובר
  28. // @name:hr MissAVAutomatska prijava
  29. // @description:hr OtkrivanjeMisssAVstanje,i automatski se prijavite kada niste prijavljeni
  30. // @name:hu MissAVAutomatikus bejelentkezés
  31. // @description:hu ÉrzékelésMisssAVállami,és automatikusan bejelentkezik, ha nincs bejelentkezve
  32. // @name:id MissAVMasuk otomatis
  33. // @description:id DeteksiMisssAVnegara,dan secara otomatis login ketika tidak login
  34. // @name:it MissAVAccesso automatico
  35. // @description:it RilevamentoMisssAVstato,e accedi automaticamente quando non sei loggato
  36. // @name:ja MissAV自動ログイン
  37. // @description:ja 検出MisssAV州,ログインしていない場合は自動的にログインします
  38. // @name:ka MissAVავტომატური შესვლა
  39. // @description:ka გამოვლენაMisssAVსახელმწიფო,და ავტომატურად შედით სისტემაში, როდესაც არ ხართ შესული
  40. // @name:ko MissAV자동 로그인
  41. // @description:ko 발각MisssAV상태,로그인하지 않으면 자동으로 로그인됩니다.
  42. // @name:nl MissAVAutomatisch inloggen
  43. // @description:nl DetectieMisssAVstaat,en automatisch inloggen als je niet ingelogd bent
  44. // @name:nb MissAVAutomatisk pålogging
  45. // @description:nb OppdagelseMisssAVtilstand,og logger automatisk på når du ikke er pålogget
  46. // @name:pl MissAVAutomatyczne logowanie
  47. // @description:pl WykrywanieMisssAVpaństwo,i automatycznie loguj się, gdy nie jesteś zalogowany
  48. // @name:pt-BR MissAVLogin automático
  49. // @description:pt-BR DetecçãoMisssAVestado,e faça login automaticamente quando não estiver conectado
  50. // @name:ro MissAVConectare automată
  51. // @description:ro DetectareMisssAVstat,și conectați-vă automat când nu sunteți autentificat
  52. // @name:ru MissAVАвтоматический вход
  53. // @description:ru ОбнаружениеMisssAVсостояние,и автоматически входить в систему, когда вы не вошли в систему
  54. // @name:sk MissAVAutomatické prihlásenie
  55. // @description:sk DetekciaMisssAVštátu,a automaticky sa prihlásiť, keď nie ste prihlásení
  56. // @name:sr MissAVАутоматско пријављивање
  57. // @description:sr ДетецтионMisssAVдржава,и аутоматски се пријављује када нисте пријављени
  58. // @name:sv MissAVAutomatisk inloggning
  59. // @description:sv UpptäcktMisssAVange,och logga in automatiskt när du inte är inloggad
  60. // @name:th MissAVเข้าสู่ระบบอัตโนมัติ
  61. // @description:th การตรวจจับMisssAVสถานะ,และเข้าสู่ระบบอัตโนมัติเมื่อไม่ได้เข้าสู่ระบบ
  62. // @name:tr MissAVOtomatik giriş
  63. // @description:tr AlgılamaMisssAVdurum,ve oturum açmadığınızda otomatik olarak oturum açın
  64. // @name:ug MissAVئاپتوماتىك كىرىش
  65. // @description:ug بايقاشMisssAVئىشتات,ھەمدە كىرمىگەندە ئاپتوماتىك كىرىدۇ
  66. // @name:uk MissAVАвтоматичний вхід
  67. // @description:uk виявленняMisssAVстан,і автоматично ввійти, якщо ви не ввійшли
  68. // @name:vi MissAVĐăng nhập tự động
  69. // @description:vi Phát hiệnMisssAVtình trạng,và tự động đăng nhập khi chưa đăng nhập
  70. // @name:zh-CN MissAV自动登录
  71. // @description:zh-CN 检测MisssAV状态,并且在未登录时自动登录
  72. // @name:zh-TW MissAV自動登入
  73. // @description:zh-TW 偵測MisssAV狀態,並且在未登入時自動登入
  74. // @name:ja MissAV自動ログイン
  75. // @description:ja MissAVの状態を検出し、未ログインの場合に自動でログインします
  76. // @namespace https://github.com/ChinaGodMan/UserScripts
  77. // @author 人民的勤务员 <toniaiwanowskiskr47@gmail.com>
  78. // @match https://missav.com/*
  79. // @grant GM_registerMenuCommand
  80. // @grant GM_setValue
  81. // @grant GM_getValue
  82. // @version 1.0.0.91
  83. // @require https://update.greasyfork.org/scripts/498897/1404834/Toastnew.js
  84. // @icon https://pic.616pic.com/ys_bnew_img/00/35/79/Gv93yQh7v6.jpg
  85. // @supportURL https://github.com/ChinaGodMan/UserScripts/issues
  86. // @homepageURL https://github.com/ChinaGodMan/UserScripts
  87. // @license MIT
  88. // ==/UserScript==
  89.  
  90. const translate = (function () {
  91. const userLang = (navigator.languages && navigator.languages[0]) || navigator.language || 'en'
  92. const strings = {
  93. 'en': {
  94. Accountnull: 'Error: UserEmail or UserPassword is empty.',
  95. loginSuccess: 'Login successful, refreshing the page.',
  96. Networkfailed: 'Status code error.',
  97. Loginfailed: 'Login failed, incorrect email or password. Check console for error details.',
  98. },
  99. 'zh-CN': {
  100. Accountnull: '邮箱或密码为空',
  101. loginSuccess: '登录成功,即将刷新页面。',
  102. Networkfailed: '状态码错误',
  103. Loginfailed: '登录失败,邮箱或密码错误,可以在控制台查看错误信息。',
  104. },
  105. 'zh-TW': {
  106. Accountnull: '郵箱或密碼為空',
  107. loginSuccess: '登錄成功,即將刷新頁面。',
  108. Networkfailed: '狀態碼錯誤',
  109. Loginfailed: '登錄失敗,郵箱或密碼錯誤,可以在控制台查看錯誤信息。',
  110. },
  111. 'ja': {
  112. Accountnull: 'エラー:メールアドレスまたはパスワードが空です。',
  113. loginSuccess: 'ログイン成功、ページを更新します。',
  114. Networkfailed: 'ステータスコードエラー',
  115. Loginfailed: 'ログインに失敗しました。メールアドレスまたはパスワードが間違っています。エラーの詳細はコンソールで確認できます。',
  116. },
  117. 'vi': {
  118. Accountnull: 'Lỗi: Email hoặc mật khẩu trống.',
  119. loginSuccess: 'Đăng nhập thành công, đang làm mới trang.',
  120. Networkfailed: 'Lỗi mã trạng thái.',
  121. Loginfailed: 'Đăng nhập không thành công, email hoặc mật khẩu không chính xác. Xem chi tiết lỗi trên bảng điều khiển.',
  122. }
  123. }
  124.  
  125. return (id, lang = '') => {
  126. const selectedLang = lang || userLang
  127. return (strings[selectedLang] || strings.en)[id] || strings.en[id]
  128. }
  129. }());
  130. (function () {
  131. 'use strict'
  132. let UserEmail = GM_getValue("UserEmail", "")
  133. let UserPassword = GM_getValue("UserPassword", "")
  134. var style = document.createElement('style')
  135. GM_registerMenuCommand("Set Account", showuserInfoModal)
  136. function showuserInfoModal() {
  137. let modalHtml = `
  138. <div id="userInfoModal" style="position: fixed; z-index: 10000; background: white; padding: 20px; border-radius: 8px; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5); top: 20%; left: 50%; transform: translate(-50%, -20%); max-width: 300px;">
  139. <h2 style="margin-top: 0;">Set Account </h2>
  140. <div style="margin-bottom: 10px;">
  141. <label for="UserEmail" style="display: block; margin-bottom: 5px;">UserEmail:</label>
  142. <input id="UserEmail" style="width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px;" value="${UserEmail}" />
  143. </div>
  144. <div style="margin-bottom: 20px;">
  145. <label for="UserPassword" style="display: block; margin-bottom: 5px;">UserPassword:</label>
  146. <input id="UserPassword" style="width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px;" value="${UserPassword}" />
  147. </div>
  148. <div style="text-align: right;">
  149. <button id="saveUserInfo" style="background-color: #4CAF50; color: white; padding: 10px 20px; border: none; border-radius: 4px; cursor: pointer;">Save</button>
  150. <button id="closeUserModal" style="background-color: #f44336; color: white; padding: 10px 20px; border: none; border-radius: 4px; cursor: pointer; margin-left: 10px;">Close</button>
  151. </div>
  152. </div>`
  153. let modalDiv = document.createElement('div')
  154. modalDiv.innerHTML = modalHtml
  155. document.body.appendChild(modalDiv)
  156. document.getElementById("saveUserInfo").addEventListener("click", function () {
  157. UserEmail = document.getElementById("UserEmail").value
  158. UserPassword = document.getElementById("UserPassword").value
  159. GM_setValue("UserEmail", UserEmail)
  160. GM_setValue("UserPassword", UserPassword)
  161. closeUserModal()
  162. })
  163. document.getElementById("closeUserModal").addEventListener("click", closeUserModal)
  164. }
  165. function closeUserModal() {
  166. let modal = document.getElementById("userInfoModal")
  167. if (modal) {
  168. modal.remove()
  169. }
  170. }
  171. function login(email, password) {
  172. if (!email || !password) {
  173. Toast(translate('Accountnull'), 2000, '#FF0000', '#ffffff', 'top')
  174. return
  175. }
  176. fetch('https://missav.com/cn/api/login', {
  177. method: 'POST',
  178. headers: {
  179. 'Content-Type': 'application/json',
  180. },
  181. body: JSON.stringify({
  182. email: email,
  183. password: password,
  184. remember: true,
  185. }),
  186. })
  187. .then(response => {
  188. if (!response.ok) {
  189. return response.text().then(text => {
  190. console.error('Login error:', {
  191. status: response.status,
  192. statusText: response.statusText,
  193. responseText: text,
  194. })
  195. Toast('Login failed: ' + text, 2000, '#FF0000', '#ffffff', 'top')
  196. throw new Error(translate('Networkfailed'))
  197. })
  198. }
  199. if (response.headers.get('Content-Type')?.includes('application/json')) {
  200. return response.json()
  201. } else {
  202. return response.text().then(text => {
  203. console.error(translate('Loginfailed'), {
  204. status: response.status,
  205. statusText: response.statusText,
  206. responseText: text,
  207. })
  208. Toast(translate('Loginfailed'), 2000, '#FF0000', '#ffffff', 'top')
  209. throw new Error(translate('Loginfailed'))
  210. })
  211. }
  212. })
  213. .then(data => {
  214. console.log('Success:', data)
  215. Toast(translate('loginSuccess'), 2000, 'rgb(18, 187, 2)', '#ffffff', 'top')
  216. location.reload()
  217. })
  218. .catch(error => {
  219. Toast('An error occurred: ' + error.message, 2000, '#FF0000', '#ffffff', 'top')
  220. })
  221. }
  222. function check() {
  223. const url = 'https://missav.com/api/actresses/1016525/view'
  224. fetch(url, {
  225. method: 'GET'
  226. })
  227. .then(response => {
  228. if (response.ok) {
  229. return response.json()
  230. } else {
  231. throw new Error('Network response was not ok.')
  232. }
  233. })
  234. .then(data => {
  235. if (data) {
  236. if (data.user === null) {
  237. login(UserEmail, UserPassword)
  238. } else {
  239. // 已经登录
  240. }
  241. }
  242. })
  243. .catch(error => console.error('Error:', error))
  244. }
  245. check()
  246. })()