yadomi / tube

0 stars 0 forks source link

Add a bookmarklet to add a channel from a youtube channel page #10

Open yadomi opened 2 months ago

yadomi commented 2 months ago

the channel_id can be retrieved by

new URL(document.querySelector('link[type="application/rss+xml"]').href).searchParams.get('channel_id')

when on a youtube channel page (eg: https://www.youtube.com/@Underscore_ )

I didn't find an easy way (yet) to get the channel_id when on video page

yadomi commented 1 month ago

Now that there is a add_by_url, the bookmarklet can look like something as simple as this:

(() => {
  fetch('http://192.168.1.100:8000/?method=add_by_url&url=' + encodeURI(window.location.href), { method: 'POST' })
    .then(res => res.text())
    .then(res => alert(res))
  })()
yadomi commented 1 month ago

still needs to figure out how to get the channel_id from a video page