valerebron / usetube

search & get datas from youtube no google account needed
GNU General Public License v3.0
50 stars 18 forks source link

getChannelVideos() does not work #9

Closed Reichmann-M closed 3 years ago

Reichmann-M commented 3 years ago

I'm sorry but channel video search doesn't work.

Neither by using an actual channel id (e.g. 'UC6eCu3YVjhlB1mjRILyw0tQ') nor by using the example id ('PLAbeRqyTx1rIGWY13HgPyh0VF0LdoTQFp'). By the way this is a playlist id not a channel one.

I hope you can fix this :)

valerebron commented 3 years ago

First, It works for me,

await usetube.getChannelVideos('UC6eCu3YVjhlB1mjRILyw0tQ', '2019-11-10T23:35:38.000Z')

return this:

  { id: '3afiDpmz62g',
    original_title:
     'Dieser Youtuber bewertet mein Inventar mit über $ 500,000! 🤑',
    title:
     'Dieser Youtuber bewertet mein Inventar mit über $ 500,000! 🤑',
    artist: '',
    duration: 1474,
    publishedAt: 2020-05-28T05:08:44.000Z },
  { id: 'rLrFn46MOI4',
    original_title:
     'CS:GO - Da kann man mal clutchen! #20 - Die GEGNER wurden leider GEKAUFT!',
    title: 'Die GEGNER wurden leider GEKAUFT!',
    artist: 'CS:GO - Da kann man mal clutchen! #20',
    duration: 601,
    publishedAt: 2020-05-18T04:01:54.000Z },
  ... 32 more items ]
Done in 87.67s.

Now, there might be two reasons for getChannelVideos() not to return any result :

  1. you sent too much query to youtube with usetube and getChannelVideos() return undefined
  2. you try to get too much videos from a channel (1349 videos for the channel id you try), If so try to use published_after param like this :
    await usetube.getChannelVideos('UC6eCu3YVjhlB1mjRILyw0tQ', '2019-11-10T23:35:38.000Z')

And finally, Indeed it's a playlist Id, thanks ! I prepare corrections and a getPlaylistVideos() function for the next version of usetube.

Cheers

valerebron commented 3 years ago

I just finish the test for the 1349 videos channel and it takes 839.12s ... but it works.

Reichmann-M commented 3 years ago

Cool man, thank you very much. I am looking forward to next commits. I'll close this for now.

Bye :)

valerebron commented 3 years ago

I just update UseTube v1.3.0. UseTube v1.3.0 contains a getPlaylistVideos() function. Go check the readme for more details.

Just try again

await usetube.getChannelVideos('UC6eCu3YVjhlB1mjRILyw0tQ', '2019-11-10T23:35:38.000Z')

it take while but it should works :)

cheers

Reichmann-M commented 3 years ago

Cool man, thank you :)