├── myIcon.ico ├── config.yaml ├── Export.py ├── .github └── FUNDING.yml ├── VersionManager.py ├── main.spec ├── IMAP.py ├── README.md ├── Logger.py ├── README.EN.md ├── main.py ├── Webdriver.py ├── .gitignore ├── Config.py ├── I18n.py ├── Handler.py └── LICENSE.md /myIcon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yudaotor/Riot-Accounts-AutoChangePassword/HEAD/myIcon.ico -------------------------------------------------------------------------------- /config.yaml: -------------------------------------------------------------------------------- 1 | language: "zh_CN或者en_US或者zh_TW" 2 | newPassword: "新密码" 3 | accountFilePath: "账号密码文件路径" 4 | accountDelimiter: "----" 5 | browser: "chrome" 6 | # 更多配置请参考github中readme文件(For more configuration, please refer to the github readme file) 7 | # 请我喝杯咖啡吧~ https://github.com/Yudaotor 8 | -------------------------------------------------------------------------------- /Export.py: -------------------------------------------------------------------------------- 1 | import time 2 | from traceback import print_exc 3 | 4 | 5 | class Export: 6 | def __init__(self, delimiter): 7 | self.delimiter = delimiter 8 | 9 | def write_success_acc(self, username, password, email_verify=""): 10 | try: 11 | with open('./newAccounts/' + email_verify + time.strftime("%Y%m%d-") + 'accounts.txt', 'a', encoding="utf-8") as f: 12 | f.write(f"{username}{self.delimiter}{password}\n") 13 | except Exception: 14 | print_exc() 15 | 16 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: https://www.cdnjson.com/images/2023/03/13/image-merge-1678713037835.png 14 | -------------------------------------------------------------------------------- /VersionManager.py: -------------------------------------------------------------------------------- 1 | import requests as req 2 | 3 | 4 | class VersionManager: 5 | 6 | @staticmethod 7 | def getLatestTag(): 8 | """ 9 | Get the latest tag number from the GitHub repository. 10 | 11 | Returns: 12 | float: The latest tag number. If the fetch fails, 0.0 is returned. 13 | """ 14 | try: 15 | latestTagResponse = req.get("https://api.github.com/repos/Yudaotor/Riot-Accounts-AutoChangePassword/releases/latest") 16 | if 'application/json' in latestTagResponse.headers.get('Content-Type', ''): 17 | latestTagJson = latestTagResponse.json() 18 | if "tag_name" in latestTagJson: 19 | return float(latestTagJson["tag_name"][1:]) 20 | return 0.0 21 | except Exception as ex: 22 | print(ex) 23 | return 0.0 24 | 25 | @staticmethod 26 | def isLatestVersion(currentVersion): 27 | return currentVersion >= VersionManager.getLatestTag() 28 | 29 | -------------------------------------------------------------------------------- /main.spec: -------------------------------------------------------------------------------- 1 | # -*- mode: python ; coding: utf-8 -*- 2 | 3 | 4 | block_cipher = None 5 | 6 | 7 | a = Analysis( 8 | ['main.py', 9 | 'Logger.py', 10 | 'Config.py', 11 | 'Handler.py', 12 | 'Export.py', 13 | 'IMAP.py', 14 | 'VersionManager.py', 15 | 'Webdriver.py' 16 | ], 17 | pathex=['C:\\Users\\Khalil\\Desktop\\xiaohao'], 18 | binaries=[], 19 | datas=[], 20 | hiddenimports=['selenium','pyyaml','rich','time','pathlib','logging','sys','argparse'], 21 | hookspath=[], 22 | hooksconfig={}, 23 | runtime_hooks=[], 24 | excludes=[], 25 | win_no_prefer_redirects=False, 26 | win_private_assemblies=False, 27 | cipher=block_cipher, 28 | noarchive=False, 29 | ) 30 | pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) 31 | 32 | exe = EXE( 33 | pyz, 34 | a.scripts, 35 | a.binaries, 36 | a.zipfiles, 37 | a.datas, 38 | [], 39 | name='拳头自动修改密码v2.3', 40 | debug=False, 41 | bootloader_ignore_signals=False, 42 | strip=False, 43 | upx=True, 44 | upx_exclude=[], 45 | runtime_tmpdir=None, 46 | console=True, 47 | disable_windowed_traceback=False, 48 | argv_emulation=False, 49 | target_arch=None, 50 | codesign_identity=None, 51 | entitlements_file=None, 52 | icon='C:\\Users\\Khalil\\Desktop\\xiaohao\\myIcon.ico' 53 | ) -------------------------------------------------------------------------------- /IMAP.py: -------------------------------------------------------------------------------- 1 | import email 2 | from traceback import print_exc 3 | import re 4 | import imaplib 5 | from Logger import log 6 | from Config import config 7 | 8 | 9 | def set_id(conn, username): 10 | """ 11 | Sets the ID for the IMAP connection. 12 | 13 | Args: 14 | conn (imaplib.IMAP4): The IMAP connection object. 15 | username (str): The username for the ID. 16 | 17 | Returns: 18 | None 19 | """ 20 | imaplib.Commands['ID'] = 'AUTH' 21 | args = ("name", username.split("@")[0], "contact", username, "version", "1.0.0", "vendor", username.split("@")[0] + "Client") 22 | conn._simple_command('ID', '("' + '" "'.join(args) + '")') 23 | 24 | 25 | def fetch_code(self): 26 | """ 27 | Fetches the verification code from the latest email. 28 | 29 | Returns: 30 | None 31 | """ 32 | try: 33 | status, info = self.M.uid('search', None, 'ALL') 34 | if status == "OK": 35 | status, info = self.M.uid('fetch', info[0].split()[-1], '(RFC822)') 36 | if status == "OK": 37 | mail = email.message_from_bytes(info[0][1]) 38 | if mail['From'].find('noreply@mail.accounts.riotgames.com') > -1: 39 | self.code = re.findall(r'\d{6}', mail["Subject"])[0] 40 | except Exception: 41 | log.error("获取验证码失败", config.language) 42 | 43 | 44 | class IMAP(object): 45 | def __init__(self, conn, username): 46 | set_id(conn, username) 47 | conn.select("INBOX") 48 | self.M = conn 49 | self.code = "" 50 | fetch_code(self) 51 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 效果演示: 2 | tutieshi_640x360_41s.gif 3 | 4 | [English Version](https://github.com/Yudaotor/Riot-Accounts-AutoChangePassword/blob/master/README.EN.md)| 5 | [中文版本](https://github.com/Yudaotor/Riot-Accounts-AutoChangePassword/blob/master/README.md) 6 | # 本程序用于拳头账号自动修改密码(!使用强烈建议挂上VPN,不然加载速度很慢容易导致程序失败!) 7 | 使用过程中有遇到什么问题可以联系我 8 | telegram: https://t.me/Yudaotor 9 | discord: Khalil#7843 10 | 可以给我点个小星星吗(*^_^*)⭐ 11 | 12 | 13 | **下载方法**,请点击右方的release中下载最新版的exe文件使用. 14 | ## 使用须知: 15 | 16 | **2.4版开始支持简体中文,繁体中文,英语.修改config文件中的language即可.** 17 | 0. [已验证邮箱账号配置教程](https://github.com/Yudaotor/Riot-Accounts-AutoChangePassword/wiki/%E5%A6%82%E4%BD%95%E4%B8%BA%E9%AA%8C%E8%AF%81%E8%BF%87%E9%82%AE%E7%AE%B1%E7%9A%84%E8%B4%A6%E5%8F%B7%E8%87%AA%E5%8A%A8%E4%BF%AE%E6%94%B9%E5%AF%86%E7%A0%81(How-to-change-password-automatically-for-accounts-with-verified-emails))) 18 | 2. 本程序支持微软edge浏览器和chrome谷歌浏览器.(请务必使用最新版) 19 | 3. 需要进行修改密码的账号信息需要存储在txt文件中,具体格式为(分隔符可以在配置文件中自己修改): 20 | 213451231----351252312 21 | a21341----3512s5312 22 | 213s51231----35s125312 23 | 213451sd31----351sd52312 24 | 3. **使用前需要先配置好config.yaml文件** 25 | (需要注意!!!文件路径中要使用\\\而非\\) 26 | (配置路径时,账号信息文件后面记得加.txt) (有些人不需要加.txt扩展名,根据自己电脑来) 27 | (路径不要出现中文以及中文字符) 28 | (如果没有验证过邮箱的话就不用填写imap的配置信息) 29 | {如果邮件还没发到就已经识别,识别到了上一个邮件可以配置imapDalay: 秒数,来等待更久,默认为10秒} 30 | 例子: 31 | ![image](https://user-images.githubusercontent.com/87225219/226547604-963f0a56-e59a-4934-8cf3-6303eeeb93eb.png) 32 | 33 | 5. 程序执行后账号密码修改成功与否可以在log文件夹中查看. 34 | 6. 运行完毕成功修改的账密信息可在newAccounts文件夹中查看. 35 | 7. 有无验证过邮箱的账号都可以使用.有验证过的需要在配置文件中加入对应的邮箱IMAP信息 36 | ## 程序运行控制台显示截图: 37 | ![image](https://user-images.githubusercontent.com/87225219/225540315-faa5d20f-1fb5-45d2-915f-ba695ca8be2a.png) 38 | -------------------------------------------------------------------------------- /Logger.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import time 3 | from logging.handlers import RotatingFileHandler 4 | from pathlib import Path 5 | 6 | FILE_SIZE = 1024 * 1024 * 100 7 | BACKUP_COUNT = 5 8 | PROGRAM_NAME = "AutoChangePassword" 9 | GITHUB_ADDRESS = "https://github.com/Yudaotor/Riot-Accounts-AutoChangePassword" 10 | version = "2.7" 11 | 12 | 13 | class Logger: 14 | @staticmethod 15 | def createLogger(log_path=Path("./logs")): 16 | """ 17 | Create and return a logger instance 18 | Args: 19 | log_path (Path, optional): The path where the log file is saved. Defaults to Path("./logs/programs"). 20 | Returns: 21 | logging.Logger: Logger instance. 22 | """ 23 | log_path.mkdir(parents=True, exist_ok=True) 24 | level = logging.INFO 25 | file_handler = RotatingFileHandler( 26 | log_path / f"{PROGRAM_NAME}-{time.strftime('%b-%d-%H-%M')}.log", 27 | mode="a+", 28 | maxBytes=FILE_SIZE, 29 | backupCount=BACKUP_COUNT, 30 | encoding='utf-8' 31 | ) 32 | 33 | logging.basicConfig( 34 | format="%(asctime)s %(levelname)s: %(message)s", 35 | level=level, 36 | handlers=[file_handler], 37 | ) 38 | logg = logging.getLogger(PROGRAM_NAME) 39 | logg.info("-" * 50) 40 | logg.info(f"{'-' * 22} Program started {version} {'-' * 23}") 41 | logg.info(f"{'-' * 22} Open Source on github {'-' * 22}") 42 | logg.info(f"{'-' * 7} Address: {GITHUB_ADDRESS} {'-' * 6}") 43 | logg.info(f"{'-' * 16} Please give me a star,Thanks(*^_^*) {'-' * 15}") 44 | logg.info("-" * 50) 45 | logg.info(f"请我喝杯咖啡吧~https://github.com/Yudaotor") 46 | return logg 47 | 48 | 49 | log = Logger().createLogger() 50 | 51 | 52 | -------------------------------------------------------------------------------- /README.EN.md: -------------------------------------------------------------------------------- 1 | [English Version](https://github.com/Yudaotor/Riot-Accounts-AutoChangePassword/blob/master/README.EN.md)| 2 | [中文版本](https://github.com/Yudaotor/Riot-Accounts-AutoChangePassword/blob/master/README.md) 3 | # This program is used to automatically change the password for Riot 4 | You can contact me if you have any problems during using 5 | telegram: https://t.me/Yudaotor 6 | discord: Khalil#7843 7 | Can you give me a little star (*^_^*)⭐ 8 | ## Notes on use: 9 | ** Version 2.4 supports Simplified Chinese, Traditional Chinese and English. Modify the language in the config file. ** 10 | 11 | 0. [Verified email account configuration tutorial](https://github.com/Yudaotor/Riot-Accounts-AutoChangePassword/wiki/%E5%A6%82%E4%BD%95%E4%B8%BA%E9%AA%8C%E8%AF%81%E8%BF%87%E9%82%AE%E7%AE%B1%E7%9A%84%E8%B4%A6%E5%8F%B7%E8%87%AA%E5%8A%A8%E4%BF%AE%E6%94%B9%E5%AF%86%E7%A0%81(How-to-change-password-automatically-for-accounts-with-verified-emails))) 12 | 1. This program supports Microsoft edge browser and chrome Google browser, so you need to download the corresponding webdriver for your browser. How to download and configure, you can Google it yourself. (Note that you need to download the version that matches your browser) 13 | 2. The account need to change password's information needs to be stored in a txt file, the specific format is: 14 | 213451231----351252312 15 | a21341----3512s5312 16 | 213s51231----35s125312 17 | 213451sd31----351sd52312 18 | 3. **Config.yaml file needs to be configured before use** 19 | (Need to pay attention!!! The file path should use \\\ instead of \\) 20 | (When configuring the path, remember to add .txt after the account information file, remember to add .exe after the driver) 21 | (path do not appear Chinese and Chinese characters) 22 | (If you have not verified the mailbox, you do not need to fill in the configuration information of imap) 23 | You can set: imapDelay: Number.which seconds will wait for the email code. 24 | Example: 25 | ![image](https://github.com/Yudaotor/Riot-Accounts-AutoChangePassword/assets/87225219/1de91063-0c79-4224-83d2-704c089651c1) 26 | 27 | 28 | 5. After the execution of the program, you can check the information of the password change in the log folder. 29 | 6. How to download, please click the right side of the release to download the latest version of the exe file to use. 30 | 7. Accounts with or without verified mailboxes can be used. If you have verified accounts, you need to add the corresponding mailbox IMAP information in the configuration file 31 | ## Screenshot of the program running console 32 | ![image](https://user-images.githubusercontent.com/87225219/225540315-faa5d20f-1fb5-45d2-915f-ba695ca8be2a.png) 33 | 34 | Translated with www.DeepL.com/Translator (free version) 35 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | import os 2 | from traceback import format_exc 3 | from pathlib import Path 4 | from Handler import Handler 5 | from VersionManager import VersionManager 6 | from rich import print 7 | from I18n import _, _log 8 | from Logger import log 9 | from Config import config 10 | from Webdriver import web_driver_manager 11 | 12 | 13 | def init(): 14 | try: 15 | Path("./logs/").mkdir(parents=True, exist_ok=True) 16 | Path("./newAccounts/").mkdir(parents=True, exist_ok=True) 17 | except Exception: 18 | log.error(format_exc()) 19 | 20 | 21 | CURRENT_VERSION = 2.7 22 | init() 23 | 24 | if not VersionManager.isLatestVersion(CURRENT_VERSION): 25 | print("[yellow]--------------------------------------------------------------------[/]") 26 | print(f"{_('!!! 新版本可用 !!! 从此处下载:', color='yellow', lang=config.language)} https://github.com/Yudaotor/Riot-Accounts-AutoChangePassword/releases/latest") 27 | print("[yellow]--------------------------------------------------------------------[/]") 28 | 29 | 30 | def main(): 31 | print(f"[bold yellow]{'-' * 15}[/]" 32 | f"v {CURRENT_VERSION} " 33 | f"{_('程序启动', 'bold yellow', config.language)} " 34 | f"[bold yellow]{'-' * 15}[/]") 35 | print(f"{_('请我喝杯咖啡吧~https://github.com/Yudaotor', 'cyan', config.language)}") 36 | try: 37 | with open(config.account_file_path, encoding="utf-8") as f: 38 | line = f.readline() 39 | account_delimiter = config.account_delimiter 40 | imap_server = config.imap_server 41 | while line: 42 | sp = line.split(account_delimiter) 43 | if sp: 44 | handler = Handler(web_driver_manager.create_driver_instance()) 45 | username = sp[0] 46 | password = sp[1] 47 | if password.endswith('\n'): 48 | password = password[:-1] 49 | if handler.automatic_login(username, password): 50 | if imap_server != "": 51 | if handler.imap_login(): 52 | if handler.change_password(username, password): 53 | handler.account_log_out() 54 | elif handler.change_password(username, password): 55 | handler.account_log_out() 56 | line = f.readline() 57 | handler.driver_instance.quit() 58 | except Exception: 59 | log.error(format_exc()) 60 | 61 | 62 | def quit_all(): 63 | print(f'[bold yellow]----[/] {_("程序结束, 即将退出", "bold green", config.language)} [bold yellow]-----[/]') 64 | print(f"[bold yellow]----[/] {_('请我喝杯咖啡吧~', 'cyan', config.language)} https://github.com/Yudaotor [bold yellow]-----[/]") 65 | print(f'[bold yellow]----[/] {_("修改成功的新账号密码请于newAccounts文件夹中查看", "bold green", config.language)} [bold yellow]-----[/]') 66 | print(f'[bold yellow]----[/] {_("本次运行结果可于log文件夹中查看", "bold green", config.language)} [bold yellow]-----[/]') 67 | input() 68 | os.kill(os.getpid(), 9) 69 | 70 | 71 | if __name__ == '__main__': 72 | try: 73 | main() 74 | except (KeyboardInterrupt, SystemExit): 75 | quit_all() 76 | quit_all() 77 | -------------------------------------------------------------------------------- /Webdriver.py: -------------------------------------------------------------------------------- 1 | from traceback import format_exc 2 | 3 | from selenium import webdriver 4 | from selenium.webdriver.chrome.service import Service as ChromeService 5 | from selenium.webdriver.edge.service import Service as EdgeService 6 | from webdriver_manager.chrome import ChromeDriverManager 7 | from webdriver_manager.core.driver_cache import DriverCacheManager 8 | from webdriver_manager.microsoft import EdgeChromiumDriverManager 9 | from rich import print 10 | from I18n import _, _log 11 | from Logger import log 12 | from Config import config 13 | 14 | 15 | def add_webdriver_options(options): 16 | prefs = { 17 | "profile.password_manager_enabled": False, 18 | "credentials_enable_service": False, 19 | 'profile.default_content_setting_values': { 20 | 'notifications': 2 21 | } 22 | } 23 | options.add_experimental_option('prefs', prefs) 24 | options.add_argument("--disable-extensions") 25 | options.add_argument("--disable-gpu") 26 | options.add_experimental_option("excludeSwitches", ["enable-logging"]) 27 | options.add_argument('disable-infobars') 28 | options.add_argument("--start-maximized") 29 | options.add_argument("--disable-gpu-shader-disk-cache") 30 | options.add_argument("--disable-application-cache") 31 | options.add_argument("--disable-cache") 32 | user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.41" 33 | options.add_argument(f'user-agent={user_agent}') 34 | return options 35 | 36 | 37 | class Webdriver: 38 | def __init__(self, browser): 39 | self.browser = browser 40 | self.driver_path = "" 41 | self.options = None 42 | self.service = None 43 | self.manager = None 44 | self.init_webdriver() 45 | 46 | def create_driver_instance(self): 47 | driver_instance = webdriver.Chrome(service=self.service, options=self.options) 48 | try: 49 | driver_instance.get('https://auth.riotgames.com/login#acr_values=urn%3Ariot%3Agold&client_id=accountodactyl-prod&redirect_uri' 50 | '=https%3A%2F%2Faccount.riotgames.com%2Foauth2%2Flog-in&response_type=code&scope=openid%20email%20profile' 51 | '%20riot%3A%2F%2Friot.atlas%2Faccounts.edit%20riot%3A%2F%2Friot.atlas%2Faccounts%2Fpassword.edit%20riot' 52 | '%3A%2F%2Friot.atlas%2Faccounts%2Femail.edit%20riot%3A%2F%2Friot.atlas%2Faccounts.auth%20riot%3A%2F' 53 | '%2Fthird_party.revoke%20riot%3A%2F%2Fthird_party.query%20riot%3A%2F%2Fforgetme%2Fnotify.write%20riot%3A' 54 | '%2F%2Friot.authenticator%2Fauth.code%20riot%3A%2F%2Friot.authenticator%2Fauthz.edit%20riot%3A%2F%2Frso' 55 | '%2Fmfa%2Fdevice.write%20riot%3A%2F%2Friot.authenticator%2Fidentity.add&state=547c8cd2-9eb0-4302-b9b2' 56 | '-f29ee843a4bd&ui_locales=zh-Hans') 57 | except Exception: 58 | print(_("改密网站载入失败", "red", config.language)) 59 | log.error(_log("改密网站载入失败")) 60 | log.error(format_exc()) 61 | input(_log("按回车键退出...", config.language)) 62 | exit() 63 | driver_instance.implicitly_wait(10) 64 | return driver_instance 65 | 66 | def init_webdriver(self): 67 | print(_("正在初始化...", "yellow", config.language)) 68 | log.info(_log("正在初始化...", config.language)) 69 | try: 70 | match self.browser: 71 | case "chrome": 72 | custom_path = ".\\driver" 73 | chrome_driver_manager = ChromeDriverManager(cache_manager=DriverCacheManager(custom_path)) 74 | self.driver_path = chrome_driver_manager.install() 75 | self.options = add_webdriver_options(webdriver.ChromeOptions()) 76 | self.service = ChromeService(self.driver_path) 77 | case "edge": 78 | custom_path = ".\\driver" 79 | edge_chromium_driver_manager = EdgeChromiumDriverManager(cache_manager=DriverCacheManager(custom_path)) 80 | self.driver_path = edge_chromium_driver_manager.install() 81 | self.options = add_webdriver_options(webdriver.EdgeOptions()) 82 | self.service = EdgeService(self.driver_path) 83 | case _: 84 | print(_("选择了不支持的浏览器", "red", config.language)) 85 | except Exception: 86 | print(_("初始化webdriver失败,请检查是否对应浏览器是否已经是最新版本.", "red", config.language)) 87 | log.error(_log("初始化webdriver失败,请检查是否对应浏览器是否已经是最新版本.", config.language)) 88 | log.error(format_exc()) 89 | 90 | 91 | web_driver_manager = Webdriver(config.browser) 92 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### JetBrains template 2 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider 3 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 4 | 5 | # User-specific stuff 6 | .idea/**/workspace.xml 7 | .idea/**/tasks.xml 8 | .idea/**/usage.statistics.xml 9 | .idea/**/dictionaries 10 | .idea/**/shelf 11 | .idea/**/*.xml 12 | Pipfile.lock 13 | Pipfile 14 | *.txt 15 | *.exe 16 | 17 | # Generated files 18 | .idea/**/contentModel.xml 19 | 20 | # Sensitive or high-churn files 21 | .idea/**/dataSources/ 22 | .idea/**/dataSources.ids 23 | .idea/**/dataSources.local.xml 24 | .idea/**/sqlDataSources.xml 25 | .idea/**/dynamic.xml 26 | .idea/**/uiDesigner.xml 27 | .idea/**/dbnavigator.xml 28 | 29 | # Gradle 30 | .idea/**/gradle.xml 31 | .idea/**/libraries 32 | 33 | # Gradle and Maven with auto-import 34 | # When using Gradle or Maven with auto-import, you should exclude module files, 35 | # since they will be recreated, and may cause churn. Uncomment if using 36 | # auto-import. 37 | # .idea/artifacts 38 | # .idea/compiler.xml 39 | # .idea/jarRepositories.xml 40 | # .idea/modules.xml 41 | # .idea/*.iml 42 | # .idea/modules 43 | # *.iml 44 | # *.ipr 45 | 46 | # CMake 47 | cmake-build-*/ 48 | 49 | # Mongo Explorer plugin 50 | .idea/**/mongoSettings.xml 51 | 52 | # File-based project format 53 | *.iws 54 | 55 | # IntelliJ 56 | out/ 57 | 58 | # mpeltonen/sbt-idea plugin 59 | .idea_modules/ 60 | 61 | # JIRA plugin 62 | atlassian-ide-plugin.xml 63 | 64 | # Cursive Clojure plugin 65 | .idea/replstate.xml 66 | 67 | # Crashlytics plugin (for Android Studio and IntelliJ) 68 | com_crashlytics_export_strings.xml 69 | crashlytics.properties 70 | crashlytics-build.properties 71 | fabric.properties 72 | 73 | # Editor-based Rest Client 74 | .idea/httpRequests 75 | 76 | # Android studio 3.1+ serialized cache file 77 | .idea/caches/build_file_checksums.ser 78 | 79 | ### Python template 80 | # Byte-compiled / optimized / DLL files 81 | __pycache__/ 82 | *.py[cod] 83 | *$py.class 84 | 85 | # C extensions 86 | *.so 87 | 88 | # Distribution / packaging 89 | .Python 90 | build/ 91 | develop-eggs/ 92 | dist/ 93 | downloads/ 94 | eggs/ 95 | .eggs/ 96 | lib/ 97 | lib64/ 98 | parts/ 99 | sdist/ 100 | var/ 101 | wheels/ 102 | share/python-wheels/ 103 | *.egg-info/ 104 | .installed.cfg 105 | *.egg 106 | MANIFEST 107 | 108 | # PyInstaller 109 | # Usually these files are written by a python script from a template 110 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 111 | *.manifest 112 | *.spec 113 | 114 | # Installer logs 115 | pip-log.txt 116 | pip-delete-this-directory.txt 117 | 118 | # Unit test / coverage reports 119 | htmlcov/ 120 | .tox/ 121 | .nox/ 122 | .coverage 123 | .coverage.* 124 | .cache 125 | nosetests.xml 126 | coverage.xml 127 | *.cover 128 | *.py,cover 129 | .hypothesis/ 130 | .pytest_cache/ 131 | cover/ 132 | 133 | # Translations 134 | *.mo 135 | *.pot 136 | 137 | # Django stuff: 138 | *.log 139 | local_settings.py 140 | db.sqlite3 141 | db.sqlite3-journal 142 | 143 | # Flask stuff: 144 | instance/ 145 | .webassets-cache 146 | 147 | # Scrapy stuff: 148 | .scrapy 149 | 150 | # Sphinx documentation 151 | docs/_build/ 152 | 153 | # PyBuilder 154 | .pybuilder/ 155 | target/ 156 | 157 | # Jupyter Notebook 158 | .ipynb_checkpoints 159 | 160 | # IPython 161 | profile_default/ 162 | ipython_config.py 163 | 164 | # pyenv 165 | # For a library or package, you might want to ignore these files since the code is 166 | # intended to run in multiple environments; otherwise, check them in: 167 | # .python-version 168 | 169 | # pipenv 170 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 171 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 172 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 173 | # install all needed dependencies. 174 | #Pipfile.lock 175 | 176 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 177 | __pypackages__/ 178 | 179 | # Celery stuff 180 | celerybeat-schedule 181 | celerybeat.pid 182 | 183 | # SageMath parsed files 184 | *.sage.py 185 | 186 | # Environments 187 | .env 188 | .venv 189 | env/ 190 | venv/ 191 | ENV/ 192 | env.bak/ 193 | venv.bak/ 194 | 195 | # Spyder project settings 196 | .spyderproject 197 | .spyproject 198 | 199 | # Rope project settings 200 | .ropeproject 201 | 202 | # mkdocs documentation 203 | /site 204 | 205 | # mypy 206 | .mypy_cache/ 207 | .dmypy.json 208 | dmypy.json 209 | 210 | # Pyre type checker 211 | .pyre/ 212 | 213 | # pytype static type analyzer 214 | .pytype/ 215 | 216 | # Cython debug symbols 217 | cython_debug/ 218 | 219 | /.idea/.gitignore 220 | /.idea/xiaohao.iml 221 | 222 | LICENSE.chromedriver 223 | -------------------------------------------------------------------------------- /Config.py: -------------------------------------------------------------------------------- 1 | import os 2 | from traceback import format_exc 3 | 4 | import yaml 5 | from yaml.parser import ParserError 6 | from rich import print 7 | from pathlib import Path 8 | from I18n import _, _log 9 | from Logger import log 10 | 11 | 12 | class Config: 13 | def __init__(self, config_path): 14 | try: 15 | config_path = self.find_config(config_path) 16 | if config_path is None: 17 | print("[red]Config file not found[/]") 18 | log.error("Config file not found") 19 | input("Press Enter to exit...") 20 | os.kill(os.getpid(), 9) 21 | with open(config_path, "r", encoding='utf-8') as f: 22 | configg = yaml.safe_load(f) 23 | self.new_password = configg.get("newPassword") 24 | self.account_file_path = configg.get("accountFilePath").strip('u202a') 25 | self.account_delimiter = configg.get("accountDelimiter", "----") 26 | self.browser = configg.get("browser", "edge") 27 | self.imap_server = configg.get("imapServer", "") 28 | self.imap_username = configg.get("imapUsername", "") 29 | self.imap_password = configg.get("imapPassword", "") 30 | self.imap_delay = configg.get("imapDelay", 10) 31 | self.language = configg.get("language", "zh_CN") 32 | self.format() 33 | except (ParserError, KeyError): 34 | log.error("Config file format error") 35 | log.error(format_exc()) 36 | print("[red]Config file format error[/]") 37 | input("Press Enter to exit...") 38 | os.kill(os.getpid(), 9) 39 | except Exception: 40 | log.error("Config file read error") 41 | log.error(format_exc()) 42 | print("[red]Config file read error[/]") 43 | input("Press Enter to exit...") 44 | os.kill(os.getpid(), 9) 45 | 46 | def find_config(self, config_path): 47 | """ 48 | Finds the configuration file at the specified path. 49 | 50 | Args: 51 | config_path (str): The path to the configuration file. 52 | 53 | Returns: 54 | Union[Path, None]: The path to the configuration file if it exists, None otherwise. 55 | """ 56 | config_path = Path(config_path) 57 | if config_path.exists(): 58 | return config_path 59 | else: 60 | return None 61 | 62 | def format(self): 63 | """ 64 | Formats the configuration values to ensure they are in the correct format. 65 | 66 | Returns: 67 | None 68 | """ 69 | if self.language not in ["zh_CN", "en_US", "zh_TW"]: 70 | self.language = "zh_CN" 71 | print(_("语言格式错误, 已重置为默认值zh_CN", "red", self.language)) 72 | valid, message = self.check_password_strength(self.new_password) 73 | if not valid: 74 | print(message) 75 | log.error(_log("密码强度不足", self.language)) 76 | input("Press Enter to exit...") 77 | os.kill(os.getpid(), 9) 78 | if isinstance(self.imap_delay, str): 79 | try: 80 | self.imap_delay = int(self.imap_delay) 81 | except ValueError: 82 | self.imap_delay = 10 83 | print(_("延迟格式错误, 已重置为默认值10", "red", self.language)) 84 | elif not isinstance(self.imap_delay, int): 85 | self.imap_delay = 10 86 | print(_("延迟格式错误, 已重置为默认值10", "red", self.language)) 87 | if isinstance(self.account_delimiter, str): 88 | if self.account_delimiter == "": 89 | self.account_delimiter = "----" 90 | else: 91 | print(_("分隔符格式错误, 已重置为默认值----", "red", self.language)) 92 | log.error(_log("分隔符格式错误, 已重置为默认值----", self.language)) 93 | self.account_delimiter = "----" 94 | 95 | if isinstance(self.browser, str): 96 | if self.browser not in ["edge", "chrome"]: 97 | print(_("浏览器格式错误, 已重置为默认值edge", "red", self.language)) 98 | log.error(_log("浏览器格式错误, 已重置为默认值edge", self.language)) 99 | self.browser = "edge" 100 | else: 101 | print(_("浏览器格式错误, 已重置为默认值edge", "red", self.language)) 102 | log.error(_log("浏览器格式错误, 已重置为默认值edge", self.language)) 103 | self.browser = "edge" 104 | if isinstance(self.imap_server, str): 105 | if self.imap_server == "": 106 | self.imap_server = "" 107 | else: 108 | print(_("imap服务器格式错误, 已重置为空", "red", self.language)) 109 | log.error(_log("imap服务器格式错误, 已重置为空", self.language)) 110 | self.imap_server = "" 111 | if isinstance(self.imap_username, str): 112 | if self.imap_username == "": 113 | self.imap_username = "" 114 | else: 115 | print(_("imap用户名格式错误, 已重置为空", "red", self.language)) 116 | log.error(_log("imap用户名格式错误, 已重置为空", self.language)) 117 | self.imap_username = "" 118 | if isinstance(self.imap_password, str): 119 | if self.imap_password == "": 120 | self.imap_password = "" 121 | else: 122 | print(_("imap密码格式错误, 已重置为空", "red", self.language)) 123 | log.error(_log("imap密码格式错误, 已重置为空", self.language)) 124 | self.imap_password = "" 125 | if self.imap_server == "imap.qq.com": 126 | print(_("检测到您使用的是QQ邮箱, 请注意QQ邮箱的IMAP功能需要手动开启,以及需要的是授权码而非密码", "yellow", self.language)) 127 | log.warning(_log("检测到您使用的是QQ邮箱, 请注意QQ邮箱的IMAP功能需要手动开启,以及需要的是授权码而非密码", self.language)) 128 | elif self.imap_server == "imap.163.com" or self.imap_server == "imap.126.com": 129 | print(_("检测到您使用的是网易邮箱, 请注意网易邮箱的IMAP功能需要手动开启,以及需要的是授权码而非密码", "yellow", self.language)) 130 | log.warning(_log("检测到您使用的是网易邮箱, 请注意网易邮箱的IMAP功能需要手动开启,以及需要的是授权码而非密码", self.language)) 131 | if self.imap_server == "imap.gmail.com": 132 | print(_("检测到您使用的是谷歌邮箱, 请注意谷歌邮箱不可用 但是可以通过在谷歌邮箱设置中配置转发到其他可以支持的邮箱来获取验证码", "yellow", self.language)) 133 | log.warning(_log("检测到您使用的是谷歌邮箱, 请注意谷歌邮箱不可用 但是可以通过在谷歌邮箱设置中配置转发到其他可以支持的邮箱来获取验证码", self.language)) 134 | if self.imap_server: 135 | print(_("读取邮件延迟当前为: ", color='bold yellow', lang=self.language) + str(self.imap_delay) + _("秒", color='bold yellow', lang=self.language)) 136 | log.info(_log("读取邮件延迟当前为: ", self.language) + str(self.imap_delay) + _log("秒", self.language)) 137 | 138 | def check_password_strength(self, password): 139 | if len(password) < 8: 140 | return False, _("密码长度必须大于等于8", color="red", lang=self.language) 141 | 142 | if not any(char.isalpha() for char in password) or not any(char.isnumeric() or not char.isalnum() for char in password): 143 | return False, _("密码必须包含至少一个字母和一个非字母字符", color="red", lang=self.language) 144 | return True, "" 145 | 146 | 147 | config = Config("./config.yaml") 148 | -------------------------------------------------------------------------------- /I18n.py: -------------------------------------------------------------------------------- 1 | en_us_i18n = { 2 | "语言格式错误, 已重置为默认值zh_CN": "Language format error, reset to default value zh_CN", 3 | "分隔符格式错误, 已重置为默认值----": "Delimiter format error, reset to default value ----", 4 | "浏览器格式错误, 已重置为默认值edge": "Browser format error, reset to default value edge", 5 | "imap服务器格式错误, 已重置为空": "IMAP server format error, reset to empty", 6 | "imap用户名格式错误, 已重置为空": "IMAP username format error, reset to empty", 7 | "imap密码格式错误, 已重置为空": "IMAP password format error, reset to empty", 8 | "检测到您使用的是QQ邮箱, 请注意QQ邮箱的IMAP功能需要手动开启,以及需要的是授权码而非密码": "It is detected that you are using QQ mailbox. Please note that the IMAP function of QQ mailbox needs to be turned on manually, and the authorization code is required instead of the password", 9 | "IMAP连接失败": "IMAP connection failed", 10 | "接受Cookies发生错误": "An error occurred while accepting cookies", 11 | " 失败": " failed", 12 | "登录时发生错误": "An error occurred while logging in", 13 | " 成功": " success", 14 | "改密时发生错误": "An error occurred while changing password", 15 | "登出时发生错误": "An error occurred while logging out", 16 | "IMAP获取验证码失败": "IMAP failed to get verification code", 17 | "IMAP获取验证码失败 请检查是否打开了IMAP": "IMAP failed to get verification code.Please check imap is on?", 18 | " 邮箱验证码获取失败": " Email verification code acquisition failed", 19 | "webDriver创建失败!": "webDriver creation failed!", 20 | "按回车键退出...": "Press Enter to exit...", 21 | '!!! 新版本可用 !!! 从此处下载:': '!!! New version available !!! Download from here:', 22 | '程序启动': 'Program startup', 23 | "密码强度不足": "Password strength is insufficient", 24 | '请我喝杯咖啡吧~https://github.com/Yudaotor': 'Buy me a cup of coffee~https://github.com/Yudaotor', 25 | "检测到您使用的是谷歌邮箱, 请注意谷歌邮箱不可用 但是可以通过在谷歌邮箱设置中配置转发到其他可以支持的邮箱来获取验证码": "It is detected that you are using Google mailbox. Please note that Google mailbox is not available, but you can configure it to forward to other supported mailboxes in the Google mailbox settings to get the verification code", 26 | '程序结束': 'Program end', 27 | "----程序退出, 将在3秒后结束-----": "----Program exit, will end in 3 seconds-----", 28 | "----修改成功的新账号密码请于newAccounts文件夹中查看-----": "----The new account password that was successfully modified can be viewed in the newAccounts folder-----", 29 | "----本次运行结果可于log文件夹中查看-----": "----The results of this run can be viewed in the log folder-----", 30 | "选择了不支持的浏览器": "Selected an unsupported browser", 31 | "初始化webdriver失败,请检查是否对应浏览器是否已经是最新版本.": "Failed to initialize webdriver, please check whether the corresponding browser is the latest version.", 32 | "检测到您使用的是网易邮箱, 请注意网易邮箱的IMAP功能需要手动开启,以及需要的是授权码而非密码": "It is detected that you are using NetEase mailbox. Please note that the IMAP function of NetEase mailbox needs to be turned on manually, and the authorization code is required instead of the password", 33 | "延迟格式错误, 已重置为默认值10": "Delay format error, reset to default value 10", 34 | "遇到图片验证码": "Encounter image captcha", 35 | "读取邮件延迟当前为: ": "Read mail delay is currently: ", 36 | "改密网站载入失败": "Failed to load password change website", 37 | "程序结束, 即将退出": "Program end, will exit soon", 38 | "本次运行结果可于log文件夹中查看": "The results of this run can be viewed in the log folder", 39 | "秒": " seconds", 40 | "获取验证码失败": "Failed to get verification code", 41 | '请我喝杯咖啡吧~': 'Buy me a cup of coffee~', 42 | "正在初始化...": "Initializing...", 43 | "获取对应邮件失败 请调整imapDelay到合适时间": "Failed to get the corresponding email, please adjust the imapDelay to the appropriate time", 44 | "IMAP获取验证码失败 请检查是否打开了IMAP": "IMAP failed to get verification code.Please check imap is on?", 45 | "修改成功的新账号密码请于newAccounts文件夹中查看": "The new account password that was successfully modified can be viewed in the newAccounts folder", 46 | } 47 | zh_tw_i18n = { 48 | "语言格式错误, 已重置为默认值zh_CN": "語言格式錯誤,已重置為默認值zh_CN", 49 | "分隔符格式错误, 已重置为默认值----": "分隔符格式錯誤,已重置為默認值----", 50 | "获取对应邮件失败 请调整imapDelay到合适时间": "獲取對應郵件失敗 請調整imapDelay到合適時間", 51 | "检测到您使用的是谷歌邮箱, 请注意谷歌邮箱不可用 但是可以通过在谷歌邮箱设置中配置转发到其他可以支持的邮箱来获取验证码": "檢測到您使用的是谷歌郵箱,請注意谷歌郵箱不可用 但是可以通過在谷歌郵箱設置中配置轉發到其他可以支持的郵箱來獲取驗證碼", 52 | "浏览器格式错误, 已重置为默认值edge": "瀏覽器格式錯誤,已重置為默認值edge", 53 | "imap服务器格式错误, 已重置为空": "imap服務器格式錯誤,已重置為空", 54 | "imap用户名格式错误, 已重置为空": "imap用戶名格式錯誤,已重置為空", 55 | "获取验证码失败": "獲取驗證碼失敗", 56 | "本次运行结果可于log文件夹中查看": "本次運行結果可於log文件夾中查看", 57 | "IMAP获取验证码失败 请检查是否打开了IMAP": "IMAP獲取驗證碼失敗 請檢查是否打開了IMAP", 58 | "imap密码格式错误, 已重置为空": "imap密碼格式錯誤,已重置為空", 59 | "检测到您使用的是QQ邮箱, 请注意QQ邮箱的IMAP功能需要手动开启,以及需要的是授权码而非密码": "檢測到您使用的是QQ郵箱,請注意QQ郵箱的IMAP功能需要手動開啟,以及需要的是授權碼而非密碼", 60 | "IMAP连接失败": "IMAP連接失敗", 61 | "接受Cookies发生错误": "接受Cookies發生錯誤", 62 | "改密网站载入失败": "改密網站載入失敗", 63 | "修改成功的新账号密码请于newAccounts文件夹中查看": "修改成功的新賬號密碼請於newAccounts文件夾中查看", 64 | "程序结束, 即将退出": "程序結束,即將退出", 65 | '请我喝杯咖啡吧~': '請我喝杯咖啡吧~', 66 | "秒": " 秒", 67 | " 失败": " 失敗", 68 | "登录时发生错误": "登錄時發生錯誤", 69 | '请我喝杯咖啡吧~https://github.com/Yudaotor': '請我喝杯咖啡吧~https://github.com/Yudaotor', 70 | " 成功": " 成功", 71 | "改密时发生错误": "改密時發生錯誤", 72 | "IMAP获取验证码失败 请检查是否打开了IMAP": "IMAP獲取驗證碼失敗 請檢查是否打開了IMAP", 73 | "登出时发生错误": "登出時發生錯誤", 74 | "IMAP获取验证码失败": "IMAP獲取驗證碼失敗", 75 | " 邮箱验证码获取失败": " 郵箱驗證碼獲取失敗", 76 | "webDriver创建失败!": "webDriver創建失敗!", 77 | "按回车键退出...": "按回車鍵退出...", 78 | '!!! 新版本可用 !!! 从此处下载:': '!!! 新版本可用 !!! 從此處下載:', 79 | '程序启动': '程序啟動', 80 | '程序结束': '程序結束', 81 | "----程序退出, 将在3秒后结束-----": "----程序退出,將在3秒後結束-----", 82 | "----修改成功的新账号密码请于newAccounts文件夹中查看-----": "----修改成功的新賬號密碼請於newAccounts文件夾中查看-----", 83 | "----本次运行结果可于log文件夹中查看-----": "----本次運行結果可於log文件夾中查看-----", 84 | "选择了不支持的浏览器": "選擇了不支持的瀏覽器", 85 | "初始化webdriver失败,请检查是否对应浏览器是否已经是最新版本.": "初始化webdriver失敗,請檢查是否對應瀏覽器是否已經是最新版本。", 86 | "检测到您使用的是网易邮箱, 请注意网易邮箱的IMAP功能需要手动开启,以及需要的是授权码而非密码": "檢測到您使用的是網易郵箱,請注意網易郵箱的IMAP功能需要手動開啟,以及需要的是授權碼而非密碼", 87 | "延迟格式错误, 已重置为默认值10": "延遲格式錯誤,已重置為默認值10", 88 | "密码强度不足": "密碼強度不足", 89 | "遇到图片验证码": "遇到圖片驗證碼", 90 | "正在初始化...": "正在初始化...", 91 | "读取邮件延迟当前为: ": "讀取郵件延遲當前為: ", 92 | } 93 | 94 | 95 | def _(text, color, lang="zh_CN"): 96 | """ 97 | A function that formats text with a specified color based on the given language. 98 | 99 | Args: 100 | text (str): The text to be formatted. 101 | color (str): The color to format the text with, specified using BBCode format. 102 | lang (str): The language of the text. Defaults to "zh_CN". 103 | 104 | Returns: 105 | str: The formatted text with the specified color and language. 106 | """ 107 | raw_text = text 108 | language_map = { 109 | "zh_CN": f"[{color}]{text}[/]", 110 | "en_US": f"[{color}]{en_us_i18n.get(text, f'{raw_text} No translation there. Please contact the developer.')}[/]", 111 | "zh_TW": f"[{color}]{zh_tw_i18n.get(text, raw_text)}[/]" 112 | } 113 | return language_map.get(lang, text) 114 | 115 | 116 | def _log(text, lang="zh_CN"): 117 | """ 118 | Logs the given text with language support. 119 | 120 | Args: 121 | text (str): The text to be logged. 122 | lang (str, optional): The language of the text. Defaults to "zh_CN". 123 | 124 | Returns: 125 | str: The logged text in the specified language, or the original text if translation is not available. 126 | """ 127 | raw_text = text 128 | language_map = { 129 | "zh_CN": raw_text, 130 | "en_US": en_us_i18n.get(text, f"{raw_text} No translation there. Please contact the developer."), 131 | "zh_TW": zh_tw_i18n.get(text, raw_text) 132 | } 133 | return language_map.get(lang, text) 134 | -------------------------------------------------------------------------------- /Handler.py: -------------------------------------------------------------------------------- 1 | import random 2 | import time 3 | from traceback import format_exc 4 | 5 | from imaplib2 import imaplib2 6 | from selenium.webdriver.common.by import By 7 | from selenium.webdriver.support.ui import WebDriverWait 8 | from selenium.webdriver.support import expected_conditions as ec 9 | from rich import print 10 | from IMAP import IMAP 11 | from Export import Export 12 | from selenium.webdriver.common.keys import Keys 13 | from I18n import _, _log 14 | from Logger import log 15 | from Config import config 16 | 17 | 18 | def imap_hook(username, password, server): 19 | """ 20 | Establishes an IMAP connection and returns a mail object. 21 | 22 | Args: 23 | username (str): The username for the IMAP connection. 24 | password (str): The password for the IMAP connection. 25 | server (str): The server for the IMAP connection. 26 | 27 | Returns: 28 | IMAP: The mail object for the IMAP connection. 29 | 30 | """ 31 | try: 32 | M = imaplib2.IMAP4_SSL(server) 33 | M.login(username, password) 34 | mail = IMAP(M, username) 35 | M.logout() 36 | return mail 37 | except Exception: 38 | print(_("IMAP连接失败", "red", config.language)) 39 | log.error(_log("IMAP连接失败", config.language)) 40 | log.error(format_exc()) 41 | 42 | 43 | class Handler: 44 | def __init__(self, driver_instance): 45 | self.driver_instance = driver_instance 46 | self.accept_cookies() 47 | 48 | def accept_cookies(self): 49 | """ 50 | Accepts the cookies on the web page. 51 | 52 | Returns: 53 | None 54 | """ 55 | try: 56 | time.sleep(1) 57 | self.driver_instance.implicitly_wait(2) 58 | cookie_button = self.driver_instance.find_elements(By.XPATH, '/html/body/div[1]/div[2]/div[2]/button[2]') 59 | if len(cookie_button) > 0: 60 | cookie_button[0].click() 61 | self.driver_instance.implicitly_wait(10) 62 | except Exception: 63 | print(_("接受Cookies发生错误", "red", config.language)) 64 | log.error(_log("接受Cookies发生错误", config.language)) 65 | log.error(format_exc()) 66 | 67 | def automatic_login(self, username, password) -> bool: 68 | """ 69 | Performs automatic login with the provided username and password. 70 | 71 | Args: 72 | username (str): The username for login. 73 | password (str): The password for login. 74 | 75 | Returns: 76 | bool: True if the login is successful, False otherwise. 77 | 78 | """ 79 | try: 80 | self.driver_instance.implicitly_wait(10) 81 | time.sleep(2) 82 | wait = WebDriverWait(self.driver_instance, 10) 83 | username_input = wait.until(ec.presence_of_element_located((By.CSS_SELECTOR, "input[name=username]"))) 84 | username_input.send_keys(Keys.CONTROL, 'a') 85 | for character in username: 86 | username_input.send_keys(character) 87 | time.sleep(random.uniform(0.02, 0.1)) 88 | time.sleep(1) 89 | password_input = wait.until(ec.presence_of_element_located((By.CSS_SELECTOR, "input[name=password]"))) 90 | password_input.send_keys(Keys.CONTROL, 'a') 91 | for character in password: 92 | password_input.send_keys(character) 93 | time.sleep(random.uniform(0.02, 0.1)) 94 | time.sleep(1) 95 | submit_button = wait.until(ec.presence_of_element_located((By.CSS_SELECTOR, "button[data-testid=btn-signin-submit]"))) 96 | self.driver_instance.execute_script("arguments[0].click();", submit_button) 97 | try: 98 | captcha_iframe = WebDriverWait(self.driver_instance, 2).until(ec.frame_to_be_available_and_switch_to_it((By.CSS_SELECTOR, "iframe[src*='captcha']"))) 99 | captcha_div = WebDriverWait(self.driver_instance, 2).until(ec.presence_of_element_located((By.CSS_SELECTOR, "div.interface-wrapper"))) 100 | print(_("遇到图片验证码", "red", config.language)) 101 | if captcha_iframe: 102 | self.driver_instance.switch_to.default_content() 103 | print(username + _(" 失败", "red", config.language)) 104 | log.error(username + _log(" 失败", config.language)) 105 | return False 106 | except Exception: 107 | pass 108 | return True 109 | except Exception: 110 | log.error(username + _log(" 失败", config.language)) 111 | print(username + _(" 失败", "red", config.language)) 112 | self.driver_instance.delete_all_cookies() 113 | self.driver_instance.refresh() 114 | print(_("登录时发生错误", "red", config.language)) 115 | log.error(_log("登录时发生错误", config.language)) 116 | log.error(format_exc()) 117 | return False 118 | 119 | def change_password(self, username, password) -> bool: 120 | new_password = config.new_password 121 | delimiter = config.account_delimiter 122 | try: 123 | current_password_input = self.driver_instance.find_element(by=By.CSS_SELECTOR, value='input[data-testid=password-card__currentPassword]') 124 | for character in password: 125 | current_password_input.send_keys(character) 126 | time.sleep(random.uniform(0.02, 0.1)) 127 | time.sleep(0.5) 128 | new_password_input = self.driver_instance.find_element(by=By.CSS_SELECTOR, value='input[data-testid=password-card__newPassword]') 129 | for character in new_password: 130 | new_password_input.send_keys(character) 131 | time.sleep(random.uniform(0.02, 0.1)) 132 | time.sleep(0.5) 133 | confirm_new_password_input = self.driver_instance.find_element(by=By.CSS_SELECTOR, value='input[data-testid=password-card__confirmNewPassword]') 134 | for character in new_password: 135 | confirm_new_password_input.send_keys(character) 136 | time.sleep(random.uniform(0.02, 0.1)) 137 | time.sleep(0.5) 138 | self.driver_instance.find_element(by=By.CSS_SELECTOR, value='button[data-testid=password-card__submit-btn]').click() 139 | time.sleep(1) 140 | Export(delimiter).write_success_acc(username, new_password, email_verify=config.imap_username) 141 | log.info(username + _log(" 成功", config.language)) 142 | print(username + _(" 成功", "green", config.language)) 143 | return True 144 | except Exception: 145 | log.error(username + _log(" 失败", config.language)) 146 | print(username + _(" 失败", "red", config.language)) 147 | print(_("改密时发生错误", "red", config.language)) 148 | log.error(_log("改密时发生错误", config.language)) 149 | log.error(format_exc()) 150 | return False 151 | 152 | def account_log_out(self): 153 | try: 154 | time.sleep(2) 155 | except Exception: 156 | print(_("登出时发生错误", "red", config.language)) 157 | log.error(_log("登出时发生错误", config.language)) 158 | log.error(format_exc()) 159 | 160 | def imap_login(self) -> bool: 161 | imap_delay = config.imap_delay 162 | imap_username = config.imap_username 163 | imap_password = config.imap_password 164 | imap_server = config.imap_server 165 | try: 166 | time.sleep(imap_delay) 167 | req = imap_hook(imap_username, imap_password, imap_server) 168 | if req is None: 169 | log.error(_log("IMAP获取验证码失败 请检查是否打开了IMAP", config.language)) 170 | print(_("IMAP获取验证码失败 请检查是否打开了IMAP", "red", config.language)) 171 | return False 172 | elif req.code == "": 173 | log.error(_log("获取对应邮件失败 请调整imapDelay到合适时间", config.language)) 174 | print(_("获取对应邮件失败 请调整imapDelay到合适时间", "red", config.language)) 175 | return False 176 | self.driver_instance.implicitly_wait(5) 177 | two_fa_code_input = self.driver_instance.find_element(by=By.CSS_SELECTOR, value='input[data-testid=input-mfa]') 178 | two_fa_code_input.send_keys(req.code) 179 | time.sleep(1) 180 | self.driver_instance.find_element(by=By.CSS_SELECTOR, value='button[type=submit]').click() 181 | time.sleep(3) 182 | self.driver_instance.implicitly_wait(10) 183 | if len(req.code) == 6: 184 | return True 185 | else: 186 | log.error(imap_username + _log(" 邮箱验证码获取失败", config.language)) 187 | print(imap_username + _(" 邮箱验证码获取失败", "red", config.language)) 188 | return False 189 | except Exception: 190 | log.error(imap_username + _log(" 邮箱验证码获取失败", config.language)) 191 | print(imap_username + _(" 邮箱验证码获取失败", "red", config.language)) 192 | self.driver_instance.delete_all_cookies() 193 | self.driver_instance.refresh() 194 | log.error(format_exc()) 195 | return False 196 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Attribution-NonCommercial-ShareAlike 4.0 International 2 | 3 | ======================================================================= 4 | 5 | Creative Commons Corporation ("Creative Commons") is not a law firm and 6 | does not provide legal services or legal advice. Distribution of 7 | Creative Commons public licenses does not create a lawyer-client or 8 | other relationship. Creative Commons makes its licenses and related 9 | information available on an "as-is" basis. Creative Commons gives no 10 | warranties regarding its licenses, any material licensed under their 11 | terms and conditions, or any related information. Creative Commons 12 | disclaims all liability for damages resulting from their use to the 13 | fullest extent possible. 14 | 15 | Using Creative Commons Public Licenses 16 | 17 | Creative Commons public licenses provide a standard set of terms and 18 | conditions that creators and other rights holders may use to share 19 | original works of authorship and other material subject to copyright 20 | and certain other rights specified in the public license below. The 21 | following considerations are for informational purposes only, are not 22 | exhaustive, and do not form part of our licenses. 23 | 24 | Considerations for licensors: Our public licenses are 25 | intended for use by those authorized to give the public 26 | permission to use material in ways otherwise restricted by 27 | copyright and certain other rights. Our licenses are 28 | irrevocable. Licensors should read and understand the terms 29 | and conditions of the license they choose before applying it. 30 | Licensors should also secure all rights necessary before 31 | applying our licenses so that the public can reuse the 32 | material as expected. Licensors should clearly mark any 33 | material not subject to the license. This includes other CC- 34 | licensed material, or material used under an exception or 35 | limitation to copyright. More considerations for licensors: 36 | wiki.creativecommons.org/Considerations_for_licensors 37 | 38 | Considerations for the public: By using one of our public 39 | licenses, a licensor grants the public permission to use the 40 | licensed material under specified terms and conditions. If 41 | the licensor's permission is not necessary for any reason--for 42 | example, because of any applicable exception or limitation to 43 | copyright--then that use is not regulated by the license. Our 44 | licenses grant only permissions under copyright and certain 45 | other rights that a licensor has authority to grant. Use of 46 | the licensed material may still be restricted for other 47 | reasons, including because others have copyright or other 48 | rights in the material. A licensor may make special requests, 49 | such as asking that all changes be marked or described. 50 | Although not required by our licenses, you are encouraged to 51 | respect those requests where reasonable. More considerations 52 | for the public: 53 | wiki.creativecommons.org/Considerations_for_licensees 54 | 55 | ======================================================================= 56 | 57 | Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International 58 | Public License 59 | 60 | By exercising the Licensed Rights (defined below), You accept and agree 61 | to be bound by the terms and conditions of this Creative Commons 62 | Attribution-NonCommercial-ShareAlike 4.0 International Public License 63 | ("Public License"). To the extent this Public License may be 64 | interpreted as a contract, You are granted the Licensed Rights in 65 | consideration of Your acceptance of these terms and conditions, and the 66 | Licensor grants You such rights in consideration of benefits the 67 | Licensor receives from making the Licensed Material available under 68 | these terms and conditions. 69 | 70 | 71 | Section 1 -- Definitions. 72 | 73 | a. Adapted Material means material subject to Copyright and Similar 74 | Rights that is derived from or based upon the Licensed Material 75 | and in which the Licensed Material is translated, altered, 76 | arranged, transformed, or otherwise modified in a manner requiring 77 | permission under the Copyright and Similar Rights held by the 78 | Licensor. For purposes of this Public License, where the Licensed 79 | Material is a musical work, performance, or sound recording, 80 | Adapted Material is always produced where the Licensed Material is 81 | synched in timed relation with a moving image. 82 | 83 | b. Adapter's License means the license You apply to Your Copyright 84 | and Similar Rights in Your contributions to Adapted Material in 85 | accordance with the terms and conditions of this Public License. 86 | 87 | c. BY-NC-SA Compatible License means a license listed at 88 | creativecommons.org/compatiblelicenses, approved by Creative 89 | Commons as essentially the equivalent of this Public License. 90 | 91 | d. Copyright and Similar Rights means copyright and/or similar rights 92 | closely related to copyright including, without limitation, 93 | performance, broadcast, sound recording, and Sui Generis Database 94 | Rights, without regard to how the rights are labeled or 95 | categorized. For purposes of this Public License, the rights 96 | specified in Section 2(b)(1)-(2) are not Copyright and Similar 97 | Rights. 98 | 99 | e. Effective Technological Measures means those measures that, in the 100 | absence of proper authority, may not be circumvented under laws 101 | fulfilling obligations under Article 11 of the WIPO Copyright 102 | Treaty adopted on December 20, 1996, and/or similar international 103 | agreements. 104 | 105 | f. Exceptions and Limitations means fair use, fair dealing, and/or 106 | any other exception or limitation to Copyright and Similar Rights 107 | that applies to Your use of the Licensed Material. 108 | 109 | g. License Elements means the license attributes listed in the name 110 | of a Creative Commons Public License. The License Elements of this 111 | Public License are Attribution, NonCommercial, and ShareAlike. 112 | 113 | h. Licensed Material means the artistic or literary work, database, 114 | or other material to which the Licensor applied this Public 115 | License. 116 | 117 | i. Licensed Rights means the rights granted to You subject to the 118 | terms and conditions of this Public License, which are limited to 119 | all Copyright and Similar Rights that apply to Your use of the 120 | Licensed Material and that the Licensor has authority to license. 121 | 122 | j. Licensor means the individual(s) or entity(ies) granting rights 123 | under this Public License. 124 | 125 | k. NonCommercial means not primarily intended for or directed towards 126 | commercial advantage or monetary compensation. For purposes of 127 | this Public License, the exchange of the Licensed Material for 128 | other material subject to Copyright and Similar Rights by digital 129 | file-sharing or similar means is NonCommercial provided there is 130 | no payment of monetary compensation in connection with the 131 | exchange. 132 | 133 | l. Share means to provide material to the public by any means or 134 | process that requires permission under the Licensed Rights, such 135 | as reproduction, public display, public performance, distribution, 136 | dissemination, communication, or importation, and to make material 137 | available to the public including in ways that members of the 138 | public may access the material from a place and at a time 139 | individually chosen by them. 140 | 141 | m. Sui Generis Database Rights means rights other than copyright 142 | resulting from Directive 96/9/EC of the European Parliament and of 143 | the Council of 11 March 1996 on the legal protection of databases, 144 | as amended and/or succeeded, as well as other essentially 145 | equivalent rights anywhere in the world. 146 | 147 | n. You means the individual or entity exercising the Licensed Rights 148 | under this Public License. Your has a corresponding meaning. 149 | 150 | 151 | Section 2 -- Scope. 152 | 153 | a. License grant. 154 | 155 | 1. Subject to the terms and conditions of this Public License, 156 | the Licensor hereby grants You a worldwide, royalty-free, 157 | non-sublicensable, non-exclusive, irrevocable license to 158 | exercise the Licensed Rights in the Licensed Material to: 159 | 160 | a. reproduce and Share the Licensed Material, in whole or 161 | in part, for NonCommercial purposes only; and 162 | 163 | b. produce, reproduce, and Share Adapted Material for 164 | NonCommercial purposes only. 165 | 166 | 2. Exceptions and Limitations. For the avoidance of doubt, where 167 | Exceptions and Limitations apply to Your use, this Public 168 | License does not apply, and You do not need to comply with 169 | its terms and conditions. 170 | 171 | 3. Term. The term of this Public License is specified in Section 172 | 6(a). 173 | 174 | 4. Media and formats; technical modifications allowed. The 175 | Licensor authorizes You to exercise the Licensed Rights in 176 | all media and formats whether now known or hereafter created, 177 | and to make technical modifications necessary to do so. The 178 | Licensor waives and/or agrees not to assert any right or 179 | authority to forbid You from making technical modifications 180 | necessary to exercise the Licensed Rights, including 181 | technical modifications necessary to circumvent Effective 182 | Technological Measures. For purposes of this Public License, 183 | simply making modifications authorized by this Section 2(a) 184 | (4) never produces Adapted Material. 185 | 186 | 5. Downstream recipients. 187 | 188 | a. Offer from the Licensor -- Licensed Material. Every 189 | recipient of the Licensed Material automatically 190 | receives an offer from the Licensor to exercise the 191 | Licensed Rights under the terms and conditions of this 192 | Public License. 193 | 194 | b. Additional offer from the Licensor -- Adapted Material. 195 | Every recipient of Adapted Material from You 196 | automatically receives an offer from the Licensor to 197 | exercise the Licensed Rights in the Adapted Material 198 | under the conditions of the Adapter's License You apply. 199 | 200 | c. No downstream restrictions. You may not offer or impose 201 | any additional or different terms or conditions on, or 202 | apply any Effective Technological Measures to, the 203 | Licensed Material if doing so restricts exercise of the 204 | Licensed Rights by any recipient of the Licensed 205 | Material. 206 | 207 | 6. No endorsement. Nothing in this Public License constitutes or 208 | may be construed as permission to assert or imply that You 209 | are, or that Your use of the Licensed Material is, connected 210 | with, or sponsored, endorsed, or granted official status by, 211 | the Licensor or others designated to receive attribution as 212 | provided in Section 3(a)(1)(A)(i). 213 | 214 | b. Other rights. 215 | 216 | 1. Moral rights, such as the right of integrity, are not 217 | licensed under this Public License, nor are publicity, 218 | privacy, and/or other similar personality rights; however, to 219 | the extent possible, the Licensor waives and/or agrees not to 220 | assert any such rights held by the Licensor to the limited 221 | extent necessary to allow You to exercise the Licensed 222 | Rights, but not otherwise. 223 | 224 | 2. Patent and trademark rights are not licensed under this 225 | Public License. 226 | 227 | 3. To the extent possible, the Licensor waives any right to 228 | collect royalties from You for the exercise of the Licensed 229 | Rights, whether directly or through a collecting society 230 | under any voluntary or waivable statutory or compulsory 231 | licensing scheme. In all other cases the Licensor expressly 232 | reserves any right to collect such royalties, including when 233 | the Licensed Material is used other than for NonCommercial 234 | purposes. 235 | 236 | 237 | Section 3 -- License Conditions. 238 | 239 | Your exercise of the Licensed Rights is expressly made subject to the 240 | following conditions. 241 | 242 | a. Attribution. 243 | 244 | 1. If You Share the Licensed Material (including in modified 245 | form), You must: 246 | 247 | a. retain the following if it is supplied by the Licensor 248 | with the Licensed Material: 249 | 250 | i. identification of the creator(s) of the Licensed 251 | Material and any others designated to receive 252 | attribution, in any reasonable manner requested by 253 | the Licensor (including by pseudonym if 254 | designated); 255 | 256 | ii. a copyright notice; 257 | 258 | iii. a notice that refers to this Public License; 259 | 260 | iv. a notice that refers to the disclaimer of 261 | warranties; 262 | 263 | v. a URI or hyperlink to the Licensed Material to the 264 | extent reasonably practicable; 265 | 266 | b. indicate if You modified the Licensed Material and 267 | retain an indication of any previous modifications; and 268 | 269 | c. indicate the Licensed Material is licensed under this 270 | Public License, and include the text of, or the URI or 271 | hyperlink to, this Public License. 272 | 273 | 2. You may satisfy the conditions in Section 3(a)(1) in any 274 | reasonable manner based on the medium, means, and context in 275 | which You Share the Licensed Material. For example, it may be 276 | reasonable to satisfy the conditions by providing a URI or 277 | hyperlink to a resource that includes the required 278 | information. 279 | 3. If requested by the Licensor, You must remove any of the 280 | information required by Section 3(a)(1)(A) to the extent 281 | reasonably practicable. 282 | 283 | b. ShareAlike. 284 | 285 | In addition to the conditions in Section 3(a), if You Share 286 | Adapted Material You produce, the following conditions also apply. 287 | 288 | 1. The Adapter's License You apply must be a Creative Commons 289 | license with the same License Elements, this version or 290 | later, or a BY-NC-SA Compatible License. 291 | 292 | 2. You must include the text of, or the URI or hyperlink to, the 293 | Adapter's License You apply. You may satisfy this condition 294 | in any reasonable manner based on the medium, means, and 295 | context in which You Share Adapted Material. 296 | 297 | 3. You may not offer or impose any additional or different terms 298 | or conditions on, or apply any Effective Technological 299 | Measures to, Adapted Material that restrict exercise of the 300 | rights granted under the Adapter's License You apply. 301 | 302 | 303 | Section 4 -- Sui Generis Database Rights. 304 | 305 | Where the Licensed Rights include Sui Generis Database Rights that 306 | apply to Your use of the Licensed Material: 307 | 308 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right 309 | to extract, reuse, reproduce, and Share all or a substantial 310 | portion of the contents of the database for NonCommercial purposes 311 | only; 312 | 313 | b. if You include all or a substantial portion of the database 314 | contents in a database in which You have Sui Generis Database 315 | Rights, then the database in which You have Sui Generis Database 316 | Rights (but not its individual contents) is Adapted Material, 317 | including for purposes of Section 3(b); and 318 | 319 | c. You must comply with the conditions in Section 3(a) if You Share 320 | all or a substantial portion of the contents of the database. 321 | 322 | For the avoidance of doubt, this Section 4 supplements and does not 323 | replace Your obligations under this Public License where the Licensed 324 | Rights include other Copyright and Similar Rights. 325 | 326 | 327 | Section 5 -- Disclaimer of Warranties and Limitation of Liability. 328 | 329 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE 330 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS 331 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF 332 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, 333 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, 334 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 335 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, 336 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT 337 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT 338 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. 339 | 340 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE 341 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, 342 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, 343 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, 344 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR 345 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN 346 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR 347 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR 348 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. 349 | 350 | c. The disclaimer of warranties and limitation of liability provided 351 | above shall be interpreted in a manner that, to the extent 352 | possible, most closely approximates an absolute disclaimer and 353 | waiver of all liability. 354 | 355 | 356 | Section 6 -- Term and Termination. 357 | 358 | a. This Public License applies for the term of the Copyright and 359 | Similar Rights licensed here. However, if You fail to comply with 360 | this Public License, then Your rights under this Public License 361 | terminate automatically. 362 | 363 | b. Where Your right to use the Licensed Material has terminated under 364 | Section 6(a), it reinstates: 365 | 366 | 1. automatically as of the date the violation is cured, provided 367 | it is cured within 30 days of Your discovery of the 368 | violation; or 369 | 370 | 2. upon express reinstatement by the Licensor. 371 | 372 | For the avoidance of doubt, this Section 6(b) does not affect any 373 | right the Licensor may have to seek remedies for Your violations 374 | of this Public License. 375 | 376 | c. For the avoidance of doubt, the Licensor may also offer the 377 | Licensed Material under separate terms or conditions or stop 378 | distributing the Licensed Material at any time; however, doing so 379 | will not terminate this Public License. 380 | 381 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public 382 | License. 383 | 384 | 385 | Section 7 -- Other Terms and Conditions. 386 | 387 | a. The Licensor shall not be bound by any additional or different 388 | terms or conditions communicated by You unless expressly agreed. 389 | 390 | b. Any arrangements, understandings, or agreements regarding the 391 | Licensed Material not stated herein are separate from and 392 | independent of the terms and conditions of this Public License. 393 | 394 | 395 | Section 8 -- Interpretation. 396 | 397 | a. For the avoidance of doubt, this Public License does not, and 398 | shall not be interpreted to, reduce, limit, restrict, or impose 399 | conditions on any use of the Licensed Material that could lawfully 400 | be made without permission under this Public License. 401 | 402 | b. To the extent possible, if any provision of this Public License is 403 | deemed unenforceable, it shall be automatically reformed to the 404 | minimum extent necessary to make it enforceable. If the provision 405 | cannot be reformed, it shall be severed from this Public License 406 | without affecting the enforceability of the remaining terms and 407 | conditions. 408 | 409 | c. No term or condition of this Public License will be waived and no 410 | failure to comply consented to unless expressly agreed to by the 411 | Licensor. 412 | 413 | d. Nothing in this Public License constitutes or may be interpreted 414 | as a limitation upon, or waiver of, any privileges and immunities 415 | that apply to the Licensor or You, including from the legal 416 | processes of any jurisdiction or authority. 417 | 418 | ======================================================================= 419 | 420 | Creative Commons is not a party to its public 421 | licenses. Notwithstanding, Creative Commons may elect to apply one of 422 | its public licenses to material it publishes and in those instances 423 | will be considered the “Licensor.” The text of the Creative Commons 424 | public licenses is dedicated to the public domain under the CC0 Public 425 | Domain Dedication. Except for the limited purpose of indicating that 426 | material is shared under a Creative Commons public license or as 427 | otherwise permitted by the Creative Commons policies published at 428 | creativecommons.org/policies, Creative Commons does not authorize the 429 | use of the trademark "Creative Commons" or any other trademark or logo 430 | of Creative Commons without its prior written consent including, 431 | without limitation, in connection with any unauthorized modifications 432 | to any of its public licenses or any other arrangements, 433 | understandings, or agreements concerning use of licensed material. For 434 | the avoidance of doubt, this paragraph does not form part of the 435 | public licenses. 436 | 437 | Creative Commons may be contacted at creativecommons.org. 438 | --------------------------------------------------------------------------------