manolomartinez / greg

A command-line podcast aggregator
GNU General Public License v3.0
299 stars 37 forks source link

Some feeds stopped downloading with v0.4.8 #104

Closed rkirkpat closed 3 years ago

rkirkpat commented 3 years ago

Upgraded to greg v0.4.8 with pip and now many of my podcasts are failing to download with the following complaint. They are spread across a number of sources so I doubt anything changed in feeds to break things. The URLs for those two feeds are http://leoville.tv/podcasts/mbw.xml and https://www.spreaker.com/show/3389445/episodes/feed and are just examples of quite a few of my podcasts failing.

I cannot sync TwitMacBreakWeekly just now: document declared as us-ascii, but parsed as utf-8
I cannot sync TheWriterAlmanac just now: document declared as us-ascii, but parsed as utf-8

To get that error though I had to fix the below traceback first, replacing feed with target, then got the errors above.

Traceback (most recent call last):
  File "/usr/local/bin/greg", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/site-packages/greg/parser.py", line 138, in main
    function(vars(args))
  File "/usr/local/lib/python3.8/site-packages/greg/commands.py", line 187, in sync
    msg = ''.join(["I cannot sync ", feed, " just now: ",
TypeError: sequence item 1: expected str instance, Feed found

Chasing the document declared as... error, appears this commit, https://github.com/manolomartinez/greg/commit/f075f533d1b5e0943b3caf2b047847a5eab97daf, is what caused it to start bubbling up and aborting the downloads of the affected podcasts. Reverting just that commit enabled my affect podcasts to download just fine. Maybe this error should just be a warning and allow the podcast still to be downloaded?

System is MacOS 10.14.6, using Brew's Python 3.8.9.

manolomartinez commented 3 years ago

Thanks, I'll get to this later today, tomorrow at the latest.

manolomartinez commented 3 years ago

@rkirkpat, could you please check whether the above PR solves this issue?

Thanks, Manolo

rkirkpat commented 3 years ago

Confirmed that the above PR solves the issue for me, what was an error is now just a failure, e.g.:

sys:1: UserWarning: This feed is malformed (possibly in unimportant ways):
                        document declared as us-ascii, but parsed as utf-8
Checking TwitSecurityNow...
Done

Thank you!

manolomartinez commented 3 years ago

Great! I need to think a bit more about how to deal with warnings, but this'll do for now. Thanks for reporting.

fiskhandlarn commented 2 years ago

@manolomartinez i would like to use this fix, when can we expect a new version?