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

problem with channel #47

Closed
reddragonguy opened this issue Sep 27, 2020 · 11 comments
Closed

problem with channel #47

reddragonguy opened this issue Sep 27, 2020 · 11 comments
Labels
bug Something isn't working

Comments

@reddragonguy
Copy link

Hi,

the following channel doesn't seem to update properly. it doesn't pull channel or video information. Is there something else i need to do for this?

https://www.youtube.com/channel/UCe0TLA0EsQbE-MjuHXevj2A

thank you for the great plug-in.

@ZeroQI
Copy link
Owner

ZeroQI commented Sep 27, 2020

I need your agent log please

@reddragonguy
Copy link
Author

youtube agent.log

Here you go. Also, could you not log any secrets or tokens in the file.

@ZeroQI
Copy link
Owner

ZeroQI commented Sep 27, 2020

Can change the source if i know the line number or the text displayed

2020-09-27 02:05:13,436 (7fddb4ff9700) :  CRITICAL (model:192) - Exception serializing TV_Show with guid 'com.plexapp.agents.youtube://youtube|UCe0TLA0EsQbE-MjuHXevj2A|ATHLEAN-X™ [UCe0TLA0EsQbE-MjuHXevj2A]?lang=xn' (most recent call last):
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-a78fef9a9/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/modelling/model.py", line 190, in _write
    self._serialize(os.path.join(self._storage_path, subdir))
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-a78fef9a9/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/modelling/model.py", line 215, in _serialize
    el.set('id', self._id)
  File "lxml.etree.pyx", line 699, in lxml.etree._Element.set (lxml-2.3/src/lxml/lxml.etree.c:34531)
  File "apihelpers.pxi", line 563, in lxml.etree._setAttributeValue (lxml-2.3/src/lxml/lxml.etree.c:15781)
  File "apihelpers.pxi", line 1366, in lxml.etree._utf8 (lxml-2.3/src/lxml/lxml.etree.c:22211)
ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL bytes or control characters

/media/youtube/ATHLEAN-X™ [UCe0TLA0EsQbE-MjuHXevj2A]/S01E20200612 - All About Traps (COMPLETE GROWTH GUIDE!) [eqYNJLbxRkk].mp4

  • Did you try without the TM character in the foldername?

It seem to crash after the end of the metadata gathering with line 675 outputting
INFO (__init__:675) - =============================================================================================================================================================

  • it should be line 671 on latest code...

INFO (__init__:649) - metadata.seasons[ 1].episodes[2020900016] "S01E2020900016 - Do This Between E

  • this should be line 645 on latest code...

Are you using latest code?

@reddragonguy
Copy link
Author

i just updated the code. Here's the error from the new log file:

2020-09-27 16:55:04,027 (7fe719ffb700) :  INFO (__init__:671) - =============================================================================================================================================================
2020-09-27 16:55:04,028 (7fe719ffb700) :  CRITICAL (model:192) - Exception serializing TV_Show with guid 'com.plexapp.agents.youtube://youtube|UCe0TLA0EsQbE-MjuHXevj2A|ATHLEAN-X™ [UCe0TLA0EsQbE-MjuHXevj2A]?lang=xn' (most recent call last):
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-a78fef9a9/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/modelling/model.py", line 190, in _write
    self._serialize(os.path.join(self._storage_path, subdir))
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-a78fef9a9/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/modelling/model.py", line 215, in _serialize
    el.set('id', self._id)
  File "lxml.etree.pyx", line 699, in lxml.etree._Element.set (lxml-2.3/src/lxml/lxml.etree.c:34531)
  File "apihelpers.pxi", line 563, in lxml.etree._setAttributeValue (lxml-2.3/src/lxml/lxml.etree.c:15781)
  File "apihelpers.pxi", line 1366, in lxml.etree._utf8 (lxml-2.3/src/lxml/lxml.etree.c:22211)
ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL bytes or control characters

To answer your question about renaming the folder, i didn't try and it wouldn't help. The next time the channel is updated, ytdl will just recreate the same folder again with the TM in it.

Also, it seems when i Unmatch the series, the shows get their titles and descriptions, but when i match the series, they lose everything.

@ZeroQI
Copy link
Owner

ZeroQI commented Sep 27, 2020

None of the incriminated python lines are in the agent code so it seems Plex cannot saved metadata to their internal XML afterwards...
I could try to scrub the character if so, but not sure how yet as i already tried in the past to no avail

@reddragonguy
Copy link
Author

reddragonguy commented Sep 27, 2020

renaming the folder worked, but i noticed another issue that i previously hacked a fix for. It seems the show name in Plex has my folder name in it. I made a local edit previously to add this line: metadata.title = re.sub(r'/media/youtube/', '', metadata.title).strip(), but i couldn't figure out the right fix. It slso doesn't show the correct image for the show and ends up just using a random episode image.

here's the poster it uses:
image

and here's where the correct one is:

image

@ZeroQI
Copy link
Owner

ZeroQI commented Sep 27, 2020

we need to see if saving the impacted folder name without the problematic character works...

Found how to convert a string to xml to string to remove bad characters

from lxml import etree
xml_parser              = etree.XMLParser(recover=True)
cleaned_xml_string = etree.tostring( etree.fromstring(dirty_xml_string, parser=xml_parser) )

Source: https://stackoverflow.com/questions/57490580/removing-invalid-characters-from-xml-in-python3-with-etree

@ZeroQI
Copy link
Owner

ZeroQI commented Nov 22, 2020

instead of metadata.title = re.sub(r'/media/youtube/', '', metadata.title).strip() try metadata.title = os.path.basename(metadata.title)

@ZeroQI
Copy link
Owner

ZeroQI commented Dec 2, 2020

Any feedback?

@ZeroQI ZeroQI added bug Something isn't working invalid This doesn't seem right and removed bug Something isn't working labels Jan 6, 2021
@ZeroQI
Copy link
Owner

ZeroQI commented Jan 6, 2021

Any feedback?

@ZeroQI ZeroQI added bug Something isn't working and removed invalid This doesn't seem right labels Jan 6, 2021
@ZeroQI
Copy link
Owner

ZeroQI commented Feb 27, 2021

Will probably be resolved alongside #28
No reply to code suggestion

@ZeroQI ZeroQI closed this as completed Feb 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants