pystardust / ytfzf

A posix script to find and watch youtube videos from the terminal. (Without API)
GNU General Public License v3.0
3.75k stars 346 forks source link

Verified music channels show "null" as upload date #266

Closed TomBT closed 3 years ago

TomBT commented 3 years ago

I included a screenshot to hopefully make what I talk about easier to understand.

Uploads on verified music channels (the ones with the music notes next to them) show "null" instead of the upload date because YouTube automatically hides them when they are in the search results. The actual upload date would have to be scraped from the video description/details. Also in the description there's a line that says "Released on: " which shows the actual release date of the song. Maybe that could be used instead of the upload date since it's more accurate.

One last thing, I highly suggest you listen to the song I used for an example if you haven't already. It's really good. :)

Euro20179 commented 3 years ago

The null thing also happens with livestreams, in order to scrape the description and anything on the video you either have to scrape the video itself which would be slow, or you have to scrape the same information twice which is still slow. this comment also applies to #265.

TomBT commented 3 years ago

Would this also apply to #260 since dipslaying the likes would have to load both the search results and video info?

Euro20179 commented 3 years ago

yes

TomBT commented 3 years ago

Is it still possible to scrape the brief description from the YouTube search results? It looks like it's from the search results page and not the video itself, or would scraping the brief descriptions for that many videos also slowdown the program too?

pystardust commented 3 years ago

It is possible to scrape the description. I have made a refactor on how the data is being managed to be displayed. Before we relied completely on the tsv that was passed by fzf. Now I have implemented it in a way that the whole json object can be accessed while displaying the information.

Check out the description branch and the pr.

TomBT commented 3 years ago

Alright I've downloaded that and it works for the most part but some descriptions are cut shorter than they should be for seemingly no reason. I've been trying to see what is in common but I can't see much.

Also the date for the all of the official music channels say "Provided to YouTube by [whichever music company]" and don't have a description (but I'm not sure how important that is for music.

Euro20179 commented 3 years ago

what's in common is that, the description gets cut off when it reaches a bolded word, words are bolded in the description when they match the search.

TomBT commented 3 years ago

Sorry for responding so late but is it still possible to get the likes as well from the JSON? It makes it a lot easier to see which videos are worthwhile and which ones aren't from the terminal.

Euro20179 commented 3 years ago

It would be nice to get likes from the json, but It doesnt appear that they are in the json

TomBT commented 3 years ago

Ah, I see. Anyways I just wanna thank you guys for the work you put into this project and hearing out the recommendations suggested by its users.