Toggle navigation
Toggle navigation
This project
Loading...
Sign in
LiuFuhua
/
xj-marketing
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
liufuhua007
2024-12-24 16:15:29 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
1f90592fe213559df48c0cdf8f64489aa5cd27bc
1f90592f
2 parents
941c82e0
f8bfd207
Merge branch 'master' of
ssh://gitlab.rinal-li.cn:10022/liufuhua/xj-marketing
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
uploader/sohu_uploader/main.py
uploader/sohu_uploader/main.py
View file @
1f90592
...
...
@@ -13,7 +13,7 @@ from utils.log import sohu_logger
async
def
cookie_auth
(
account_file
):
async
with
async_playwright
()
as
playwright
:
browser
=
await
playwright
.
chromium
.
launch
(
headless
=
Fals
e
)
browser
=
await
playwright
.
chromium
.
launch
(
headless
=
Tru
e
)
context
=
await
browser
.
new_context
(
storage_state
=
account_file
)
await
set_init_script
(
context
)
# context = await browser.new_context()
...
...
@@ -49,7 +49,7 @@ async def get_sohu_cookie(account_file):
'args'
:
[
'--lang en-GB'
],
'headless'
:
Fals
e
,
# Set headless option here
'headless'
:
Tru
e
,
# Set headless option here
}
# Make sure to run headed.
browser
=
await
playwright
.
chromium
.
launch
(
**
options
)
...
...
@@ -98,7 +98,7 @@ class SOHUVideo(object):
)
else
:
browser
=
await
playwright
.
chromium
.
launch
(
headless
=
Fals
e
headless
=
Tru
e
)
# 创建一个浏览器上下文,使用指定的 cookie 文件
context
=
await
browser
.
new_context
(
storage_state
=
self
.
account_file
)
page
=
await
context
.
new_page
()
...
...
Please
register
or
login
to post a comment