feat: 更新文件路径处理逻辑,支持不同运行模式下的文件路径设置,并优化DailymotionClient初始化
This commit is contained in:
parent
0bf2651491
commit
ef5d4a4143
BIN
oss/LOA.pdf
Normal file
BIN
oss/LOA.pdf
Normal file
Binary file not shown.
@ -102,8 +102,10 @@ class DailymotionClient:
|
||||
|
||||
if self.headless:
|
||||
proxy = None
|
||||
self.file_path = "/opt/ql/DailyMotion/oss/LOA.pdf"
|
||||
else:
|
||||
proxy={'server': 'http://127.0.0.1:7890'}
|
||||
self.file_path = "./oss/LOA.pdf"
|
||||
logger.info(f"Launching DailymotionClient with headless={self.headless}, proxy={proxy}")
|
||||
self._pw = sync_playwright().start()
|
||||
self.browser: Browser = self._pw.chromium.launch(
|
||||
@ -252,8 +254,11 @@ class DailymotionClient:
|
||||
self.page.get_by_role("checkbox", name="The data provided through this form", exact=False).check()
|
||||
time.sleep(1)
|
||||
self.page.get_by_role("checkbox", name="By submitting the present form,", exact=False).check()
|
||||
|
||||
time.sleep(1)
|
||||
self.page.set_input_files('input#request-attachments', [
|
||||
self.file_path
|
||||
])
|
||||
self.page.wait_for_timeout(5000)
|
||||
self.page.get_by_role("button", name="Submit").click()
|
||||
time.sleep(2)
|
||||
file_path = f'screenshots/{str(int(time.time()))}_{title}_{link.split("/")[-1]}.png'
|
||||
@ -328,5 +333,6 @@ def close(self):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
dm = DailymotionClient()
|
||||
dm.report_follow_up("2990081")
|
||||
dm = DailymotionClient("zhongpankeji@qq.com", "1q2w3eZp123@#")
|
||||
dm.process_ticket("恋爱学园","https://www.dailymotion.com/video/x9lfr24")
|
||||
# dm.report_follow_up("2990081")
|
||||
|
Loading…
x
Reference in New Issue
Block a user