-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from Johnserf-Seed/v0.0.1.6-pw2
fix douyin mix& f2 ci yml from v0.0.1.6 pw2 on 24/Apr/07
- Loading branch information
Showing
10 changed files
with
158 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,21 @@ | ||
import pytest | ||
from f2.apps.douyin.handler import DouyinHandler | ||
from f2.utils.conf_manager import TestConfigManager | ||
|
||
|
||
kwargs = { | ||
"headers": { | ||
"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": "YOUR_COOKIE_HERE", | ||
} | ||
user_sec_id = "MS4wLjABAAAANXSltcLCzDGmdNFI2Q_QixVTr67NiYzjKOIP5s03CAE" | ||
@pytest.fixture | ||
def cookie_fixture(): | ||
return TestConfigManager.get_test_config("douyin") | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_fetch_user_post_videos(): | ||
results = [ | ||
async def test_fetch_user_post_videos(cookie_fixture): | ||
async for aweme_data_list in DouyinHandler(cookie_fixture).fetch_user_post_videos( | ||
sec_user_id="MS4wLjABAAAANXSltcLCzDGmdNFI2Q_QixVTr67NiYzjKOIP5s03CAE", | ||
max_cursor=0, | ||
page_counts=1, | ||
max_counts=1, | ||
): | ||
aweme_data_list | ||
async for aweme_data_list in DouyinHandler(kwargs).fetch_user_post_videos( | ||
user_sec_id | ||
) | ||
] | ||
|
||
assert results, f"Failed to fetch videos for user_sec_id: {user_sec_id}" | ||
assert aweme_data_list, f"Failed to fetch videos for user_sec_id: {aweme_data_list}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,17 @@ | ||
import pytest | ||
from f2.apps.douyin.handler import DouyinHandler | ||
from f2.log.logger import logger | ||
from f2.utils.conf_manager import TestConfigManager | ||
|
||
logger.setLevel("DEBUG") | ||
|
||
kwargs = { | ||
"headers": { | ||
"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": "YOUR_COOKIE_HERE", | ||
} | ||
@pytest.fixture | ||
def cookie_fixture(): | ||
return TestConfigManager.get_test_config("douyin") | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_fetch_user_live_videos_by_room_id(): | ||
result = await DouyinHandler(kwargs).fetch_user_live_videos_by_room_id( | ||
async def test_fetch_user_live_videos_by_room_id(cookie_fixture): | ||
result = await DouyinHandler(cookie_fixture).fetch_user_live_videos_by_room_id( | ||
"7318296342189919011" | ||
) | ||
|
||
assert isinstance(result, dict) | ||
assert "room_id" in result | ||
assert "7318296342189919011" == str(result.room_id) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
douyin: | ||
headers: | ||
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: __ac_nonce=066126d7400831d6b5c4e; __ac_signature=_02B4Z6wo00f01Y.vKPwAAIDC-cD1sEsc6ZmPzyxAAAXq04; ttwid=1%7Crk-8HHHCVERrpnGqN5PSPeaEwNAo02w-MzX5peKwBnI%7C1712483701%7C16399ab279d221e1f50ef17c96b5215641887b7a739cec048347e0c45221a491; douyin.com; device_web_cpu_core=12; device_web_memory_size=8; architecture=amd64; IsDouyinActive=true; home_can_add_dy_2_desktop=%220%22; dy_swidth=1920; dy_sheight=1080; stream_recommend_feed_params=%22%7B%5C%22cookie_enabled%5C%22%3Atrue%2C%5C%22screen_width%5C%22%3A1920%2C%5C%22screen_height%5C%22%3A1080%2C%5C%22browser_online%5C%22%3Atrue%2C%5C%22cpu_core_num%5C%22%3A12%2C%5C%22device_memory%5C%22%3A8%2C%5C%22downlink%5C%22%3A10%2C%5C%22effective_type%5C%22%3A%5C%224g%5C%22%2C%5C%22round_trip_time%5C%22%3A150%7D%22; csrf_session_id=3d3dbde628fcd833106552c68320f88b; FORCE_LOGIN=%7B%22videoConsumedRemainSeconds%22%3A180%7D; strategyABtestKey=%221712483704.155%22; volume_info=%7B%22isUserMute%22%3Afalse%2C%22isMute%22%3Afalse%2C%22volume%22%3A0.7%7D; stream_player_status_params=%22%7B%5C%22is_auto_play%5C%22%3A0%2C%5C%22is_full_screen%5C%22%3A0%2C%5C%22is_full_webscreen%5C%22%3A0%2C%5C%22is_mute%5C%22%3A0%2C%5C%22is_speed%5C%22%3A1%2C%5C%22is_visible%5C%22%3A1%7D%22; passport_csrf_token=b2ef0d72ded3b759412fe41b62111cc9; passport_csrf_token_default=b2ef0d72ded3b759412fe41b62111cc9; bd_ticket_guard_client_data=eyJiZC10aWNrZXQtZ3VhcmQtdmVyc2lvbiI6MiwiYmQtdGlja2V0LWd1YXJkLWl0ZXJhdGlvbi12ZXJzaW9uIjoxLCJiZC10aWNrZXQtZ3VhcmQtcmVlLXB1YmxpYy1rZXkiOiJCRWFLenNuYW8vUHhnajB2L1NRYUU4U29QVGZhS1YxVnpnYnZEMnFlektXdVhqcDNXOTNjZXB6b1hoU0MxQ05YNVNRTUg1QWRlakd5UzBNNld1RjRBZVE9IiwiYmQtdGlja2V0LWd1YXJkLXdlYi12ZXJzaW9uIjoxfQ%3D%3D; bd_ticket_guard_client_web_domain=2; msToken=mnRmihU-xb0ZsLkb-itjzad_A7ZQyDmKNrcczdt6Jj_7IXz0gdwCT8uN8XYukG1Zj5-JFxDv4yeRKsiC_WxSeXrcbYJYC0Uwyuz0C-Oe; odin_tt=509a427e7fae6b0f4498c2bbed2ead86ae99d77284740ea0f1ab337321cb107858575a289f02b0d4e81f660aeec9405be135e8361c3726ca00857825c875944955ed204c58993e6c6e879dcd024a0733 | ||
proxies: | ||
http: | ||
https: | ||
|
||
tiktok: | ||
headers: | ||
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: tt_csrf_token=OFxPH3PE-pSbFptiHW4iy-z4yo3u6gMDt3H0; tt_chain_token=mCH+/C/4flkJarNC1WciiQ==; ak_bmsc=91F3094B27728C66727FD8F413E3CFDA~000000000000000000000000000000~YAAQDfN0aMJLgrOOAQAAfOkFuBeR4cRsy06d9RdcxcQPWGV8lJwTK79/VYCCwvjeEtlU2mCQalUnDU1R2p6Put0FonN6gVhoG2cCdwocRl87ItHMeEQpQxAH0640eFwLYG7OBS5ydU9DUbYX3pCINlGp3AbB7wbAxQb75svv1eEALa0ba8YvA85s1ingqnpt4WmKuSeyR9LkCIg9oABnKJHbPaR2FAWA982tsSdQYIeKlsUc5nyotjtrmgDubgD+v624hs2ilwVQ61HKiCQ7P15mH0M9FL8ciGsDpTKotxZ8sG2phoylvmn0ajD8QV2YdDOegI9ss6RC79POVI5xaFnpoV8TQWLyPzdEl/E6S1TVqaqRHMJsF1De/tdQcLC9//aCKt3NZTqDGg==; tiktok_webapp_theme=light; ttwid=1%7C92fxGgEo0Z8ZDy0YLeqOnKTMHMCPieG0L8UVR1j1oI8%7C1712484381%7Ccb6cbac4d746f5a6acaf73301b34642d1358092dce19a9cb97a4adc978e9d383; odin_tt=d739e385ecc07c0682ee2c2824e464e42d6760e26ec3df8c5b4a0ed1b0bcf02fb36a3eed2a0012a70b3f8ac84a79d5278e23b2ead40ed7aaf85c8ca8b611a8f5819324df5b2ecc7e1d45725a1f5f3ed9; msToken=iA6SqoX-3ggC9aEGWcxqgX0GoRG_1z-3JA9jecj8NwngM3ivhpnl6113Xc72cEc1RhP5YXXeblbo5OOrjfH6tyqtVhD68pnoxVHFTwONHFKwxGkryp3AP2ipQ8Y4; msToken=-RWw93z8QG4ppPftuXXV0NXTs3KN74Jc-eZ7G8Yw0GOWvLoCXB4upq-lPpbKVhIOxp_wJ-hDkWHj364_BTIJUmFLhFLIOaTzgjD4tazEVOEQUBdyG3IbsEZnHxcR | ||
proxies: | ||
http: | ||
https: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters