Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add sources with /user/ URL #243

Open
tyronemills opened this issue May 28, 2022 · 10 comments
Open

Add sources with /user/ URL #243

tyronemills opened this issue May 28, 2022 · 10 comments

Comments

@tyronemills
Copy link

Just found tubesync and love it! Just one small issue at the moment. There are several channels that I want to add with a /channel/ or /user/ URL, rather than the /c/ URL. I have tried using /source-add for the URLS with /channel/, but that results in a non-working URL.

E.G.: https://www.youtube.com/channel/UC69FffuTsdjqEfLeodRNgtQ/

If I manually add the source using the key, I get the following URL from tubesync:

https://www.youtube.com/c/UC69FffuTsdjqEfLeodRNgtQ/ which results in a Youtube error page.

Here is an example URL with /user/:

https://www.youtube.com/user/LyonsArcade

Is there a method to add /channel/ and/or /user/ URLS?

@meeb
Copy link
Owner

meeb commented May 29, 2022

You need to add channels by ID using the "add channel by ID" method to add a source, that will use the correct /channel/ URI prefix.

I've been attempting to work out a sane way to add source by user, the issue with it is some /user/name URIs are channels, some are playlists, some are collections of playlists, some are random favourite videos. There isn't much consistency with what YouTube returns for a /user/name page. I could just add them in without attempting to check it, but then if you add /user/name and that user then adds a playlist from a massive channel to their page TubeSync will zoom off and download every video on the playlist which is probably not ideal or an obvious side-effect.

@tyronemills
Copy link
Author

tyronemills commented May 29, 2022

Thanks for the prompt response. I hadn't realized the distinction between /user/ and /channel/ URLs on Youtube. I can see how treating them equally could lead to unexpected and likely unwanted behaviour.

@voarsh2
Copy link

voarsh2 commented Jul 25, 2022

I'm struggling with this myself.
Trying to add https://youtube.com/user/rossmanngroup
Tubesync gives https://www.youtube.com/channel/rossmanngroup - link doesn't work.

@meeb
Copy link
Owner

meeb commented Jul 26, 2022

@voarsh2 yeah that's another vanity URL and not the actual channel name. The actual channel name / ID for that channel is "UCl2mFZoRqjw_ELax4Yisf6w" so pop into TubeSync:

https://www.youtube.com/channel/UCl2mFZoRqjw_ELax4Yisf6w

@ThibaultNocchi
Copy link
Contributor

How do you find a channel URL from a user?

@meeb
Copy link
Owner

meeb commented Aug 2, 2022

It's burried in the metadata, there is an issue to automate this, but for now you can use a command line tool to extract the channel ID for annoying URLs that hide the ID. Go to a channel which is a /user/whatever style page (for example https://youtube.com/user/rossmanngroup from above) and pick a random video on it, for example this one https://www.youtube.com/watch?v=87poTGAasbE which is the latest video on /user/rossmanngroup/videos.

Then pop over to your docker host where TubeSync is running and run this command:

docker exec -ti tubesync python3 /app/manage.py youtube-dl-info "https://www.youtube.com/watch?v=87poTGAasbE" | grep channel_url

Change the YouTube video URL to whatever video you want the channel ID for. This command will output, in the case of the above video:

"channel_url": "https://www.youtube.com/channel/UCl2mFZoRqjw_ELax4Yisf6w",

Which is the channel URL you can copy/paste into TubeSync.

@ThibaultNocchi
Copy link
Contributor

Thanks! In the meantime, I've found another way. I open the web inspector on the user page and search for "externalId" and found it. Thanks !

@meeb
Copy link
Owner

meeb commented Aug 2, 2022

Yep! That's exactly the same metadata, the channel ID is visible in the video page source code in some JSON as well as you've found.

@tehniemer
Copy link

@meeb This was really helpful; I think it would be a good idea to add the procedure to the README since this scenario can happen often.

@meeb
Copy link
Owner

meeb commented Sep 21, 2022

Yeah might do, it's just such a hack (and one that doesn't work 100% of the time) I was partially leaning towards not adding it as an official suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

5 participants