MissAVAutomatische Anmeldung

ErkennungMisssAVZustand,und melden Sie sich automatisch an, wenn Sie nicht angemeldet sind

Version vom 30.08.2024. Aktuellste Version

  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.6
  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. const translate = (function () {
  90. const userLang = (navigator.languages && navigator.languages[0]) || navigator.language || 'en'
  91. const strings = {
  92. 'en': {
  93. Accountnull: 'Error: UserEmail or UserPassword is empty.',
  94. loginSuccess: 'Login successful, refreshing the page.',
  95. Networkfailed: 'Status code error.',
  96. Loginfailed: 'Login failed, incorrect email or password. Check console for error details.',
  97. },
  98. 'zh-CN': {
  99. Accountnull: '邮箱或密码为空',
  100. loginSuccess: '登录成功,即将刷新页面。',
  101. Networkfailed: '状态码错误',
  102. Loginfailed: '登录失败,邮箱或密码错误,可以在控制台查看错误信息。',
  103. },
  104. 'zh-TW': {
  105. Accountnull: '郵箱或密碼為空',
  106. loginSuccess: '登錄成功,即將刷新頁面。',
  107. Networkfailed: '狀態碼錯誤',
  108. Loginfailed: '登錄失敗,郵箱或密碼錯誤,可以在控制台查看錯誤信息。',
  109. },
  110. 'ja': {
  111. Accountnull: 'エラー:メールアドレスまたはパスワードが空です。',
  112. loginSuccess: 'ログイン成功、ページを更新します。',
  113. Networkfailed: 'ステータスコードエラー',
  114. Loginfailed: 'ログインに失敗しました。メールアドレスまたはパスワードが間違っています。エラーの詳細はコンソールで確認できます。',
  115. },
  116. 'vi': {
  117. Accountnull: 'Lỗi: Email hoặc mật khẩu trống.',
  118. loginSuccess: 'Đăng nhập thành công, đang làm mới trang.',
  119. Networkfailed: 'Lỗi mã trạng thái.',
  120. 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.',
  121. }
  122. }
  123.  
  124. return (id, lang = '') => {
  125. const selectedLang = lang || userLang
  126. return (strings[selectedLang] || strings.en)[id] || strings.en[id]
  127. }
  128. }());
  129. (function () {
  130. 'use strict'
  131. let UserEmail = GM_getValue("UserEmail", "")
  132. let UserPassword = GM_getValue("UserPassword", "")
  133. var style = document.createElement('style')
  134. GM_registerMenuCommand("Set Account", showuserInfoModal)
  135. function showuserInfoModal() {
  136. let modalHtml = `
  137. <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;">
  138. <h2 style="margin-top: 0;">Set Account </h2>
  139. <div style="margin-bottom: 10px;">
  140. <label for="UserEmail" style="display: block; margin-bottom: 5px;">UserEmail:</label>
  141. <input id="UserEmail" style="width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px;" value="${UserEmail}" />
  142. </div>
  143. <div style="margin-bottom: 20px;">
  144. <label for="UserPassword" style="display: block; margin-bottom: 5px;">UserPassword:</label>
  145. <input id="UserPassword" style="width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px;" value="${UserPassword}" />
  146. </div>
  147. <div style="text-align: right;">
  148. <button id="saveUserInfo" style="background-color: #4CAF50; color: white; padding: 10px 20px; border: none; border-radius: 4px; cursor: pointer;">Save</button>
  149. <button id="closeUserModal" style="background-color: #f44336; color: white; padding: 10px 20px; border: none; border-radius: 4px; cursor: pointer; margin-left: 10px;">Close</button>
  150. </div>
  151. </div>`
  152. let modalDiv = document.createElement('div')
  153. modalDiv.innerHTML = modalHtml
  154. document.body.appendChild(modalDiv)
  155. document.getElementById("saveUserInfo").addEventListener("click", function () {
  156. UserEmail = document.getElementById("UserEmail").value
  157. UserPassword = document.getElementById("UserPassword").value
  158. GM_setValue("UserEmail", UserEmail)
  159. GM_setValue("UserPassword", UserPassword)
  160. closeUserModal()
  161. })
  162. document.getElementById("closeUserModal").addEventListener("click", closeUserModal)
  163. }
  164. function closeUserModal() {
  165. let modal = document.getElementById("userInfoModal")
  166. if (modal) {
  167. modal.remove()
  168. }
  169. }
  170. function login(email, password) {
  171. if (!email || !password) {
  172. Toast(translate('Accountnull'), 2000, '#FF0000', '#ffffff', 'top')
  173. return
  174. }
  175. fetch('https://missav.com/cn/api/login', {
  176. method: 'POST',
  177. headers: {
  178. 'Content-Type': 'application/json',
  179. },
  180. body: JSON.stringify({
  181. email: email,
  182. password: password,
  183. remember: true,
  184. }),
  185. })
  186. .then(response => {
  187. if (!response.ok) {
  188. return response.text().then(text => {
  189. console.error('Login error:', {
  190. status: response.status,
  191. statusText: response.statusText,
  192. responseText: text,
  193. })
  194. Toast('Login failed: ' + text, 2000, '#FF0000', '#ffffff', 'top')
  195. throw new Error(translate('Networkfailed'))
  196. })
  197. }
  198. if (response.headers.get('Content-Type')?.includes('application/json')) {
  199. return response.json()
  200. } else {
  201. return response.text().then(text => {
  202. console.error(translate('Loginfailed'), {
  203. status: response.status,
  204. statusText: response.statusText,
  205. responseText: text,
  206. })
  207. Toast(translate('Loginfailed'), 2000, '#FF0000', '#ffffff', 'top')
  208. throw new Error(translate('Loginfailed'))
  209. })
  210. }
  211. })
  212. .then(data => {
  213. console.log('Success:', data)
  214. Toast(translate('loginSuccess'), 2000, 'rgb(18, 187, 2)', '#ffffff', 'top')
  215. location.reload()
  216. })
  217. .catch(error => {
  218. Toast('An error occurred: ' + error.message, 2000, '#FF0000', '#ffffff', 'top')
  219. })
  220. }
  221. function check() {
  222. const url = 'https://missav.com/api/actresses/1016525/view'
  223. fetch(url, {
  224. method: 'GET'
  225. })
  226. .then(response => {
  227. if (response.ok) {
  228. return response.json()
  229. } else {
  230. throw new Error('Network response was not ok.')
  231. }
  232. })
  233. .then(data => {
  234. if (data) {
  235. if (data.user === null) {
  236. login(UserEmail, UserPassword)
  237. } else {
  238. // 已经登录
  239. }
  240. }
  241. })
  242. .catch(error => console.error('Error:', error))
  243. }
  244. check()
  245. })()