genzj / pybingwallpaper

Download wallpaper from bing.com
MIT License
547 stars 103 forks source link

illegal offset cause exception #1

Closed genzj closed 11 years ago

genzj commented 11 years ago
$ python33 main.py -o 3721 -dddd
[2013-09-18 11:08:51,152 - DEBUG - main] Namespace(debug=4, force=False, keep_fi
le_name=False, offset=3721, output_folder='c:/Documents and Settings/jmzhu\\MyBi
ngWallpapers', persistence=3, redownload=False, setter='win', setter_args=[''])
[2013-09-18 11:08:51,168 - DEBUG - setter] "e:\Work\Python\pybingwallpaper\src\w
insetter.py" seems like a setter
[2013-09-18 11:08:51,168 - DEBUG - setter] loading winsetter
[2013-09-18 11:08:51,183 - DEBUG - record] json file loaded:
{'http://www.bing.com/az/hprichbg/rb/SeudreRiver_ROW9225578092_1366x768.jpg': {'
url': 'http://www.bing.com/az/hprichbg/rb/SeudreRiver_ROW9225578092_1366x768.jpg
', 'time': '2013-09-18T10:49:03.121783', 'local_file': 'c:/Documents and Setting
s/jmzhu\\MyBingWallpapers\\wallpaper.jpg'}}
[2013-09-18 11:08:51,199 - DEBUG - record] history {'http://www.bing.com/az/hpri
chbg/rb/SeudreRiver_ROW9225578092_1366x768.jpg': {'url': 'http://www.bing.com/az
/hprichbg/rb/SeudreRiver_ROW9225578092_1366x768.jpg', 'time': '2013-09-18T10:49:
03.121783', 'local_file': 'c:/Documents and Settings/jmzhu\\MyBingWallpapers\\wa
llpaper.jpg'}} loaded
[2013-09-18 11:08:51,199 - DEBUG - main] BingWallpaperPage('http://www.bing.com/
HPImageArchive.aspx?format=js&idx=3721&n=3')
[2013-09-18 11:08:51,199 - INFO - bingwallpaper] loading from http://www.bing.co
m/HPImageArchive.aspx?format=js&idx=3721&n=3
[2013-09-18 11:08:51,199 - DEBUG - webutil] getting url http://www.bing.com/HPIm
ageArchive.aspx?format=js&idx=3721&n=3, headers {}
[2013-09-18 11:08:51,824 - DEBUG - webutil] Hit <http.client.HTTPResponse object
 at 0x00F01AB0> 200
[2013-09-18 11:08:51,824 - PAGEDUMP - webutil] b'null'
[2013-09-18 11:08:51,824 - INFO - bingwallpaper] 4 bytes loaded
[2013-09-18 11:08:51,824 - DEBUG - bingwallpaper] None
Traceback (most recent call last):
  File "main.py", line 179, in <module>
    filerecord = download_wallpaper(config)
  File "main.py", line 97, in download_wallpaper
    s.load()
  File "e:\Work\Python\pybingwallpaper\src\bingwallpaper.py", line 61, in load
    self.__loaded = self._parse(rawfile)
  File "e:\Work\Python\pybingwallpaper\src\bingwallpaper.py", line 43, in _parse

    self.__images = list(filter(lambda i:i['wp'], self.content['images']))
TypeError: 'NoneType' object is not subscriptable