genzj / pybingwallpaper

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

Suggestion #32

Open Bwallpaper opened 9 years ago

Bwallpaper commented 9 years ago

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 :)

zulrak1 commented 9 years ago

The concept of "day" is not absolute in Bing wallpapers because they are issued at different hours each day according to each market. For HPImageArchive idx=0 is today for local time, (idx=1 is yesterday and so on) but that refers to that precise instant and relative to the market in question. One minute later can be another day only for that market but not for the remaining markets.

At winter time (northern hemisphere) Bing issuing hours (UTC+0) are:

00:00 - EN-GB 03:00 - PT-BR 05:00 - EN-CA, FR-CA 08:00 - EN-US, EN-WW 13:00 - EN-AU 15:00 - JA-JP 16:00 - ZH-CN 18:30 - EN-IN 23:00 - DE-DE, FR-FR

Same images have same literal prefixes in filenames but they can be issued by different markets days apart, there is not a pattern for that. Also, for 1920x1200, they can have different logos.

Also markets can change. EN-IN (India) appeared less than 2 months ago. Others can appear in future.

HPImageArchive has an output date, "startdate", but that date refers to western US time, not local time.

It seems to me that this suggestion is almost impossible to accomplish.

It is just my opinion. Only genzj can really tell.

genzj commented 9 years ago

Thank @Bwallpaper and @zulrak1 for your great suggestions and attentions you paid to such a small app. I'll make the bing wallpaper as ideal in your mind as possible however I'm busy with house decoration recently so may not respond in time. I still keep your notes in todo list so please just write several lines to me anytime you find good ideas. Thanks again:)

Bwallpaper commented 9 years ago

My idea was a bit easier. When you launch the program it automatically dowload images from selected market/country with the same idx. So instead of downloading it just from us, you can specify a list as us fr de, and the corrisponding images will be saved. As far as the duplication, what I see now is that images files are something like "VeniceDetail..." "NorwayIlluminated..." and same images seems to have this prefix in common, so using it one can, maybe with a database, track the already downloaded images. Or using it as the name of the saved image could make it overwrite already available images with the same one, avoiding duplication. I think something similar could be achieved also by using image description, that in most of cases are the same for equal images in all markets :)

zulrak1 commented 9 years ago

Genjz delayed a while to implement some suggestions. I see now that he resumed taking care of his application.

But meanwhile I decided to create myself a process to download Bing wallpapers according to my needs. I'm the only one that uses it.

I use Powershell to do that. My script accomplishes "Bwallpaper" wishes of downloading wallpapers of all markets of one day in a single execution.

The trick is looking at source code of Bing settings homepage, http://www.bing.com/account, section REGIONS.

My script begins with this code, that lists all available markets seen in Bing settings page, plus EN-WW.

$LstMkt = @('en-WW') + ((Invoke-WebRequest -Uri 'http://www.bing.com/account' -UseBasicParsing).Links.href | foreach {[System.Net.WebUtility]::HtmlDecode($)} | Select-String -Pattern '[^\w]setmkt=(?[a-z]{2}-[A-Z]{2})' -AllMatches | foreach {$.Matches | % { $_.Groups['mkt'].Value }} | sort -unique)

foreach ($Mkt in $LstMkt) { $Mkt = $Mkt.ToUpper() Write-Host $Mkt }

(This portion of code is executable, needs version 4)

It lists all available markets at execution moment. Market codes are sorted alphabetically with special market EN-WW added at top. Now and then Microsoft adds or eliminates some markets, but this way one can catch all possible markets at each moment.

Then, for each market the scripts looks at the ouput of HPImageArchive. If output filename contains "ROW" ignores unless mkt=EN-WW. Otherwise retrieves given filenames. I define in the script the dimensions and specifications, like "ZH", I need. It also stores some information in the EXIF metadata of each downloaded wallpaper, like the description, author, date, market, original wallpaper url.

This way I can retrieve all wallpapers of a given day of all markets that have their own filenames in a single execution. HPImageArchive accepts up to 8 days, so the script can also retrieve all wallpapers I need from last 8 days of all markets. If some new market appears having their own wallpapers my script will show them instantly.

Maybe this can be an inspiration to Genjz add an extra functionality to his application.

I'm sorry to say, but I no longer use Pybingwallpaper, only my script ...

But I can always help. Pybingwallpaper was very helpful to me,

Regards

zulrak1 commented 9 years ago

Sorry. Like that the script does not work. Copy/paste always changes contents of script. I'l try another way. Must be like in attached image. list-bing-mkt