Skip to content

Commit

Permalink
Merge pull request #13 from Johnserf-Seed/v0.0.1-pw.1
Browse files Browse the repository at this point in the history
V0.0.1 pw.1 24/01/01 翻译文件与文档更新
  • Loading branch information
Johnserf-Seed authored Dec 31, 2023
2 parents efb7082 + 382d9d8 commit 107c13a
Show file tree
Hide file tree
Showing 10 changed files with 438 additions and 358 deletions.
2 changes: 1 addition & 1 deletion babel.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[python: **.py]

[extractors]
ignore = tests/*
ignore = tests/*, docs/snippets/*
messages_dir = f2/f2/i18n
Binary file added docs/public/douyin/pytest-ok.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/snippets/tiktok/one-video.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from f2.apps.tiktok.handler import fetch_one_video

async def main():
print(await fetch_one_video(itemId="7095819783324601605")
print(await fetch_one_video(itemId="7095819783324601605"))
print("-------------------")
print(await fetch_one_video(itemId="7305827432509082913")
print(await fetch_one_video(itemId="7305827432509082913"))

if __name__ == "__main__":
asyncio.run(main())
asyncio.run(main())
17 changes: 9 additions & 8 deletions docs/snippets/tiktok/user-mix.py
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
// #region playlist-sinppet
import asyncio
from f2.apps.tiktok.handler import fetch_user_mix_videos
from f2.apps.tiktok.handler import fetch_user_mix_videos, fetch_play_list
from f2.apps.tiktok.utils import SecUserIdFetcher


async def main():
secUid = await SecUserIdFetcher.get_secuid("https://www.tiktok.com/@vantoan___"))
secUid = await SecUserIdFetcher.get_secuid("https://www.tiktok.com/@vantoan___")
playlist = await fetch_play_list(secUid)

for mixId in playlist.get("mixId", []):
print([
aweme_data_list async for aweme_data_list in fetch_user_mix_videos(mix_id)
aweme_data_list async for aweme_data_list in fetch_user_mix_videos(mixId)
])

if __name__ == "__main__":
asyncio.run(main())

// #endregion playlist-sinppet


// #region select-playlist-sinppet
import asyncio
from f2.apps.tiktok.handler import fetch_user_mix_videos
from f2.apps.tiktok.handler import fetch_user_mix_videos, fetch_play_list, select_playlist

async def main():
secUid = await SecUserIdFetcher.get_secuid("https://www.tiktok.com/@vantoan___"))
secUid = await SecUserIdFetcher.get_secuid("https://www.tiktok.com/@vantoan___")
playlist = await fetch_play_list(secUid)

selected_index = await select_playlist(playlist) # [!code focus]
if select_index != 0: # [!code focus]
if selected_index != 0: # [!code focus]
mixId = playlist.get("mixId", [])[selected_index - 1] # [!code focus]

print([
aweme_data_list async for aweme_data_list in fetch_user_mix_videos(mix_id)
aweme_data_list async for aweme_data_list in fetch_user_mix_videos(mixId)
])

if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions f2/conf/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ douyin:
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36
Referer: https://www.douyin.com/

cookie:
cookie: ""
desc: yes
folderize: yes
interval: all
Expand Down Expand Up @@ -46,7 +46,7 @@ tiktok:
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36
Referer: https://www.tiktok.com/

cookie:
cookie: ""
cover: yes
desc: yes
folderize: yes
Expand Down
Loading

0 comments on commit 107c13a

Please sign in to comment.