configuration/local/bin/ytsearch
Felix Van der Jeugt 4bc4e5b8ad several updates
2024-08-02 12:02:01 +02:00

11 lines
351 B
Python
Executable File

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