'commit'
This commit is contained in:
37
DouYin/test_original.py
Normal file
37
DouYin/test_original.py
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
import sys
|
||||
import os
|
||||
import logging
|
||||
|
||||
# Add project root to path
|
||||
sys.path.append(r'd:\dsWork\aiData\DouYin')
|
||||
|
||||
from apiproxy.douyin.douyin import Douyin
|
||||
from apiproxy.common import utils
|
||||
|
||||
# Configure logging
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
||||
def test():
|
||||
dy = Douyin()
|
||||
url = "https://v.douyin.com/gHWfWVgDVRo/"
|
||||
|
||||
print(f"Testing URL: {url}")
|
||||
|
||||
# Get Key
|
||||
key_type, key = dy.getKey(url)
|
||||
print(f"Key Type: {key_type}, Key: {key}")
|
||||
|
||||
if key and key_type == 'aweme':
|
||||
# Get Info
|
||||
print("Fetching info...")
|
||||
info = dy.getAwemeInfo(key)
|
||||
if info:
|
||||
print(f"Success! Title: {info.get('desc')}")
|
||||
else:
|
||||
print("Failed to get info.")
|
||||
else:
|
||||
print("Failed to get key.")
|
||||
|
||||
if __name__ == "__main__":
|
||||
test()
|
||||
Reference in New Issue
Block a user