Kodi Community Forum
Beta Youtube Library - Printable Version

Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Video Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=154)
---- Thread: Beta Youtube Library (/showthread.php?tid=246110)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23


RE: Youtube Library - 3000 - 2017-12-04

@scott967

thank you. Here you go: http://paste.ubuntu.com/26114177


RE: Youtube Library - tofof - 2017-12-05

I am also getting the error "cannot find module apiclient.discovery". I have youtube library installed already, but this error happens at startup and every time I try to watch a .strm that the addon created.

There are some recent German/Dutch threads with the same issue in a different addon:
https://kodi-forum.nl/threads/no-module-named-apiclient-discovery.5590/
https://www.kodinerds.net/index.php/Thread/59513-Kodi-Backup-Addon-lässt-seit-kurzem-nicht-mehr-installieren-ausführen
https://github.com/robweber/xbmcbackup/issues/120

Apparently the problem is caused by an update to the google api, and so will affect everyone. 

As far as I can tell, apiclient was outdated/deprecated as far back as 2013 (https://stackoverflow.com/questions/18267749/importerror-no-module-named-apiclient-discovery).
The fix may well be as simple as changing scripts' calls to apiclient to call googleapiclient instead.

Edit: Success!
There were two locations that needed changed:
(kodi addon path)/plugin.video.youtubelibrary/resources/lib/ytube.py
(kodi addon path)/plugin.video.youtubelibrary/resources/lib/youtubeapi/apiclient/__init__.py

In the first, I simply commented out line 24 and uncommented line 23, i.e.
from googleapiclient.discovery import build
#from apiclient.discovery import build
Lines 23 and 24, not 1 and 2, obviously

In the second, I updated line 42:
  sys.modules['googleapiclient.%s' % module_name] = module
Lines 42, not line 1

Deleted the corresponding .pyo files, restarted kodi, and youtubelibrary is working again.


RE: Youtube Library - scott967 - 2017-12-05

Update:  posting across tofof's posts.  He's correct, also edit the __init__.py file.

tofof has it nailed.

Thanks for posting your log.  I could follow what was happening.

On my systems I have Kodi setting "notify of updates" so I don't get hit by pushed updates of modules.  I had script.module.googleapi 1.4.2 installed.  I manually updated to the current ver 1.6.4 and yup, the folder structure of that module was changed from "apiclient" to "googleapiclient".  The change was also pushed to oauth2client (which is what youtube uses to authenticate users).

A quick test confirms just changing youtubelibrary file ytube.py is enough to restore youtube library.  In fact that file is already setup so I guess the change was expected.  

In your kodi appdata find the addons folder and in there plugin.video.youtubelibrary/resources/lib/ytube.py

Open that file in text editor and remove the "#" from line 23 and add it in line 24 so those lines now look like:
Code:
from googleapiclient.discovery import build
#from apiclient.discovery import build

save your edits and you should be good to go until an updated gets released.

scott s.
.


RE: Youtube Library - 3000 - 2017-12-05

wow, really nice!! That fixed it. It's working again. Thank you very much @tofof and @scott967  Smile


RE: Youtube Library - pdops - 2017-12-05

(2017-12-05, 02:09)3000 Wrote: wow, really nice!! That fixed it. It's working again. Thank you very much @tofof and @scott967  Smile

+1 from me. Thanks guys


RE: Youtube Library - wheemer - 2017-12-07

I am getting image cannot be created errors when updating a playlist...


RE: Youtube Library - wheemer - 2017-12-07

Not very user friendly not being able to attach a log to this post...

13:38:59.417 T:10048   DEBUG: MICHS YoutubeLibrary:::::::: ERROR: Could not create file: 'smb://SERVER/Series/Bright Insight/folder.jpg'. Error message: ''module' object has no attribute 'getTempDir''


RE: Youtube Library - DarrenHill - 2017-12-07

Upload the log to PasteBin.Com or a similar site and post the link they will give you here.


RE: Youtube Library - wheemer - 2017-12-08

I honestly tried to do just that and pastbin gave me an error... The line I posted is the relevant error.


RE: Youtube Library - wheemer - 2017-12-08

Line 1407 of generators.py is this:

            target = os.path.join(os.path.getTempDir(), os.path.basename(filename))

Something about this code is wrong but I can't figure out exactly what


RE: Youtube Library - Sleuteltje - 2017-12-08

Yeah, i already expected the apiclient change, thats why that line was commented. Any way, its fixed now.
I also read some troubles with adding Musicvideo playlists, hopefully thats fixed now as well (alltho i gotta note that the whole musicvideo code needs to be reworked imho).
Someone asked for the option of only grabbing the last video, so there ya go.

3000, you posted a lot of questions. To answer one; resume playback is not supposed to work if you choose the official kodi YT addon for your playback. If you got more questions, try to put them orderly in one message and i will try to answer them. This goes for the rest as well Smile.
v0.9.9.1:

Code:
- Fixed deprecated googleapiclient dependency
- Added 1 to 'only grab X videos' option.
- Fixed lower of None error when adding musicvideos.
- Created fallback when poster of tv show is not found to just use the default.png instead of not playing the video at all.

Changes pushed, so everybody should get the update soon.

Strangly enough the notifications off this thread dont seem to come trough. I'll sort it out.


RE: Youtube Library - DarrenHill - 2017-12-08

(2017-12-08, 00:41)wheemer Wrote: I honestly tried to do just that and pastbin gave me an error... The line I posted is the relevant error.

If the log is too big for PasteBin then try paste.ubuntu.com


RE: Youtube Library - wheemer - 2017-12-08

Thanks Darren

I am getting image cannot be created errors when updating a playlist...

http://paste.ubuntu.com/26139929/


RE: Youtube Library - wheemer - 2017-12-08

Also when I delete a playlist and say yes to delete files, it doesn't delete them.

http://paste.ubuntu.com/26140114/


RE: Youtube Library - Sleuteltje - 2017-12-08

(2017-12-08, 17:12)wheemer Wrote: Thanks Darren

I am getting image cannot be created errors when updating a playlist...

http://paste.ubuntu.com/26139929/
Can you replace generators.py with the following one: https://raw.githubusercontent.com/Sleuteltje/plugin.video.youtubelibrary/smbfix/resources/lib/generators.py .
Please tell me if that fixes your issue, cause if so, i will push it to the main branch.