Skip to content

Commit

Permalink
修复闪退
Browse files Browse the repository at this point in the history
  • Loading branch information
1061700625 authored Jul 13, 2023
1 parent f826a25 commit 7b4e09c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
Binary file modified search_grammarly_cookie.exe
Binary file not shown.
28 changes: 15 additions & 13 deletions search_grammarly_cookie.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import pyperclip
from tqdm import tqdm
import time
import lxml # force import

##################################################################
def cookie_convert_j2s(cookie_json):
Expand All @@ -21,27 +22,28 @@ def collect_cookies_linkstricks():
url = f'https://www.linkstricks.com/grammarly-cookies-{i}/'
try:
soup = BeautifulSoup(requests.get(url, timeout=10).text, 'lxml')
except:
print('>> 访问超时, 2s后切换下一个链接')
content = soup.find('code', class_='language-json').string
cookies.append(content)
except Exception as e:
print('>> 访问异常, 2s后切换下一个链接:', e)
time.sleep(2)
continue
content = soup.find('code', class_='language-json').string
cookies.append(content)
return cookies

def collect_cookies_trytechnical():
"""该网站目前已失效,不知道什么时候会恢复"""
print('>> 当前搜索网站为: trytechnical')
cookies = []
for i in tqdm(range(1, 4), desc='搜索中...'):
url = f'https://trytechnical.com/working-grammarly-cookies-hourly-updated-{i}/'
try:
soup = BeautifulSoup(requests.get(url, timeout=10).text, 'lxml')
except:
print('>> 访问超时, 2s后切换下一个链接')
content = soup.find('pre', class_='wp-block-preformatted').string
cookies.append(content)
except Exception as e:
print('>> 访问异常, 2s后切换下一个链接:', e)
time.sleep(2)
continue
content = soup.find('pre', class_='wp-block-preformatted').string
cookies.append(content)
return cookies

def collect_cookies_infokik():
Expand All @@ -51,12 +53,12 @@ def collect_cookies_infokik():
url = f'https://infokik.com/grammarly-{i}/'
try:
soup = BeautifulSoup(requests.get(url, timeout=10).text, 'lxml')
except:
print('>> 访问超时, 2s后切换下一个链接')
content = soup.find('pre', class_='wp-block-code').string
cookies.append(content)
except Exception as e:
print('>> 访问异常, 2s后切换下一个链接:', e)
time.sleep(2)
continue
content = soup.find('pre', class_='wp-block-code').string
cookies.append(content)
return cookies

def collect_cookies_xxxx():
Expand Down Expand Up @@ -97,7 +99,7 @@ def user_define_collect_cookies():

def search_valid_cookie():
cookies = user_define_collect_cookies()
print('>> 搜索完毕, 开始检查')
print(f'>> 搜索完毕, 开始检查, 共{len(cookies)}')
for ck in cookies:
if check_grammarly_cookie(str(ck)):
try:
Expand Down

0 comments on commit 7b4e09c

Please sign in to comment.