Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

youtube-search.lua: Use yt-dlp instead of curl+API #22

Open
gunir opened this issue Oct 3, 2023 · 3 comments
Open

youtube-search.lua: Use yt-dlp instead of curl+API #22

gunir opened this issue Oct 3, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@gunir
Copy link

gunir commented Oct 3, 2023

#####################################
Is this a request for a brand new script?
If so please make a Discussion thread instead
#####################################

Is your feature request related to a problem? Please describe.
I like the idea of being able to search and browse Youtube infinitely, but having to enter API key is a bit rough, yt-dlp support searching out-of-the-box and doens't require API at all.

Describe the solution you'd like
Use yt-dlp instead, with --flat-playlist it's very very fast:

yt-dlp ytsearch10:SEARCH --get-id --get-title --flat-playlist

10 = number of result, of course it must be used with --flat-playlist to increase searching speed by ten forth.

Describe alternatives you've considered
yt-dlp instead of curl+API

Additional context
Should be good enough information.

@gunir gunir added the enhancement New feature or request label Oct 3, 2023
@CogentRedTester
Copy link
Owner

Is there a way of getting channel information for each video as well?

@gunir
Copy link
Author

gunir commented Oct 31, 2023

Is there a way of getting channel information for each video as well?

Yes, a small issue is short videos doesn't return channel name, but shorts are irrelevant so we can just group NA as Shorts:

yt-dlp ytsearch10:fireemblem --flat-playlist --print id,title,channel
ZCdzzXYHID0
The AI Created a Great City Defense Chapter!
Mangs
30XVon_BBMc
Fire Emblem
RJ Pasin - Topic
itUvooNBHWk
The Necessary Evils of Fire Emblem Heroes
ZeShado
58GYGNvPJk8
The Questionable Design Choices and Hilarious Errors of Fire Emblem's First Game
Faerghast
bhi9lrGxUys
Fire Emblem characters all look the same
NA
Rw6wNkZeINg
Fire Emblem Engage is GREAT
NA
3E52D_iIUZI
Fire Emblem Engage Is Stupid
NA
9VTL5EkDIjY
Fire Emblem Heroes - New Hero (Byleth: Tested Professor)
NA
v6mcvASRAdY
The Fire Emblem: Three Houses OST in a nutshell
NA
6-dYmyg969M
Fire Emblem 0 Ironman Speedrun in 53.21s (WR)
NA

@gunir
Copy link
Author

gunir commented Oct 31, 2023

Just in case you want to get more channel information, try:

yt-dlp ytsearch10:fireemblem --flat-playlist --print id,title,channel,duration,thumbnails

Adding --dump-json to see more.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants