Use as package#
Installation#
The easiest way to install the package:
pip install media-parser
poetry add media-parser
Code examples#
1import aiohttp
2
3from media_parser import BaseParser, Media
4
5# More info you can find on "Parser Configuration" page
6config = {
7 "instagram": {},
8 "tiktok": {},
9 "youtube": {}
10}
11
12parser = BaseParser(config=config)
13
14
15async def main():
16 async with aiohttp.ClientSession() as session:
17 media: list[Media] = await parser.parse(
18 client=client,
19 string="https://youtu.be/dQw4w9WgXcQ",
20 cache_collection=None,
21 )
22 print(media)
23
24
25if __name__ == '__main__':
26 import asyncio
27
28 asyncio.run(main())