MissAVכניסה אוטומטית

איתורMisssAVמְדִינָה,והתחבר אוטומטית כאשר לא מחובר

נכון ליום 30-08-2024. ראה הגרסה האחרונה.

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