ericmedina024 / podcast-sponsor-block

SponsorBlock integration for podcasts
MIT License
46 stars 6 forks source link

Unable to add podcast with no description #3

Closed robgregg96 closed 7 months ago

robgregg96 commented 8 months ago

I am trying to add several podcasts that have no description and I get a 500 Internal Server Error from the webpage.

Below is the Trace log from my docker container that includes an example playlist.

[INFO] Generating RSS feed for YouTube playlist PLY155lJX6_wcTzyjW2sGB4sTT5ZkivwnN
[INFO] Grabbing episodes from YouTube playlist PLY155lJX6_wcTzyjW2sGB4sTT5ZkivwnN
[ERROR] Exception on /rss/youtube/this_past_weekend [GET]
 Traceback (most recent call last):
   File "/home/appuser/.local/lib/python3.12/site-packages/flask/app.py", line 1463, in wsgi_app
     response = self.full_dispatch_request()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/appuser/.local/lib/python3.12/site-packages/flask/app.py", line 872, in full_dispatch_request
     rv = self.handle_user_exception(e)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/appuser/.local/lib/python3.12/site-packages/flask/app.py", line 870, in full_dispatch_request
     rv = self.dispatch_request()
          ^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/appuser/.local/lib/python3.12/site-packages/flask/app.py", line 855, in dispatch_request
     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/appuser/.local/lib/python3.12/site-packages/flask/views.py", line 110, in view
     return current_app.ensure_sync(self.dispatch_request)(**kwargs)  # type: ignore[no-any-return]
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/appuser/.local/lib/python3.12/site-packages/flask/views.py", line 191, in dispatch_request
     return current_app.ensure_sync(meth)(**kwargs)  # type: ignore[no-any-return]
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/app/src/podcastsponsorblock/views/youtuberssview.py", line 177, in get
     generate_rss_feed(episode_feed, feed_options),
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/appuser/.local/lib/python3.12/site-packages/cachetools/__init__.py", line 737, in wrapper
     v = func(*args, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^^
   File "/app/src/podcastsponsorblock/views/youtuberssview.py", line 156, in generate_rss_feed
     return feed_generator.rss_str()
            ^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/appuser/.local/lib/python3.12/site-packages/feedgen/feed.py", line 398, in rss_str
     feed, doc = self._create_rss(extensions=extensions)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/appuser/.local/lib/python3.12/site-packages/feedgen/feed.py", line 267, in _create_rss
     raise ValueError('Required fields not set (%s)' % missing)
ValueError: Required fields not set (description)
robgregg96 commented 8 months ago

I was able to fix this by adding a podcasts.ini file with a manually added description, but I assume you may want to handle the error gracefully.

janjuafarooq commented 7 months ago

@robgregg96 I couldn't figure out how to get the podcasts.ini file to work correctly when deploying remotely using render, but I submitted this pr to fix the issue since I encountered the same thing https://github.com/ericmedina024/podcast-sponsor-block/pull/6

ericmedina024 commented 7 months ago

thanks for the report and solutions! I have merged #7 to fix this.