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

Youtube Kids Support #1034

Open
obma opened this issue Dec 21, 2024 · 3 comments
Open

Youtube Kids Support #1034

obma opened this issue Dec 21, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@obma
Copy link

obma commented Dec 21, 2024

Guess this should be a feature request - although it might be a bug report or error on my side.

Today I tried to setup a kodi profile for my son and connect his youtube account with kodi. I can connect the account (google.com/devices two times - needs parents allowance for each). After a successfull login you get a "YouTube: forbidden" error on whatever item you choose (Watch Later, Abonnements, ...).

Since my own account works on another kodi profile, I guess the problem is the kids account of my son.

Just to be clear: I have copied api_keys.json to his profile.

@obma obma added the enhancement New feature or request label Dec 21, 2024
@MoojMidge
Copy link
Collaborator

There appear to be known issues with using the YouTube v3 Data API with kids accounts.

Last time I looked into it, it did not appear to be something that can be fixed by this addon, as the issues are on the Google/YouTube side of things.

I can have a look again, but can't do anything without a debug log showing the requests and errors.

@obma
Copy link
Author

obma commented Dec 21, 2024

2024-12-21 23:30:00.203 T:3870     info <general>: [plugin.video.youtube] Running: YouTube (7.0.9.2) on Omega (Kodi-21.1) with Python 3.11.9
                                                   Path: /
                                                   Params: {}
2024-12-21 23:30:01.118 T:3870    error <general>: [plugin.video.youtube] API error: forbidden
                                                   exc: |"error" in response JSON data|
                                                   message: |Access forbidden. The request may not be properly authorized.|
                                                   Request response:
                                                   {'error': {'code': 403, 'message': 'Access forbidden. The request may not be properly authorized.', 'errors': [{'message': 'Access forbidden. The request may not be properly authorized.', 'domain': 'youtube.common', 'reason': 'forbidden'}]}}
2024-12-21 23:33:03.896 T:3870     info <general>: [plugin.video.youtube] Running: YouTube (7.0.9.2) on Omega (Kodi-21.1) with Python 3.11.9
                                                   Path: /subscriptions/list/
                                                   Params: {'category_label': 'Abonnements'}
2024-12-21 23:33:04.026 T:3870    error <general>: [plugin.video.youtube] API error: forbidden
                                                   exc: |"error" in response JSON data|
                                                   message: |Access forbidden. The request may not be properly authorized.|
                                                   Request response:
                                                   {'error': {'code': 403, 'message': 'Access forbidden. The request may not be properly authorized.', 'errors': [{'message': 'Access forbidden. The request may not be properly authorized.', 'domain': 'youtube.common', 'reason': 'forbidden'}]}}
2024-12-21 23:33:04.027 T:3929    error <general>: GetDirectory - Error getting plugin://plugin.video.youtube/subscriptions/list/?category_label=Abonnements
2024-12-21 23:33:04.062 T:796     error <general>: CGUIMediaWindow::GetDirectory(plugin://plugin.video.youtube/subscriptions/list/?category_label=Abonnements) failed

@obma
Copy link
Author

obma commented Dec 21, 2024

Sorry - debug got lost when switching profiles.

2024-12-21 23:36:35.330 T:3997    debug <general>: [plugin.video.youtube] Got data for channels:
                                                   |['mine']|
2024-12-21 23:36:35.330 T:3997    debug <general>: [plugin.video.youtube] Get |youtube.folder.disliked_videos.show|: True (bool, success)
2024-12-21 23:36:35.331 T:3997    debug <general>: [plugin.video.youtube] Get |youtube.folder.history.show|: True (bool, success)
2024-12-21 23:36:35.332 T:3997    debug <general>: [plugin.video.youtube] Get |youtube.folder.playlists.show|: True (bool, success)
2024-12-21 23:36:35.332 T:3997    debug <general>: [plugin.video.youtube] Get |youtube.folder.subscriptions.show|: True (bool, success)
2024-12-21 23:36:35.333 T:3997    debug <general>: [plugin.video.youtube] Get |youtube.folder.bookmarks.show|: True (bool, success)
2024-12-21 23:36:35.333 T:3997    debug <general>: [plugin.video.youtube] Get |youtube.folder.browse_channels.show|: True (bool, success)
2024-12-21 23:36:35.334 T:3997    debug <general>: [plugin.video.youtube] Get |youtube.folder.completed.live.show|: True (bool, success)
2024-12-21 23:36:35.334 T:3997    debug <general>: [plugin.video.youtube] Get |youtube.folder.upcoming.live.show|: True (bool, success)
2024-12-21 23:36:35.335 T:3997    debug <general>: [plugin.video.youtube] Get |youtube.folder.live.show|: True (bool, success)
2024-12-21 23:36:35.335 T:3997    debug <general>: [plugin.video.youtube] Get |youtube.folder.switch.user.show|: True (bool, success)
2024-12-21 23:36:35.336 T:3997    debug <general>: [plugin.video.youtube] Get |youtube.folder.sign.out.show|: True (bool, success)
2024-12-21 23:36:35.336 T:3997    debug <general>: [plugin.video.youtube] Get |youtube.folder.settings.show|: True (bool, success)
2024-12-21 23:36:35.337 T:3997    debug <general>: [plugin.video.youtube] Get |youtube.folder.settings.advanced.show|: False (bool, success)
2024-12-21 23:36:35.337 T:3997    debug <general>: [plugin.video.youtube] Converting DirectoryItem |plugin://plugin.video.youtube/special/my_subscriptions/?category_label=Meine+Abonnements|
2024-12-21 23:36:35.338 T:3997    debug <general>: [plugin.video.youtube] Converting DirectoryItem |plugin://plugin.video.youtube/special/recommendations/?category_label=Empfehlungen|
2024-12-21 23:36:35.338 T:3997    debug <general>: [plugin.video.youtube] Converting DirectoryItem |plugin://plugin.video.youtube/special/related_videos/?category_label=%C3%84hnliche+Videos|
2024-12-21 23:36:35.339 T:3997    debug <general>: [plugin.video.youtube] Converting DirectoryItem |plugin://plugin.video.youtube/special/popular_right_now/?category_label=Angesagt|
2024-12-21 23:36:35.339 T:3997    debug <general>: [plugin.video.youtube] Converting DirectoryItem |plugin://plugin.video.youtube/kodion/search/list/?category_label=Suche|
2024-12-21 23:36:35.339 T:796     debug <general>: ------ Window Init (DialogNotification.xml) ------
2024-12-21 23:36:35.339 T:3997    debug <general>: [plugin.video.youtube] Converting DirectoryItem |plugin://plugin.video.youtube/location/mine/?category_label=Mein+Standort|
2024-12-21 23:36:35.340 T:3997    debug <general>: [plugin.video.youtube] Converting DirectoryItem |plugin://plugin.video.youtube/channel/mine/?category_label=Mein+Kanal|
2024-12-21 23:36:35.340 T:3997    debug <general>: [plugin.video.youtube] Converting DirectoryItem |plugin://plugin.video.youtube/kodion/watch_later/list/?category_label=Sp%C3%A4ter+ansehen|
2024-12-21 23:36:35.341 T:3997    debug <general>: [plugin.video.youtube] Converting DirectoryItem |plugin://plugin.video.youtube/special/disliked_videos/?category_label=Negativ+bewertete+Videos|
2024-12-21 23:36:35.341 T:3997    debug <general>: [plugin.video.youtube] Converting DirectoryItem |plugin://plugin.video.youtube/kodion/playback_history/?action=list&category_label=Verlauf|
2024-12-21 23:36:35.342 T:3997    debug <general>: [plugin.video.youtube] Converting DirectoryItem |plugin://plugin.video.youtube/channel/mine/playlists/?category_label=Wiedergabelisten|
2024-12-21 23:36:35.342 T:3997    debug <general>: [plugin.video.youtube] Converting DirectoryItem |plugin://plugin.video.youtube/subscriptions/list/?category_label=Abonnements|
2024-12-21 23:36:35.343 T:3997    debug <general>: [plugin.video.youtube] Converting DirectoryItem |plugin://plugin.video.youtube/kodion/bookmarks/list/?category_label=Lesezeichen|
2024-12-21 23:36:35.343 T:3997    debug <general>: [plugin.video.youtube] Converting DirectoryItem |plugin://plugin.video.youtube/special/browse_channels/?category_label=Kan%C3%A4le+suchen|
2024-12-21 23:36:35.343 T:3997    debug <general>: [plugin.video.youtube] Converting DirectoryItem |plugin://plugin.video.youtube/special/completed_live/?category_label=Live+abgeschlossen|
2024-12-21 23:36:35.345 T:3997    debug <general>: [plugin.video.youtube] Converting DirectoryItem |plugin://plugin.video.youtube/special/upcoming_live/?category_label=Live+bevorstehend|
2024-12-21 23:36:35.346 T:3997    debug <general>: [plugin.video.youtube] Converting DirectoryItem |plugin://plugin.video.youtube/special/live/?category_label=Live|
2024-12-21 23:36:35.346 T:3997    debug <general>: [plugin.video.youtube] Converting DirectoryItem |plugin://plugin.video.youtube/users/switch/?category_label=Benutzer+wechseln|
2024-12-21 23:36:35.347 T:3997    debug <general>: [plugin.video.youtube] Converting DirectoryItem |plugin://plugin.video.youtube/sign/out/?category_label=Abmelden|
2024-12-21 23:36:35.347 T:3997    debug <general>: [plugin.video.youtube] Converting DirectoryItem |plugin://plugin.video.youtube/config/setup_wizard/?category_label=Einrichtungsassistent|
2024-12-21 23:36:35.348 T:3997    debug <general>: [plugin.video.youtube] Applying content-type: |files| for |/|
2024-12-21 23:36:35.348 T:3997    debug <general>: [plugin.video.youtube] Get |youtube.view.label.details|: False (bool, success)
2024-12-21 23:36:35.351 T:3995    debug <general>: Thread waiting 1498403392 terminating
2024-12-21 23:36:35.378 T:796     debug <general>: ------ Window Deinit (DialogBusy.xml) ------
2024-12-21 23:36:35.378 T:796     debug <general>: Saving fileitems [plugin://plugin.video.youtube/]
2024-12-21 23:36:35.379 T:796     debug <general>:   -- items: 20, sort method: 0, ascending: false
2024-12-21 23:36:35.383 T:3998    debug <general>: Thread BackgroundLoader start, auto delete: false
2024-12-21 23:36:35.383 T:796     debug <general>: [threads] name: 'BackgroundLoader' priority: '1'
2024-12-21 23:36:35.400 T:3998    debug <general>: Thread BackgroundLoader 1431302720 terminating
2024-12-21 23:36:35.546 T:3997    debug <general>: [plugin.video.youtube] Profiling stats:          10597 function calls (10484 primitive calls) in 0.488 seconds
                                                   
                                                      Ordered by: cumulative time, internal time
                                                      List reduced from 858 to 20 due to restriction <20>
                                                   
                                                      ncalls  tottime  percall  cumtime  percall filename:lineno(function)
                                                           1    0.000    0.000    0.487    0.487 xbmc_plugin.py:64(run)
                                                           1    0.000    0.000    0.473    0.473 abstract_provider.py:146(navigate)
                                                           1    0.001    0.001    0.473    0.473 provider.py:1086(on_root)
                                                           1    0.000    0.000    0.449    0.449 resource_manager.py:266(get_related_playlists)
                                                           1    0.000    0.000    0.449    0.449 resource_manager.py:34(get_channels)
                                                           1    0.000    0.000    0.435    0.435 resource_manager.py:78(<listcomp>)
                                                           1    0.000    0.000    0.435    0.435 youtube.py:930(get_channels)
                                                           1    0.000    0.000    0.435    0.435 youtube.py:2011(api_request)
                                                           1    0.000    0.000    0.434    0.434 requests.py:76(request)
                                                           1    0.000    0.000    0.414    0.414 sessions.py:502(request)
                                                           1    0.000    0.000    0.389    0.389 sessions.py:673(send)
                                                           1    0.000    0.000    0.385    0.385 adapters.py:434(send)
                                                           1    0.000    0.000    0.378    0.378 connectionpool.py:595(urlopen)
                                                           1    0.000    0.000    0.374    0.374 connectionpool.py:380(_make_request)
                                                           1    0.000    0.000    0.264    0.264 connectionpool.py:1088(_validate_conn)
                                                           1    0.000    0.000    0.263    0.263 connection.py:609(connect)
                                                           1    0.000    0.000    0.151    0.151 connection.py:708(_ssl_wrap_socket_and_match_hostname)
                                                           1    0.000    0.000    0.151    0.151 ssl_.py:397(ssl_wrap_socket)
                                                           1    0.000    0.000    0.112    0.112 connection.py:197(_new_conn)
                                                           1    0.000    0.000    0.112    0.112 connection.py:27(create_connection)
                                                   
                                                   
                                                   
2024-12-21 23:36:35.547 T:3997    debug <general>: CPythonInvoker(17, /storage/.kodi/addons/plugin.video.youtube/resources/lib/plugin.py): script successfully run
2024-12-21 23:36:41.002 T:827     debug <general>: PushCecKeypress - received key  b duration 0
2024-12-21 23:36:41.038 T:796     debug <general>: HandleKey: 11 (0xb, obc244) pressed, window 10025, action is Select
2024-12-21 23:36:41.039 T:796     debug <general>: CGUIMediaWindow::GetDirectory (plugin://plugin.video.youtube/subscriptions/list/?category_label=Abonnements)
2024-12-21 23:36:41.039 T:796     debug <general>:   ParentPath = [plugin://plugin.video.youtube/]
2024-12-21 23:36:41.040 T:4016    debug <general>: Thread waiting start, auto delete: false
2024-12-21 23:36:41.123 T:3994    debug <general>: CAddonDatabase::SetLastUsed[plugin.video.youtube] took 83 ms
2024-12-21 23:36:41.123 T:4016    debug <general>: CScriptRunner: running add-on script YouTube('plugin://plugin.video.youtube/subscriptions/list/', '11', '?category_label=Abonnements')
2024-12-21 23:36:41.124 T:4016    debug <general>: GetLanguageInvoker - Reusing LanguageInvokerThread 17 for script /storage/.kodi/addons/plugin.video.youtube/resources/lib/plugin.py
2024-12-21 23:36:41.124 T:3997    debug <general>: initializing python engine.
2024-12-21 23:36:41.124 T:3997    debug <general>: CPythonInvoker(17, /storage/.kodi/addons/plugin.video.youtube/resources/lib/plugin.py): start processing
2024-12-21 23:36:41.124 T:3997    debug <general>: CPythonInvoker(17): adding args:
2024-12-21 23:36:41.124 T:3997    debug <general>: CPythonInvoker(17):  plugin://plugin.video.youtube/subscriptions/list/
2024-12-21 23:36:41.124 T:3997    debug <general>: CPythonInvoker(17):  11
2024-12-21 23:36:41.124 T:3997    debug <general>: CPythonInvoker(17):  ?category_label=Abonnements
2024-12-21 23:36:41.124 T:3997    debug <general>: CPythonInvoker(17):  resume:false
2024-12-21 23:36:41.124 T:3997    debug <general>: CPythonInvoker(17, /storage/.kodi/addons/plugin.video.youtube/resources/lib/plugin.py): entering source directory /storage/.kodi/addons/plugin.video.youtube/resources/lib
2024-12-21 23:36:41.124 T:3997    debug <general>: CPythonInvoker(17, /storage/.kodi/addons/plugin.video.youtube/resources/lib/plugin.py): instantiating addon using automatically obtained id of "plugin.video.youtube" dependent on version 3.0.0 of the xbmc.python api
2024-12-21 23:36:41.128 T:3997    debug <general>: [plugin.video.youtube] Starting Kodion framework by bromix...
2024-12-21 23:36:41.130 T:3997     info <general>: [plugin.video.youtube] Running: YouTube (7.0.9.2) on Omega (Kodi-21.1) with Python 3.11.9
                                                   Path: /subscriptions/list/
                                                   Params: {'category_label': 'Abonnements'}
2024-12-21 23:36:41.135 T:3997    debug <general>: [plugin.video.youtube] API request:
                                                   version: |3|
                                                   method: |GET|
                                                   path: |subscriptions|
                                                   params: |{'maxResults': '20', 'mine': 'true', 'prettyPrint': 'false', 'order': 'alphabetical', 'part': 'snippet'}|
                                                   post_data: |None|
                                                   headers: |{'Accept': '*/*', 'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'Host': 'www.googleapis.com', 'Authorization': '|logged in|', 'User-Agent': 'Mozilla/5.0 (Linux; Android 10; SM-G981B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Mobile Safari/537.36', 'DNT': '1', 'Accept-Encoding': 'gzip, deflate', 'Accept-Language': 'en-US,en;q=0.5'}|
2024-12-21 23:36:41.141 T:796     debug <general>: ------ Window Init (DialogBusy.xml) ------
2024-12-21 23:36:41.178 T:827     debug <general>: PushCecKeypress - received key  b duration 175
2024-12-21 23:36:41.301 T:3997    debug <general>: [plugin.video.youtube] API response: |403|
                                                   headers: |{'Vary': 'Origin, X-Origin, Referer', 'Content-Type': 'application/json; charset=UTF-8', 'Content-Encoding': 'gzip', 'Date': 'Sat, 21 Dec 2024 22:36:41 GMT', 'Server': 'scaffolding on HTTPServer2', 'X-XSS-Protection': '0', 'X-Frame-Options': 'SAMEORIGIN', 'X-Content-Type-Options': 'nosniff', 'Alt-Svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000', 'Transfer-Encoding': 'chunked'}|
2024-12-21 23:36:41.306 T:3997    error <general>: [plugin.video.youtube] API error: forbidden
                                                   exc: |"error" in response JSON data|
                                                   message: |Access forbidden. The request may not be properly authorized.|
                                                   Request response:
                                                   {'error': {'code': 403, 'message': 'Access forbidden. The request may not be properly authorized.', 'errors': [{'message': 'Access forbidden. The request may not be properly authorized.', 'domain': 'youtube.common', 'reason': 'forbidden'}]}}
2024-12-21 23:36:41.306 T:3997    debug <general>: [plugin.video.youtube] v3 response discarded: ||
2024-12-21 23:36:41.306 T:4016    error <general>: GetDirectory - Error getting plugin://plugin.video.youtube/subscriptions/list/?category_label=Abonnements
2024-12-21 23:36:41.306 T:4016    debug <general>: Thread waiting 1498403392 terminating
2024-12-21 23:36:41.318 T:796     debug <general>: ------ Window Deinit (DialogBusy.xml) ------
2024-12-21 23:36:41.319 T:796     error <general>: CGUIMediaWindow::GetDirectory(plugin://plugin.video.youtube/subscriptions/list/?category_label=Abonnements) failed
2024-12-21 23:36:41.319 T:796     debug <general>: CGUIMediaWindow::GetDirectory (plugin://plugin.video.youtube/)
2024-12-21 23:36:41.319 T:796     debug <general>:   ParentPath = [plugin://plugin.video.youtube/]
2024-12-21 23:36:41.319 T:3996    debug <general>: CAddonDatabase::SetLastUsed[plugin.video.youtube] took 0 ms
2024-12-21 23:36:41.321 T:796     debug <general>: Loading items: 20, directory: plugin://plugin.video.youtube/ sort method: 0, ascending: false
2024-12-21 23:36:41.326 T:4017    debug <general>: Thread BackgroundLoader start, auto delete: false
2024-12-21 23:36:41.327 T:796     debug <general>: [threads] name: 'BackgroundLoader' priority: '1'
2024-12-21 23:36:41.341 T:4017    debug <general>: Thread BackgroundLoader 1431302720 terminating
2024-12-21 23:36:41.410 T:3997    debug <general>: [plugin.video.youtube] Profiling stats:          5366 function calls (5333 primitive calls) in 0.178 seconds
                                                   
                                                      Ordered by: cumulative time, internal time
                                                      List reduced from 523 to 20 due to restriction <20>
                                                   
                                                      ncalls  tottime  percall  cumtime  percall filename:lineno(function)
                                                           1    0.000    0.000    0.176    0.176 xbmc_plugin.py:64(run)
                                                           1    0.000    0.000    0.175    0.175 abstract_provider.py:146(navigate)
                                                           1    0.000    0.000    0.175    0.175 yt_subscriptions.py:84(process)
                                                           1    0.000    0.000    0.173    0.173 yt_subscriptions.py:19(_process_list)
                                                           1    0.000    0.000    0.172    0.172 youtube.py:339(get_subscription)
                                                           1    0.000    0.000    0.172    0.172 youtube.py:2011(api_request)
                                                           1    0.000    0.000    0.170    0.170 requests.py:76(request)
                                                           1    0.000    0.000    0.165    0.165 sessions.py:502(request)
                                                           1    0.000    0.000    0.151    0.151 sessions.py:673(send)
                                                           1    0.000    0.000    0.147    0.147 adapters.py:434(send)
                                                           1    0.000    0.000    0.142    0.142 connectionpool.py:595(urlopen)
                                                           1    0.000    0.000    0.139    0.139 connectionpool.py:380(_make_request)
                                                           1    0.000    0.000    0.136    0.136 connection.py:435(getresponse)
                                                           1    0.000    0.000    0.134    0.134 client.py:1351(getresponse)
                                                           1    0.000    0.000    0.134    0.134 client.py:318(begin)
                                                          32    0.000    0.000    0.131    0.004 {method 'readline' of '_io.BufferedReader' objects}
                                                           2    0.000    0.000    0.131    0.066 socket.py:692(readinto)
                                                           2    0.000    0.000    0.131    0.065 ssl.py:1299(recv_into)
                                                           2    0.000    0.000    0.131    0.065 ssl.py:1157(read)
                                                           1    0.000    0.000    0.131    0.131 client.py:285(_read_status)
                                                   
                                                   
                                                   
2024-12-21 23:36:41.410 T:3997    debug <general>: CPythonInvoker(17, /storage/.kodi/addons/plugin.video.youtube/resources/lib/plugin.py): script successfully run
2024-12-21 23:36:55.508 T:796     debug <general>: ------ Window Deinit (DialogNotification.xml) ------
2024-12-21 23:37:11.320 T:3996    debug <general>: Thread JobWorker 1473225280 terminating (autodelete)
2024-12-21 23:37:11.320 T:3994    debug <general>: Thread JobWorker 1442898496 terminating (autodelete)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants