GithubHelp home page GithubHelp logo

pybingwallpaper's Introduction

PyBingWallpaper

What pybingwallpaper does

Download the wallpaper offered by Bing.com and set it current wallpaper background.

Another project for the same purpose but download from National Geographic can be found here


Auto startup

Windows

Download installer from releases page and install it.

**Note: Please backup the `settings.conf` under the installation path before upgrading!**

**注意:建议升级前备份安装目录下的`settings.conf`文件!**

A shortcut will be created in your startup folder. You can edit the configuration to adjust features.

Linux with Gnome

You just need to add a startup application:

gnome-session-properties

then add a startup program with:

Name: pybingwallpaper
Command: python3 /path/to/pybingwallpaper/src/main.py -b
Comment: download and update wallpaper!

You can also append arguments in Command box.


Usage

usage: pybingwallpaper [-h] [-v] [--config-file CONFIG_FILE]
                       [--generate-config] [-b] [--foreground]
                       [-c {au,br,ca,cn,de,fr,jp,nz,us,uk,auto}]
                       [--market MARKET] [-d] [-i INTERVAL] [-k]
                       [-m {prefer,collect,highest,insist,manual,never}]
                       [--collect COLLECT] [--image-size IMAGE_SIZE]
                       [-o OFFSET] [--proxy-server PROXY_SERVER]
                       [--proxy-port PROXY_PORT]
                       [--proxy-username PROXY_USERNAME]
                       [--proxy-password PROXY_PASSWORD] [--redownload]
                       [-s {no,win,gnome2,gnome3}] [--setter-args SETTER_ARGS]
                       [-t OUTPUT_FOLDER] [--database-file DATABASE_FILE]
                       [--database-no-image] [--server {global,china,custom}]
                       [--custom-server CUSTOMSERVER]

Download the wallpaper offered by Bing.com and set it current wallpaper
background.

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show version information
  --config-file CONFIG_FILE
                        'specify configuration file, use `settings.conf` in
                        installation directory by default.
  --generate-config     generate a configuration file containing arguments
                        specified in command line and exit. to generate
                        default config file, issue without other command
                        arguments. path and name of configuration file can be
                        specified with --config-file
  -b, --background      work in background (daemon mode) and check wallpaper
                        periodically (interval can be set by --interval).
  --foreground          force working in foreground mode to cancel the effect
                        of `background` in config file.
  -c {au,br,ca,cn,de,fr,jp,nz,us,uk,auto}, --country {au,br,ca,cn,de,fr,jp,nz,us
,uk,auto}
                        select country code sent to bing.com. bing.com in
                        different countries may show different backgrounds.
                        au: Australia br: Brazil ca: Canada cn: China
                        de:Germany fr: France jp: Japan nz: New Zealand us:
                        USA uk: United Kingdom auto: select country according
                        to your IP address (by Bing.com) Note: only China(cn),
                        New Zealand(nz) and USA(us) have high resolution
                        (1920x1200) wallpapers; the rest offer 1366x768 only.
  --market MARKET       specify market from which the wallpaper should be
                        downloaded. Market is a more generic way to specify
                        language-country of bing.com. The list of markets may
                        grow sometimes, and different language of the same
                        country may have different image, so consider using it
                        instead of country. Market code should be specified in
                        format 'xy-ab' such as en-us. Note: specify this
                        parameter will override any settings to --country.
  -d, --debug           enable debug outputs. The more --debug the more
                        detailed the log will be
  -i INTERVAL, --interval INTERVAL
                        interval between each two wallpaper checkings in unit
                        of hours. applicable only in `background` mode. at
                        lease 1 hour; 2 hours by default.
  -k, --keep-file-name  keep the original filename. By default downloaded file
                        will be renamed as 'wallpaper.jpg'. Keep file name
                        will retain all downloaded photos
  -m {prefer,collect,highest,insist,manual,never,uhd}, --size-mode {prefer,collect,highest,insist,manual,never,uhd}
                        set selecting strategy when wallpapers in different
                        size are available (4K, 1920x1200, 1920x1080 and
                        1366x768). `prefer` (default) detect and download the
                        highest available resolution; `insist` always use
                        1920x1200 resolution and ignore other pictures (Note:
                        some countries have only normal size wallpapers, if
                        `insist` is adopted with those sites, no wallpaper can
                        be downloaded, see `--country` for more); `highest` is
                        an alias of `prefer` `never` always use normal
                        resolution (1366x768); `manual` use resolution
                        specified in `--image-size` `collect` is obsolete and
                        only kept for backward compatibility, equals `prefer`
                        mode together with --collect=accompany option. `uhd`
                        insists using 4K resolution, or abort wallpaper
                        downloading if it's not available.
  --collect COLLECT     items to be collected besides main wallpaper, can be
                        assigned more than once in CLI or as comma separated
                        list from config file. currently `accompany`, `video`
                        and `hdvideo` are supported. `accompany` - some
                        markets (i.e. en-ww) offers two wallpapers every day
                        with same image but different Bing logo (English and
                        Chinese respectively). enables this will download both
                        original wallpaper and its accompanyings. `video` -
                        bing sometimes (not everyday) release interesting
                        animated mp4 background, use this to collect them.
                        `hdvideo` - HD version of video.
  --image-size IMAGE_SIZE
                        specify resolution of image to download. check
                        `--size-mode` for more
  -o OFFSET, --offset OFFSET
                        start downloading from the photo of 'N' days ago.
                        specify 0 to download photo of today.
  --proxy-server PROXY_SERVER
                        proxy server url, ex: http://10.1.1.1
  --proxy-port PROXY_PORT
                        port of proxy server, default: 80
  --proxy-username PROXY_USERNAME
                        optional username for proxy server authentication
  --proxy-password PROXY_PASSWORD
                        optional password for proxy server authentication
  --redownload          do not check history records. Download must be done.
                        downloaded picture will still be recorded in history
                        file.
  -s {no,win,gnome2,gnome3}, --setter {no,win,gnome2,gnome3}
                        specify interface to be called for setting wallpaper.
                        'no' indicates downloading-only; 'gnome2/3' are only
                        for Linux with gnome; 'win' is for Windows only.
                        Customized setter can be added as dev doc described.
                        Default: win for win32, gnome3 for Linux
  --setter-args SETTER_ARGS
                        arguments for external setters
  -t OUTPUT_FOLDER, --output-folder OUTPUT_FOLDER
                        specify the folder to store photos. Use
                        '~/MyBingWallpapers' folder in Linux, 'C:/Documents
                        and Settings/<your-username>/MyBingWallpapers in
                        Windows XP or 'C:/Users/<your-
                        username>/MyBingWallpapers' in Windows 7 by default
  --database-file DATABASE_FILE
                        specify the sqlite3 database used to store meta info
                        of photos. leave it blank to disable database storage.
  --database-no-image   images will be embedded into database by default.
                        Exclude images from database can reduce the size of
                        database file.
  --server {global,china,custom}
                        select bing server used for meta data and wallpaper
                        pictures. it seems bing.com uses different servers and
                        domain names in china. global: use bing.com of course.
                        china: use s.cn.bing.net. (note: use this may freeze
                        market or country to China zh-CN) custom: use the
                        server specified in option "customserver"
  --custom-server CUSTOMSERVER
                        specify server used for meta data and wallpaper photo.
                        you need to set --server to 'custom' to enable the
                        custom server address.

Release Note

  • 2021-03-19 1.6.0

    • Support UHD resolution (#63)
    • highest mode is an alias of prefer now.
  • 2019-04-30 1.5.5

    • Compatible with Bing's new URL format (accompany pictures this time, #55 #56)
  • 2019-03-15 1.5.4

    • Compatible with Bing's new URL format
  • 2016-04-06 1.5.1

    • Minor bug fix for Python 3.5 (#43)
    • Obsolete 1.5.0 due to MS Windows Defender raise (false) alarm on the installer (#44)
  • 2015-12-08 1.5.0

    • Can collect video now! (#34)
    • Decouple collect mode from market setting (#35)
    • Better compatibility with win 8 and higher (#31 and #40)
    • Avoid deleting collected wallpaper at uninstallation (#33)
  • 2014-09-08 1.4.4

    • Support configurable bing server address (#27)
  • 2014-04-18 1.4.4b01

    • Support download records database (#18), you can build you own bing album now.
  • 2013-12-24 1.4.3

    • Fix #13 enhance robustness of network connection status: retry in 60 seconds after network failure
    • Fix #14 download image with Chinese logo whenever a 1920x1200 picture is downloaded: add a collect mode, read use collect mode 使用收集模式 for more
    • Fix #15 use n=1 instead of n=10 for more backtracking room: change default n to 1
    • Fix #16 can't read settings.conf when run out of installation dir: read settings.conf from the same path of main.py by default
  • 2013-12-24 1.4.2

  • 2013-12-21 1.4.1

    • Background mode bugfix
  • 2013-12-21 1.4.0

    • Use configuration file;
    • Support specify market
    • Support manually set picture resolution
    • Support downloading 1920x1080 images for pages without wallpaper link
  • 2013-09-24 1.3.0

    • supports high resolution wallpapers
    • change default checking interval to 2 hours
    • obsolete option -f and --persistence
    • fix none type error when offset exceeds boundary issue #2
    • fix none type error when download picture fails issue #3

pybingwallpaper's People

Contributors

genzj avatar tarunavba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pybingwallpaper's Issues

put default download folder into application dir

don't use user folder any more on win32. just put downloading files and history file under application installation folders.
test following startup scenarios:

  1. open prog directly in installation file
  2. by short-cut
  3. from run dialog
  4. from command line but in other working directory

Extend "collect" parameter to all markets

Hi

Another request for genzj when he is available for this application.

Sometimes there are Chinese Bing logos for markets other than EN-WW (ROW filenames) like this FR-FR pair:

http://www.bing.com/az/hprichbg/rb/CribFiguresMarseille_FR-FR11175577358_1920x1200.jpg
http://www.bing.com/az/hprichbg/rb/CribFiguresMarseille_FR-FR11175577358_ZH_1920x1200.jpg

The extension of "collect" for other markets should also be done for ZH-CN. For ex. the following wallpaper does not exist in standard nomenclature, without "ZH":

http://www.bing.com/az/hprichbg/rb/BerlinWall_ZH-CN13913064474_ZH_1920x1200.jpg

tks

zulrak

can't read settings.conf when run out of installation dir

$ py -3 src/main.py
Traceback (most recent call last):
  File "src/main.py", line 534, in <module>
    run_config = load_config(configdb)
  File "src/main.py", line 481, in load_config
    conf_config = config.from_file(configdb, run_config.config_file)
  File "e:\Work\Python\pybingwallpaper\src\config.py", line 341, in from_file
    with open(filename, 'r', encoding='utf-8') as inf:
FileNotFoundError: [Errno 2] No such file or directory: 'settings.conf'

$ pwd
/E/Work/Python/pybingwallpaper

use market instead of country code

country code cc in resource url is not so precise as market, however installers use country instead of market for beginners.

obsolete cc from code and translate common countries to corresponding market id while downloading.

enhance robustness of network connection status

If network connection hasn't been connected (like during startup), an error may happen. No matter if there is an error, next downloading can only happen several hours after then.

we need better behaviour.

Suggestion

It would be nice to have the ability to download all the images of a day available in each country. By using the same name for each same image, you can avoid to have it multiple times. The image fescription should be a good choice. Either, without overwriting highres images with lowres ones :)

Add a parameter to record wallpaper descriptions

Each Bing Wallpaper, besides its name, as a description in "copyright" tag of HPimageArchive output. That description can now be seen in batch execution of Pybingwallpapper but it is not recorded. Example:

[2014-02-20 11:39:02,716 - INFO - main] Nashornpelikan, Red River, Lockport, Manitoba, Kanada (© Ken Gillespie/Corbis) photo list: ('http://www.bing.com/az/hprichbg/rb/AmericanWhitePelican_DE-DE14121520207_1920x1080.jpg',)

It would be nice if Pybingwallpaper could write in a separate file, adding in a new line for each execution, the pair "filename/description" of each wallpaper downloaded.

tks

Error occurs when installing

安装界面到最后一步,进度条到一半时会出现如下这个错误:
erroe
安装你的另一个软件ng wallpaper时也出现同样的情况,请问是什么原因,该如何解决?谢谢!

我的系统: win7旗舰版 x64

能否更换壁纸下载地址?

环境:win7 x64 和 xp
壁纸地区:**

能否将下载地址如:
http://www.bing.com/az/hprichbg/rb/GhostTownBannock_ZH-CN7633622473_1920x1200.jpg
替换为:
http://s.cn.bing.net/az/hprichbg/rb/GhostTownBannock_ZH-CN7633622473_1920x1200.jpg

bing.com的图片地址基本上无法访问,用代理可以,不过在办公室里不方便搭建代理服务。s.cn.bing.net地址速度很快无需代理。之前一直配置pybingwallpaper使用privoxy,利用privoxy的redirect规则将www.bing.com替换为s.cn.bing.net,后来删掉privoxy了,希望pybingwallpaper自身能提供选项帮助设置。

Configuration of selecting the country is not working.

version: 1.4.4
os: win7
Whether I edit the settings.conf or use cli to change the country, the wall paper is always the same(俯瞰北京长安街 9/10).

By the way, I wonder how you find the wall paper download address
(/HPImageArchive.aspx?format=js&mbl=1&idx=0&n=1&cc=us).

Through ImgViewer function?

为什么设置的壁纸是带水印的?

我看了一下bingwallpaper.py里面的路径,我把url单独拉出来试一下应该是无水印的,为什么系统设置完的wallpaper是带水印的?谢谢

win10 cygwin exit with gnome3

Hi,

我再win10上 cygwin/python3跑的,提示gnome3然后就退出了,怎么避免呢?
[2016-01-07 10:14:43,593 - INFO - main] download photo of "摩洛哥,马扎甘葡萄牙城 (© Michele Falzone/AWL/plainpicture)"
[2016-01-07 10:14:43,817 - INFO - main] file saved /home/C5197505/MyBingWallpapers/wallpaper.jpg
Traceback (most recent call last):
File "src/main.py", line 702, in
start_daemon()
File "src/main.py", line 597, in start_daemon
main(daemon)
File "src/main.py", line 574, in main
s = setter.get(run_config.setter)()
File "/home/C5197505/pybingwallpaper/src/setter.py", line 72, in get
'unregistered setter {}'.format(name))
NameError: unregistered setter gnome3

BRs,
Hua

Temp file wallpaper.bmp

Hi if possible move to temp location wallpaper.bmp, and keep only .jpg file on real output path location.
file wallpaper.bmp, or delete after download files bing.

自启动项和安装路径问题

自启动快捷方式似乎有一个参数-b,也就是说即使settings.conf设置了Background = False,该程序仍然会因为自启动项的设置而强制在后台运行了,请问能否修改默认设置,改成不带参数的?
另外,win7开始对program file文件夹的权限限制变得比较死,所以默认安装在那里就会导致修改setting.conf比较麻烦,非要在开始菜单右键选择以管理员身份运行才行。建议可以修改默认设置,改为在%appdata%\Genzj\PyBingWallpaper下安装~

Add new column "StartDate" to database-file

New release 1.4.4 already has a new column "market" and has the possibility of no image in database.

For people who organize Bing wallpapers in their personal collections by market and by date, and mainly for programmers that publish Bing wallpapers in websites, it would be of tremendous importance if Bing issue date, output field "startdate" (yyyymmdd) of HPImageArchive, could be added as a new column in database-file.

tks

ubuntu启动报错

loading from http://www.bing.com/HPImageArchive.aspx?format=js&mbl=1&idx=0&n=1&video=1
[2016-03-07 15:34:34,587 - CRITICAL - main] error happened during loading from bing.com.
Traceback (most recent call last):
File "main.py", line 427, in download_wallpaper
s.load()
File "/home/ls/Github/pybingwallpaper/src/bingwallpaper.py", line 222, in load
rawfile = webutil.loadpage(self.url)
File "/home/ls/Github/pybingwallpaper/src/webutil.py", line 83, in loadpage
data = loadurl(url, headers=headers, optional=optional)
File "/home/ls/Github/pybingwallpaper/src/webutil.py", line 74, in loadurl
data = con.read(-1)
File "/usr/lib/python3.5/http/client.py", line 447, in read
b = bytearray(amt)
ValueError: negative count

配置文件未生成 win10

安装的时候,并没有生成setting.config
是要另外自己写配置吗?
哦对了,还提示msvcr100.dll不存在,另外补得。新装win10,只有本身自带的库。

代理环境下无法更新壁纸

收到你回复的信息,但是在小众软件没有看到,所以到这里来回复。我的是HTTP代理,验证方式应该是Windows的登录信息吧,因为是公司里的网络环境,代理的用户名和密码都是空的。

use n=1 instead of n=10 for more backtracking room

Sorry, I have another request.

HPImageArchive allows values of idx until value of 19. It errors if idx>19.
"n" is the number of days returned after the value of idx. If n=1 it always
gives good information. But if the sum of "idx" plus "n" is greater than 23
returned filenames are not what they should be.

Pybingwallpaper uses always n=10, but only treats first filename returned
so it useless to have n=10. Then should be enough n=1.

If pybingwallpaper uses n=1 it could download wallpapers back to 19 days.
Now (n=10) it only can download wallpapers back to 13 days (idx=13). From
idx=14 to idx=19 always gives current day wallpaper, equivalent to idx=0.
From 20 on it errors, like should be.

With n=1 one could have more 6 days backwards.

tks

无法打开

pybingwp-1 4 2 error
今天启动电脑突然就打不开了,前面一直使用正常,电脑应该没有做过改动。
Win7,64位系统,代理环境

TypeError in main.py when download picture failed

if download from api succeed but download picture failed, following error occurs:

---------------------------
cx_Freeze: Python error in main script
---------------------------
Traceback (most recent call last):
  File "D:\code\bin\Python33\lib\site-packages\cx_Freeze\initscripts\Console3.py", line 27, in <module>
  File "./src/main.py", line 227, in <module>
  File "./src/main.py", line 217, in start_daemon
  File "./src/main.py", line 191, in main
  File "./src/main.py", line 132, in download_wallpaper
TypeError: 'NoneType' does not support the buffer interface

---------------------------
OK   
---------------------------

希望卸载时仅删除安装程序释放的目录与文件

我将图片的保存位置设置在pybingwallpaper的安装目录内,起了个名字叫wallpaper。上次升级到1.44时使用自带的卸载程序卸载,发现卸载程序直接删掉pybingwallpaper这个安装目录,连带我自己建立的文件夹和图片文件一并删了。
希望卸载检测更严格一些。

幻灯片桌面背景

在 Win 7 , Win 8 下面,可以以幻灯片方式组织多张照片作为背景。
既然这个工具能够保留以前下载的照片,那能不能将新下载的照片和以前的照片集合在一起作为幻灯片桌面呢?

现在可以自己手动选择多张照片,但是一旦更新,就会重置为单张照片作为桌面。
要是能改成:新下载的照片自动加入到既有的幻灯片序列中, 就太好了。

unable install over linux

Hi, I clone project but i couldn't install your package

at first i get error in dependency

$ sudo python setup.py --build
Traceback (most recent call last):
  File "setup.py", line 1, in <module>
    from cx_Freeze import setup, Executable
ImportError: No module named cx_Freeze

but again there is issues

$ python setup.py --build
Traceback (most recent call last):
  File "setup.py", line 4, in <module>
    from main import REV
  File "src/main.py", line 9, in <module>
    import record
  File "src/record.py", line 7, in <module>
    from collections import UserDict
ImportError: cannot import name UserDict

What is the problem? why this package there isn't in pip ? also i use pip from git but didn't help at all!


I found your package is python 3 package

I use pip3 but not work again
1- install cx_freeze
2- use pip

$ sudo pip3 install git+https://github.com/genzj/pybingwallpaper.git
Downloading/unpacking git+https://github.com/genzj/pybingwallpaper.git
  Cloning https://github.com/genzj/pybingwallpaper.git to /tmp/pip-141u0wi0-build
  Running setup.py (path:/tmp/pip-141u0wi0-build/setup.py) egg_info for package from git+https://github.com/genzj/pybingwallpaper.git
    
Installing collected packages: PyBingWallpaper.exe
  Running setup.py install for PyBingWallpaper.exe
    usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: -c --help [cmd1 cmd2 ...]
       or: -c --help-commands
       or: -c cmd --help
    
    error: option --single-version-externally-managed not recognized
    Complete output from command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-141u0wi0-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-5gbihb6e-record/install-record.txt --single-version-externally-managed --compile:
    usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]

   or: -c --help [cmd1 cmd2 ...]

   or: -c --help-commands

   or: -c cmd --help



error: option --single-version-externally-managed not recognized

----------------------------------------
Cleaning up...
Command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-141u0wi0-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-5gbihb6e-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-141u0wi0-build
Storing debug log for failure in /home/argus/.pip/pip.log

also I use python3 setup.py

user@ubuntu:~/projects/pybingwallpaper-master$ sudo python3.4 setup.py build
running build
running build_exe
error: error in setup script: command 'build_exe' has no such option 'compressed'
user@ubuntu:~/projects/pybingwallpaper-master$ sudo python3.4 setup.py install
running install
running build
running build_exe
error: error in setup script: command 'build_exe' has no such option 'compressed'

illegal offset cause exception

$ 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

Add parameter to collect Bing homepage videos

Hi

I know that genzj has things to do in his house much more important than Bing wallpapers but anyway here is another request for pybingwallpaper ...

More and more Bing homepages are becoming animated. That is done with videos in format .mp4 (also in .ogv).

It is possible to access those videos, when available, adding argument "video=1" to HPImageArchive call. That adds some extra information to its output:

"vid":{"sources":[["mp4","video/mp4; codecs="avc1.42E01E, mp4a.40.2"","//az29176.vo.msecnd.net/videocontent/SiberianChipmunk_shutterstock_v2433068_768_EN-US.mp4"],["mp4hd","video/mp4; codecs="avc1.42E01E, mp4a.40.2"","//az29176.vo.msecnd.net/videocontent/SiberianChipmunk_shutterstock_v2433068_1080_HD_EN-US.mp4"]],"loop":true,"image":"//az29176.vo.msecnd.net/videocontent/SiberianChipmunk_shutterstock_v2433068_768_EN-US1456170433.jpg","caption":"Siberian chipmunk eating sunflower seeds, Hokkaido, Japan (© Shutterstock)",

In this case the video is here:

http://az29176.vo.msecnd.net/videocontent/SiberianChipmunk_shutterstock_v2433068_1080_HD_EN-US.mp4

or here:

http://www.bing.com/az/hprichv/SiberianChipmunk_shutterstock_v2433068_1080_HD_EN-US.mp4

This video matches this wallpaper:

http://www.bing.com/az/hprichbg/rb/SiberianChipmunk_EN-US13340331117_1366x768.jpg

The request is to add a parameter in Pybingwallpaper to also collect these videos, besides wallpapers.

Tks

zulrak

Download image with Chinese logo whenever a 1920x1200 picture is downloaded

Automatically download Chinese version of 1920x1220 ROW wallpaper (with
Chinese Bing logo) whenever a standard 1920x1200 ROW wallpaper is
downloaded.

Every day there is a standard 1920x1200 en-ww (ROW) wallpaper with standard
Bing logo and the same wallpaper image with Chinese Bing logo, just
inserting "_ZH" before "1920x1200" . See:

http://www.bing.com/az/hprichbg/rb/EdinburghCastle_ROW9843572408_1920x1200.jpg
http://www.bing.com/az/hprichbg/rb/EdinburghCastle_ROW9843572408_ZH_1920x1200.jpg

关于自动生产的bmp文件

作者您好,看到小众软件那边您的回复,发现生成bmp是为了设置成桌面背景。
但是启用了keep-file-name参数后,是否会导致那个文件夹会有大量bmp文件?
(我是今天第一天使用,没具体测试)
如果的确会有的话,是否可以改成每次转bmp都恒定转成wallpaper.bmp,而不跟随原始文件名?
这样不仅可以保留每天的jpg图片,而且可以避免产生大量无用的bmp文件。
毕竟bmp文件除了设置桌面,没啥用,而且文件大小还比较大。

谢谢。

WinError 183

Hi.
For some time now, it happen this error eevry time i launch pybingwallpaper executable. I have already tried to change directory, or removing contents, but after some time the problem appears again. Any advice?

Thanks!
error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.