manolomartinez / greg

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

Skip temporarily failed entries #90

Open RileyStarlight opened 6 years ago

RileyStarlight commented 6 years ago

I love Greg, it's the best podcast downloader I've ever used.

I recently found a podcast that contained a bad URL entry. Greg at this point detects the failure and exits, leaving all the other podcasts that were not yet checked, unchecked or undownloaded.

To fix the problem, I manually edited the ~/Podcasts/.greg/data file and commented on the problematic podcast section, so that the others could synchronize. This solution worked, but when I went to uncomment the podcast to restore it to its initial state, I found that the commented section had disappeared. Apparently Greg regenerates the file every time instead of editing it. I had to add the sources of this podcast again to get back to normal. A few days later they corrected the faulty URL in the feed and everything worked again.

The question is, in this scenario, how can I omit a particular podcast source? I haven't found any documentation on the subject.

mattzab commented 4 years ago

I'm having the same issue. Some kind of "ignore errors" flag would be handy in this situation. I find problematic podcasts all the time. Usually it's that the date is wrong, and the next day that podcast is able to download just fine. Being able to ignore and continue instead of error out and exit would be amazing.

DidntAgreeToTermsOfService commented 1 year ago

I have run into this problem in the last year of using greg (podcasts which greg can't sync but which I want to keep checking in case they fix their problems). My solution was to write a sh script which uses 'greg list' into a temp file and then loops on the file line by line with 'greg sync ${i}' ($i is the loop variable so it changes on each loop). Each greg invocation is a process which can abend while the shell script will keep chugging. Its brute force but works so I have one command which I can run until each feed shows up as DONE or gives a consistent error.

Script below. If the script quits when you run into the first feed with an error, the fix is to tweak the shell config in this script so it ignores return codes. I'm not addressing how to do that here. I run greg as root on busybox. This script may need a sudo here or there on your machine if you are not running as root. ''============== CODE BELOW''

!/bin/sh

echo "" echo "Starting gregsync" echo "Use Bourne Shell to sync all podcast feeds with greg" echo "...number of tmp.xxxx files in /tmp: "ls /tmp/tmp.* | wc -l echo "#####################################" echo "# If this script abends, please cleanup /tmp dir. #" echo "#####################################" echo ""

PODLIST=$(mktemp) # Feeds TS=$(date +%s) # Time Stamp (start time) i=0 # holds feed name

echo "First get all Podcast feeds into a temp file" greg list | grep -v '^[[:space:]]*$' | sort -o $PODLIST

one doesn't need to sort but do remove the empty line

generated by 'greg list'

echo ""

echo "Now sync each podcast feed" echo ""

while read i ; do echo $i greg sync $i echo "" sleep 2 # not needed on a fast machine. Mine is sloooow done <$PODLIST

cleanup code

rm $PODLIST ls -l /tmp echo " " echo "=======================================" echo " Elapsed time "$((date +%s - $TS))" seconds" echo "gregsync DONE"