Skip to content

Some channels fail with TypeError: can only concatenate str (not "bool") to str #9

Description

@transplier

Thanks for this script, it makes TA much more usable for me!

Looks like some channel's descriptions get set to False (the bool, not the string), which causes things to crash. Please note that line numbers won't match up perfectly as I'm running some unrelated tweaks to the symlink code.

13-Jan-25 15:45:01 ta-helper.py:239 INFO     Processing new video from KingMNE94: 2017-07-06_8B4guKLlbVU_SUPER-EUROBEAT-MIX.mp4
13-Jan-25 15:45:01 ta-helper.py:87 INFO     Generating NFO file and subtitle symlink for KingMNE94 video: SUPER EUROBEAT MIX
13-Jan-25 15:45:01 ta-helper.py:80 INFO     ../../YouTube Archive/UCu67Dd9BDCUtDWheWEOkX5w/8B4guKLlbVU.en.vtt -> 2017-07-06_8B4guKLlbVU_SUPER-EUROBEAT-MIX.en.vtt in /mnt/343-booty/Video/YouTube Archive Friendly/KingMNE94
Traceback (most recent call last):
  File "/home/me/ta-helper/ta-helper.py", line 209, in <module>
    logger.debug("Video Description: " + description)
TypeError: can only concatenate str (not "bool") to str

If I add str calls around the offending lines, it proceeds fine.

13-Jan-25 15:52:54 ta-helper.py:250 DEBUG    Symlink exists for 2017-07-06_8B4guKLlbVU_SUPER-EUROBEAT-MIX.mp4
13-Jan-25 15:52:54 ta-helper.py:209 DEBUG    Video Description: False
diff --git a/ta-helper.py b/ta-helper.py
index d726d7b..1d16480 100644
--- a/ta-helper.py
+++ b/ta-helper.py
@@ -60,7 +60,7 @@ def setup_new_channel_resources(chan_name, chan_data):
             chan_data['channel_name'] + "</title>\n\t" +
             "<showtitle>" + chan_data['channel_name'] + "</showtitle>\n\t" +
             "<uniqueid>" + chan_data['channel_id'] + "</uniqueid>\n\t" +
-            "<plot>" + chan_data['channel_description'] + "</plot>\n\t" +
+            "<plot>" + str(chan_data['channel_description']) + "</plot>\n\t" +
             "<premiered>" + chan_data['channel_last_refresh'] + "</premiered>\n</episodedetails>")
     f.close()
 
@@ -206,7 +206,7 @@ while channels_json['paginate']['last_page']:
 for channel in channels_data:
     chan_name = urlify(channel['channel_name'])
     description = channel['channel_description']
-    logger.debug("Video Description: " + description)
+    logger.debug("Video Description: " + str(description))
     logger.debug("Channel Name: " + chan_name)
     if(len(chan_name) < 1): chan_name = channel['channel_id']
     chan_url = url+channel['channel_id']+"/video/"

Not sure why the description is being set to False. Perhaps it happens if the description is just empty, which it seems to be for the affected video in TA. On YouTube itself though the description appears to just be a couple emoji. https://www.youtube.com/watch?v=8B4guKLlbVU

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions