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:29:25 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
da3007c55ff0524c7124b5fb85da7a252569fb2c
da3007c5
1 parent
1f90592f
fixbug
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
7 deletions
cli_main.py
uploader/toutiao_uploader/main.py
cli_main.py
View file @
da3007c
...
...
@@ -84,6 +84,8 @@ async def main():
await
toutiao_setup
(
str
(
account_file
),
handle
=
True
,
auto
=
False
)
elif
args
.
platform
==
SOCIAL_MEDIA_BAIJIAHAO
:
await
toutiao_setup
(
str
(
account_file
),
handle
=
True
,
auto
=
False
)
elif
args
.
platform
==
SOCIAL_MEDIA_SOHU
:
await
sohu_setup
(
str
(
account_file
),
handle
=
True
)
elif
args
.
action
==
'auto_login'
:
print
(
f
"auto Logging in with account {args.account_name} on platform {args.platform}"
)
...
...
uploader/toutiao_uploader/main.py
View file @
da3007c
...
...
@@ -25,9 +25,6 @@ async def toutiao_setup(account_file, handle=False, auto=False):
async
def
open_toutiao_main_page
(
account_file
):
async
with
async_playwright
()
as
playwright
:
options
=
{
'args'
:
[
'--lang en-GB'
],
'headless'
:
False
,
# Set headless option here
}
# Make sure to run headed.
...
...
@@ -82,9 +79,6 @@ async def get_toutiao_cookie(account_file):
print
(
"get_toutiao_cookie"
)
async
with
async_playwright
()
as
playwright
:
options
=
{
'args'
:
[
'--lang en-GB'
],
'headless'
:
False
,
# Set headless option here
}
# Make sure to run headed.
...
...
@@ -94,7 +88,7 @@ async def get_toutiao_cookie(account_file):
context
=
await
set_init_script
(
context
)
# Pause the page, and start recording manually.
page
=
await
context
.
new_page
()
await
page
.
goto
(
"https://mp.toutiao.com"
)
await
page
.
goto
(
"https://mp.toutiao.com"
,
{
waitUntil
:
"commit"
}
)
# 手动授权登录
await
page
.
pause
()
...
...
Please
register
or
login
to post a comment