add ytsearch script

This commit is contained in:
Felix Van der Jeugt 2021-01-23 22:44:30 +01:00
parent 7db916d08d
commit 640ce045a1
No known key found for this signature in database
GPG Key ID: 58B209295023754D

10
local/bin/ytsearch Executable file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env python
from youtube_search import YoutubeSearch # pip install youtube-search
from sys import argv
for result in YoutubeSearch(' '.join(argv[1:])).to_dict():
print(result['duration'],
f"https://www.youtube.com{result['url_suffix']}",
f"{result['title']} -- {result['channel']}",
sep='\t')