Sign up here and you can log into the forum!

Youtube3

UMSP Plugin Depot, the place for sharing plugins & info about them. No requests, just plugins/code.

Re: Youtube3   

Postby cybermcm » Fri Mar 11, 2016 10:14 am

I recently setup a new account. With this new account I'm not able to get my username:
find it out by going to https://www.youtube.com/user and you should be redirected to something like https://www.youtube.com/user/someyoutubeaccountname/

If I try this with my old account it works. If I try this with my new account I get redirected to https://www.youtube.com/channel/xxxxxxxxxxxxxxx

I have no idea what I have to put in the "YOUTUBE_USERS" field to get it working.
Any ideas?
User avatar
cybermcm
WDTVer
 
Posts: 25
Joined: Wed Apr 21, 2010 12:50 am

Re: Youtube3   

Postby mad_ady » Sun Mar 13, 2016 11:15 pm

It seems that if you log in and still type in https://www.youtube.com/user/ it takes you to the correct page where you can extract your username. Otherwise try with your login name (without dots)
User avatar
mad_ady
Developer
 
Posts: 4555
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: Youtube3   

Postby cybermcm » Sun Mar 13, 2016 11:37 pm

That doesn't work for my new account. I'm getting redirected to https://www.youtube.com/channel/xxxxxxxxxxxxxxxxxxxxxxxxx.
If I'm using my old account it works and I'm getting redirected to https://www.youtube.com/user/xxxxxx.

I tried to use my new login name without dots and also the channel ID, it doesn't seem to work. Is there a log file where I can check the answer from youtube (e.g. bad username)?
User avatar
cybermcm
WDTVer
 
Posts: 25
Joined: Wed Apr 21, 2010 12:50 am

Re: Youtube3   

Postby mad_ady » Sun Mar 13, 2016 11:53 pm

I doubt there is such an answer for youtube. The API makes the request and most likely doesn't receive a suitable reply back. You can enable debugging in
/tmp/umsp-plugins/youtube3/youtube3.php by changing:
Code: Select all
$logLevel = L_WARNING;


to

Code: Select all
$logLevel = L_DEBUG;


When you browse through the plugin you should see lots of output in /tmp/umsp-log.txt

I'd search for your issue on the Youtube APIv3 mailing lists: https://code.google.com/p/gdata-issues/
User avatar
mad_ady
Developer
 
Posts: 4555
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: Youtube3   

Postby cybermcm » Wed Mar 16, 2016 12:34 am

Thx for your reply. I'm currently a little busy in real life, I tried your suggestions yesterday. The log file isn't the answer because it only shows that there is no result for my username.

Before posting to a development group (I'm no developer)...
Is there a chance to get my username with my channelID (which I know)?
User avatar
cybermcm
WDTVer
 
Posts: 25
Joined: Wed Apr 21, 2010 12:50 am

Re: Youtube3   

Postby mad_ady » Wed Mar 16, 2016 3:01 am

I'm using this call: https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.channels.list

There's a parameter called forUsername where I supply the username you give me. I could also use "mine", but I would need to implement OAuth and that complicates matters a lot (so I didn't do it).

Details about the field: https://youtu.be/RjUlmco7v2M?t=260

It seems that the parameter is a legacy user name - which means your channel probably doesn't have one. https://support.google.com/youtube/answer/6180214?hl=en

Maybe you can add a username like this: https://www.reddit.com/r/youtube/comments/3lbfkd/i_want_to_remove_my_legacy_username/
User avatar
mad_ady
Developer
 
Posts: 4555
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: Youtube3   

Postby mad_ady » Wed Mar 16, 2016 6:18 am

@cybermcm: I thought about it some more. If you were to provide your channel ID I could easily pull subscriptions/likes/etc. I modified the code to look for channel IDs as well. For now you need to manually set your channelID like so:

Code: Select all
config_tool -c YOUTUBE_CHANNELS=your-channel-id-here,your-other-channel-id-here


And you should be able to view them in the user interface. Not sure how you extract the channel ID, but please let me know if it works (to add the config option in the webend).

Also, you need to reboot to get the latest plugin version
User avatar
mad_ady
Developer
 
Posts: 4555
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: Youtube3   

Postby cybermcm » Wed Mar 16, 2016 6:53 am

@mad_ady: great! Thx so much for your effort. I'll try as soon as possible an report back.
User avatar
cybermcm
WDTVer
 
Posts: 25
Joined: Wed Apr 21, 2010 12:50 am

Re: Youtube3   

Postby cybermcm » Wed Mar 16, 2016 12:53 pm

@mad_ady: You did it!
It works great providing the YouTube Channel ID.

How to extract the channel ID: Easiest way -> https://www.youtube.com/user will redirect you to https://www.youtube.com/channel/xxxxxxxx with a "new" google account
If you have an old account, just visit "My channel" and you'll get your id.

Great work! :D
User avatar
cybermcm
WDTVer
 
Posts: 25
Joined: Wed Apr 21, 2010 12:50 am

Re: Youtube3   

Postby mad_ady » Thu Mar 17, 2016 12:25 am

I'm glad to hear it works. I've updated the first post and also the plugin (added the WEC configuration part for YOUTUBE_CHANNELS). Could you update and see if WEC looks allright?
User avatar
mad_ady
Developer
 
Posts: 4555
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

PreviousNext

Return to UMSP Plugins

Who is online

Users browsing this forum: No registered users and 1 guest