File size: 667 Bytes
e95a3a8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import asyncio
from douyin_tiktok_scraper.scraper import Scraper
import traceback

api = Scraper()

async def hybrid_parsing(url: str) -> dict:
    try:
        result = await api.hybrid_parsing(url)
        print(f"The hybrid parsing result:\n {result}")
        return result
    except Exception as e:
        print(f"An error occurred: {str(e)}")
        print("Traceback:")
        traceback.print_exc()
        return None

async def main():
    url = input("Paste Douyin/TikTok/Bilibili share URL here: ")
    result = await hybrid_parsing(url)
    if result:
        print("Parsing successful!")
    else:
        print("Parsing failed.")

asyncio.run(main())