Back to my blog Back to my projects

Scripts

Changeset d949443


Ignore:
Timestamp:
02/24/12 08:56:58 (2 years ago)
Author:
Aurélien Bompard <aurelien@…>
Branches:
master
Children:
93cd0a4
Parents:
fc7bbfc
git-author:
Aurélien Bompard <aurelien@…> (02/24/12 08:56:58)
git-committer:
Aurélien Bompard <aurelien@…> (02/24/12 08:56:58)
Message:

rss-mirror: handle XML parsing errors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rss-mirror.py

    rc19ca33 rd949443  
    609609    downloader = choose_engine(config) 
    610610 
     611    if options.debug: 
     612        print "Getting feeds..." 
    611613    feeds = get_feeds(config) 
    612614    for feed in feeds[:]: 
     615        if options.debug: 
     616            print "Parsing %s" % feed.url 
    613617        try: 
    614618            feed.parse() 
     
    616620            print >>sys.stderr, "Failed downloading %s: %s" % (feed.url, e) 
    617621            feeds.remove(feed) 
     622        except etree.ParseError, e: 
     623            print >>sys.stderr, "Could not parse %s, skipping" % feed.url 
     624            feeds.remove(feed) 
    618625 
    619626    repo = Repository(config.get("DEFAULT", "output"), feeds) 
Note: See TracChangeset for help on using the changeset viewer.