mirror of
https://github.com/NanmiCoder/MediaCrawler.git
synced 2026-10-02 18:28:12 +08:00
feat: 小红书增加手机号自动登录模式
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import re
|
||||
import time
|
||||
import random
|
||||
import base64
|
||||
from io import BytesIO
|
||||
@@ -57,3 +59,19 @@ def convert_cookies(cookies: Optional[List[Cookie]]) -> Tuple[str, Dict]:
|
||||
for cookie in cookies:
|
||||
cookie_dict[cookie.get('name')] = cookie.get('value')
|
||||
return cookies_str, cookie_dict
|
||||
|
||||
|
||||
def get_current_timestamp():
|
||||
return int(time.time() * 1000)
|
||||
|
||||
|
||||
def match_interact_info_count(count_str: str) -> int:
|
||||
if not count_str:
|
||||
return 0
|
||||
|
||||
match = re.search(r'\d+', count_str)
|
||||
if match:
|
||||
number = match.group()
|
||||
return int(number)
|
||||
else:
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user