mirror of
https://github.com/cstaelen/shazarr.git
synced 2026-10-19 01:31:11 -05:00
18 lines
342 B
Python
18 lines
342 B
Python
import asyncio
|
|
import sys
|
|
import json
|
|
from shazamio import Shazam
|
|
|
|
if len(sys.argv) != 2:
|
|
raise ValueError('Please provide file url')
|
|
|
|
file = sys.argv[1]
|
|
|
|
async def main():
|
|
shazam = Shazam()
|
|
out = await shazam.recognize_song(file)
|
|
info = json.dumps(out)
|
|
print(info)
|
|
|
|
loop = asyncio.get_event_loop()
|
|
loop.run_until_complete(main()) |