xgi / castero

TUI podcast client for the terminal
MIT License
616 stars 37 forks source link

Cannot import pocket casts opml #176

Closed nadir-ishiguro closed 3 years ago

nadir-ishiguro commented 3 years ago

Hi,

first, let me thank you for this awesome tool.

My issue: When I try to import my podcasts.opml that I exported from PocketCasts I get the following error:

❯ castero --import ./podcasts.opml Added "On the Media" with 120 episodes Traceback (most recent call last): File "/usr/bin/castero", line 33, in sys.exit(load_entry_point('castero==0.9.3', 'console_scripts', 'castero')()) File "/usr/bin/castero", line 25, in importlib_load_entry_point return next(matches).load() File "/usr/lib/python3.9/importlib/metadata.py", line 77, in load module = import_module(match.group('module')) File "/usr/lib/python3.9/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "", line 855, in exec_module File "", line 228, in _call_with_frames_removed File "/usr/lib/python3.9/site-packages/castero/main.py", line 161, in main() File "/usr/lib/python3.9/site-packages/castero/main.py", line 96, in main import_subscriptions(vars(args)['import'], database) File "/usr/lib/python3.9/site-packages/castero/main.py", line 30, in import_subscriptions for generated in subscriptions.parse(): File "/usr/lib/python3.9/site-packages/castero/subscriptions.py", line 136, in parse feed = Feed(url=entry.attrib['xmlUrl']) File "/usr/lib/python3.9/site-packages/castero/feed.py", line 98, in init self._parse_metadata() File "/usr/lib/python3.9/site-packages/castero/feed.py", line 315, in _parse_metadata self._copyright = copyright_tag.text.strip() AttributeError: 'NoneType' object has no attribute 'strip'

My setup:

xgi commented 3 years ago

This is fixed with #177 - thanks for providing your .opml! The issue was just that one of your feeds didn't have a copyright value, which the parser expected.

I won't be ticking the castero version for some time, but you can get the update if you use castero-git (or manually clone+install from the repo). Thanks!