diff -Nru variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/CHANGELOG.txt variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/CHANGELOG.txt --- variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/CHANGELOG.txt 2020-02-12 00:00:46.000000000 +0000 +++ variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/CHANGELOG.txt 2020-07-20 09:02:09.000000000 +0000 @@ -1,3 +1,13 @@ +0.8.4 + Remove dead Desktoppr, ChromeOS sources (GH-323) + Properly verify TLS certificates when downloading images (GH-326) + Fix banning images when using Delete to Trash option (GH-304) + Preserve file extensions when copying wallpapers to another folder (GH-240) + Fix crash in indicator code when image origin is not available (GH-287) + Remove spurious "No such schema “org.cinnamon.desktop.background” errors" (GH-329) + Update Unsplash rate limit (GH-332) + Better detection for AwesomeWM (GH-282) + 0.8.0 - 0.8.3 Image sources are now plugins Add support for sequential albums diff -Nru variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/data/scripts/set_wallpaper variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/data/scripts/set_wallpaper --- variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/data/scripts/set_wallpaper 2020-02-12 00:00:46.000000000 +0000 +++ variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/data/scripts/set_wallpaper 2020-07-20 09:02:09.000000000 +0000 @@ -171,6 +171,13 @@ gsettings set org.gnome.desktop.background picture-options 'zoom' fi +# GNOME Screensaver / Lock screen - thanks to George C. de Araujo for the patch +gsettings set org.gnome.desktop.screensaver picture-uri "file://$WP" 2> /dev/null +if [ "$(gsettings get org.gnome.desktop.screensaver picture-options)" == "'none'" ]; then + gsettings set org.gnome.desktop.screensaver picture-options 'zoom' +fi + + # Deepin if [ "$(gsettings list-schemas | grep -c com.deepin.wrap.gnome.desktop.background)" -ge 1 ]; then gsettings set com.deepin.wrap.gnome.desktop.background picture-uri "file://$WP" @@ -228,19 +235,16 @@ # Cinnamon after 2.0 gsettings set org.cinnamon.desktop.background picture-uri "file://$WP" 2> /dev/null -if [ "$(gsettings get org.cinnamon.desktop.background picture-options)" == "'none'" ]; then +if [ "$(gsettings get org.cinnamon.desktop.background picture-options 2>/dev/null)" == "'none'" ]; then gsettings set org.cinnamon.desktop.background picture-options 'zoom' fi -# GNOME Screensaver / Lock screen - thanks to George C. de Araujo for the patch -gsettings set org.gnome.desktop.screensaver picture-uri "file://$WP" 2> /dev/null - # Awesome Window Manager # Be sure to start variety when you start awesome, such as by adding it to ~/.xinitrc # NOTE: This config will change the wallpaper after your current awesome theme sets it. # As such, the theme's wallpaper will briefly appear before being replaced with Variety's wallpaper. -if [[ "$DESKTOP_STARTUP_ID" == "awesome"* ]]; then - echo "local gears = require(\"gears\") gears.wallpaper.maximized(\"$1\", s, true)" | awesome-client +if [[ "$XDG_SESSION_DESKTOP $DESKTOP_STARTUP_ID $DESKTOP_SESSION $XDG_CURRENT_DESKTOP" == *"awesome"* ]]; then + echo "local gears = require(\"gears\") gears.wallpaper.maximized(\"$1\", nil)" | awesome-client fi # ===================================================================================== diff -Nru variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/data/ui/AboutVarietyDialog.ui variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/data/ui/AboutVarietyDialog.ui --- variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/data/ui/AboutVarietyDialog.ui 2020-02-12 00:00:46.000000000 +0000 +++ variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/data/ui/AboutVarietyDialog.ui 2020-07-20 09:02:09.000000000 +0000 @@ -11,11 +11,11 @@ normal Variety placeholder version - Copyright (c) 2012-2019, Peter Levi, James Lu & Variety contributors + Copyright (c) 2012-2020, Peter Levi, James Lu & Variety contributors An automatic wallpaper changer, downloader and manager. https://launchpad.net/variety http://peterlevi.com/variety - # Copyright (c) 2012-2019, Peter Levi, James Lu & Variety contributors + # Copyright (c) 2012-2020, Peter Levi, James Lu & Variety contributors # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the Free Software Foundation. @@ -28,7 +28,7 @@ # You should have received a copy of the GNU General Public License along # with this program. If not, see <http://www.gnu.org/licenses/>. - Copyright (c) 2012-2019, Peter Levi, James Lu & Variety contributors + Copyright (c) 2012-2020, Peter Levi, James Lu & Variety contributors ../media/variety128.png gpl-3-0 diff -Nru variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/data/ui/changes.txt variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/data/ui/changes.txt --- variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/data/ui/changes.txt 2020-02-12 00:00:46.000000000 +0000 +++ variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/data/ui/changes.txt 2020-07-20 09:02:09.000000000 +0000 @@ -1,3 +1,13 @@ +0.8.4 + Remove dead Desktoppr, ChromeOS sources (GH-323) + Properly verify TLS certificates when downloading images (GH-326) + Fix banning images when using Delete to Trash option (GH-304) + Preserve file extensions when copying wallpapers to another folder (GH-240) + Fix crash in indicator code when image origin is not available (GH-287) + Remove spurious "No such schema “org.cinnamon.desktop.background” errors" (GH-329) + Update Unsplash rate limit (GH-332) + Better detection for AwesomeWM (GH-282) + 0.8.0 - 0.8.3 Image sources are now plugins Add support for sequential albums diff -Nru variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/debian/changelog variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/debian/changelog --- variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/debian/changelog 2020-02-12 00:00:46.000000000 +0000 +++ variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/debian/changelog 2020-07-20 09:02:09.000000000 +0000 @@ -1,8 +1,21 @@ -variety (0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1) eoan; urgency=low +variety (0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1) eoan; urgency=low * Auto build. - -- Peter Levi Wed, 12 Feb 2020 00:00:46 +0000 + -- Launchpad Package Builder Mon, 20 Jul 2020 09:02:09 +0000 + +variety (0.8.4) focal; urgency=medium + + * Remove dead Desktoppr, ChromeOS sources (GH-323) + * Properly verify TLS certificates when downloading images (GH-326) + * Fix banning images when using Delete to Trash option (GH-304) + * Preserve file extensions when copying wallpapers to another folder (GH-240) + * Fix crash in indicator code when image origin is not available (GH-287) + * Remove spurious "No such schema “org.cinnamon.desktop.background” errors" (GH-329) + * Update Unsplash rate limit (GH-332) + * Better detection for AwesomeWM (GH-282) + + -- James Lu Thu, 16 Jul 2020 11:30:53 -0700 variety (0.8.3) bionic; urgency=medium diff -Nru variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/debian/git-build-recipe.manifest variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/debian/git-build-recipe.manifest --- variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/debian/git-build-recipe.manifest 2020-02-12 00:00:46.000000000 +0000 +++ variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/debian/git-build-recipe.manifest 2020-07-20 09:02:09.000000000 +0000 @@ -1,2 +1,2 @@ -# git-build-recipe format 0.4 deb-version 0.8.3~git202002112348.d6b51f8~ppa885 -lp:variety git-commit:d6b51f80972ef5c5440943aca1e83a999ae13be1 +# git-build-recipe format 0.4 deb-version 0.8.4~git202007161842.723c800~ppa901 +lp:variety git-commit:723c80011ec51f01bb5deb57d64fb6797ce8f7b9 diff -Nru variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/.idea/misc.xml variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/.idea/misc.xml --- variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/.idea/misc.xml 2020-02-12 00:00:46.000000000 +0000 +++ variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/.idea/misc.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ - - - - - - \ No newline at end of file diff -Nru variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/.idea/modules.xml variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/.idea/modules.xml --- variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/.idea/modules.xml 2020-02-12 00:00:46.000000000 +0000 +++ variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/.idea/modules.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff -Nru variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/.idea/vcs.xml variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/.idea/vcs.xml --- variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/.idea/vcs.xml 2020-02-12 00:00:46.000000000 +0000 +++ variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/.idea/vcs.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff -Nru variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/tests/TestChromeOSWallpapersDownloader.py variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/tests/TestChromeOSWallpapersDownloader.py --- variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/tests/TestChromeOSWallpapersDownloader.py 2020-02-12 00:00:46.000000000 +0000 +++ variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/tests/TestChromeOSWallpapersDownloader.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -#!/usr/bin/python3 -# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- -### BEGIN LICENSE -# Copyright (c) 2012, Peter Levi -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 3, as published -# by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranties of -# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR -# PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -### END LICENSE - -import unittest - -from tests.TestDownloader import get_plugin_downloader, test_download_one_for - - -class TestChromeOSWallpapersDownloader(unittest.TestCase): - def test_download_one(self): - dl = get_plugin_downloader("ChromeOSWallpapersDownloader") - test_download_one_for(self, dl) - - -if __name__ == "__main__": - unittest.main() diff -Nru variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/tests/TestDesktopprDownloader.py variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/tests/TestDesktopprDownloader.py --- variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/tests/TestDesktopprDownloader.py 2020-02-12 00:00:46.000000000 +0000 +++ variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/tests/TestDesktopprDownloader.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -#!/usr/bin/python3 -# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- -### BEGIN LICENSE -# Copyright (c) 2012, Peter Levi -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 3, as published -# by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranties of -# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR -# PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -### END LICENSE - -import unittest - -from tests.TestDownloader import get_plugin_downloader, test_download_one_for - - -class TestDesktopprDownloader(unittest.TestCase): - def test_download_one(self): - dl = get_plugin_downloader("DesktopprDownloader") - test_download_one_for(self, dl) - - -if __name__ == "__main__": - unittest.main() diff -Nru variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/variety/FlickrDownloader.py variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/variety/FlickrDownloader.py --- variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/variety/FlickrDownloader.py 2020-02-12 00:00:46.000000000 +0000 +++ variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/variety/FlickrDownloader.py 2020-07-20 09:02:09.000000000 +0000 @@ -26,7 +26,8 @@ random.seed() -API_KEY = "0553a848c09bcfd21d3a984d9408c04e" +API_KEY = "d9c4a1fd59926d27d091b69651c37a34" +HASH = b"VAxWBwAJUlxWCQBQVQJWBVVUClBbDg1SDAVTC1RRB1E=\n" class FlickrDownloader(ImageSource, DefaultDownloader): @@ -79,7 +80,7 @@ call = ( "https://api.flickr.com/services/rest/?method=flickr.urls.lookupUser&api_key=%s&url=%s&format=json&nojsoncallback=1" - % (API_KEY, urllib.parse.quote_plus(url)) + % (Util.unxor(HASH, API_KEY), urllib.parse.quote_plus(url)) ) resp = FlickrDownloader.fetch(call) @@ -101,7 +102,7 @@ call = ( "https://api.flickr.com/services/rest/?method=flickr.urls.lookupGroup&api_key=%s&url=%s&format=json&nojsoncallback=1" - % (API_KEY, urllib.parse.quote_plus(url)) + % (Util.unxor(HASH, API_KEY), urllib.parse.quote_plus(url)) ) resp = FlickrDownloader.fetch(call) @@ -132,7 +133,8 @@ def count_results(self): call = ( "https://api.flickr.com/services/rest/?method=flickr.photos.search" - "&api_key=%s&per_page=20&tag_mode=all&format=json&nojsoncallback=1" % API_KEY + "&api_key=%s&per_page=20&tag_mode=all&format=json&nojsoncallback=1" + % Util.unxor(HASH, API_KEY) ) for k, v in self.params.items(): @@ -149,7 +151,8 @@ call = ( "https://api.flickr.com/services/rest/?method=flickr.photos.search" - "&api_key=%s&per_page=500&tag_mode=all&format=json&nojsoncallback=1" % API_KEY + "&api_key=%s&per_page=500&tag_mode=all&format=json&nojsoncallback=1" + % Util.unxor(HASH, API_KEY) ) for k, v in self.params.items(): @@ -260,7 +263,7 @@ photo_id = FlickrDownloader.get_photo_id(origin_url) call = ( "https://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key=%s&photo_id=%s&format=json&nojsoncallback=1" - % (API_KEY, photo_id) + % (Util.unxor(HASH, API_KEY), photo_id) ) resp = Util.fetch_json(call) s = max(resp["sizes"]["size"], key=lambda size: int(size["width"])) @@ -271,7 +274,7 @@ photo_id = FlickrDownloader.get_photo_id(origin_url) call = ( "https://api.flickr.com/services/rest/?method=flickr.photos.getInfo&api_key=%s&photo_id=%s&format=json&nojsoncallback=1" - % (API_KEY, photo_id) + % (Util.unxor(HASH, API_KEY), photo_id) ) resp = Util.fetch_json(call) ph = resp["photo"] diff -Nru variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/variety/plugins/builtin/downloaders/ChromeOSWallpapersDownloader.py variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/variety/plugins/builtin/downloaders/ChromeOSWallpapersDownloader.py --- variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/variety/plugins/builtin/downloaders/ChromeOSWallpapersDownloader.py 2020-02-12 00:00:46.000000000 +0000 +++ variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/variety/plugins/builtin/downloaders/ChromeOSWallpapersDownloader.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- -### BEGIN LICENSE -# Copyright (c) 2012, Peter Levi -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 3, as published -# by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranties of -# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR -# PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -### END LICENSE -import logging -import random - -from variety.plugins.downloaders.SimpleDownloader import SimpleDownloader -from variety.Util import Util, _ - -MANIFEST_URL = "https://storage.googleapis.com/chromeos-wallpaper-public/manifest_en.json" - -logger = logging.getLogger("variety") - -random.seed() - - -class ChromeOSWallpapersDownloader(SimpleDownloader): - DESCRIPTION = _("Chrome OS Wallpapers") - - @classmethod - def get_info(cls): - return { - "name": "ChromeOsWallpapersDownloader", - "description": ChromeOSWallpapersDownloader.DESCRIPTION, - "author": "Peter Levi", - "version": "0.1", - } - - def get_description(self): - return ChromeOSWallpapersDownloader.DESCRIPTION - - def get_source_type(self): - return "chromeos" - - def get_source_name(self): - return "Chrome OS Wallpapers" - - def get_source_location(self): - return self.get_source_name() - - def fill_queue(self): - manifest = Util.fetch_json(MANIFEST_URL) - queue = manifest["wallpaper_list"] - self.tags = manifest["tags"] - random.shuffle(queue) - return queue - - def download_queue_item(self, item): - image_url = item["base_url"] + "_high_resolution.jpg" - origin_url = item["dynamic_url"] - extra_metadata = {"noOriginPage": "yes"} - if "tags" in item: - extra_metadata["keywords"] = [ - self.tags[str(tag)] for tag in item["tags"] if str(tag) in self.tags - ] - if "author" in item: - extra_metadata["author"] = item["author"] - if "author_website" in item: - extra_metadata["authorURL"] = item["author_website"] - - return self.save_locally(origin_url, image_url, extra_metadata=extra_metadata) diff -Nru variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/variety/plugins/builtin/downloaders/DesktopprDownloader.py variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/variety/plugins/builtin/downloaders/DesktopprDownloader.py --- variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/variety/plugins/builtin/downloaders/DesktopprDownloader.py 2020-02-12 00:00:46.000000000 +0000 +++ variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/variety/plugins/builtin/downloaders/DesktopprDownloader.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- -### BEGIN LICENSE -# Copyright (c) 2012, Peter Levi -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 3, as published -# by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranties of -# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR -# PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -### END LICENSE - -import logging - -from variety.plugins.downloaders.DefaultDownloader import QueueItem -from variety.plugins.downloaders.SimpleDownloader import SimpleDownloader -from variety.Util import Util, _ - -logger = logging.getLogger("variety") - - -class DesktopprDownloader(SimpleDownloader): - DESCRIPTION = _("Random wallpapers from Desktoppr.co") - - @classmethod - def get_info(cls): - return { - "name": "DesktopprDownloader", - "description": DesktopprDownloader.DESCRIPTION, - "author": "Peter Levi", - "version": "0.1", - } - - def get_source_type(self): - return "desktoppr" - - def get_description(self): - return DesktopprDownloader.DESCRIPTION - - def get_source_name(self): - return "Desktoppr.co" - - def get_folder_name(self): - return "Desktoppr" - - def download_queue_item(self, queue_item): - origin_url, image_url, extra_metadata = queue_item - return self.save_locally( - origin_url, image_url, extra_metadata=extra_metadata, request_kwargs={"verify": False} - ) - - def fill_queue(self): - response = Util.fetch_json("https://api.desktoppr.co/1/wallpapers/random", verify=False) - - if response["response"]["review_state"] != "safe": - logger.info(lambda: "Non-safe image returned by Desktoppr, skipping") - return None - - origin_url = response["response"]["url"] - image_url = response["response"]["image"]["url"] - return [QueueItem(origin_url, image_url, {})] diff -Nru variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/variety/plugins/builtin/downloaders/UnsplashConfigurableSource.py variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/variety/plugins/builtin/downloaders/UnsplashConfigurableSource.py --- variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/variety/plugins/builtin/downloaders/UnsplashConfigurableSource.py 2020-02-12 00:00:46.000000000 +0000 +++ variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/variety/plugins/builtin/downloaders/UnsplashConfigurableSource.py 2020-07-20 09:02:09.000000000 +0000 @@ -119,7 +119,7 @@ return _("Search keyword or URL: ") def get_ui_short_description(self): - return _("Fetches images from Unsplash.com for a given criteria") + return _("Fetch images from Unsplash.com for a given criteria") def get_source_name(self): return "Unsplash" diff -Nru variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/variety/plugins/builtin/downloaders/UnsplashDownloader.py variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/variety/plugins/builtin/downloaders/UnsplashDownloader.py --- variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/variety/plugins/builtin/downloaders/UnsplashDownloader.py 2020-02-12 00:00:46.000000000 +0000 +++ variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/variety/plugins/builtin/downloaders/UnsplashDownloader.py 2020-07-20 09:02:09.000000000 +0000 @@ -29,7 +29,11 @@ class UnsplashDownloader(SimpleDownloader): DESCRIPTION = _("High-resolution photos from Unsplash.com") - CLIENT_ID = "072e5048dfcb73a8d9ad59fcf402471518ff8df725df462b0c4fa665f466515a" + API_KEY = "37ee4be36ffd27e79decd4ef382d4949" + HASH = ( + b"AwBXAAFSUQtSAAUGBQQED11dBAdRDQMFVQwCVgAOBQwCDwMDDAYDBARTAgIGAVdVCQdRBQUCU1NV\n" + b"DARSAQgBWA==\n" + ) UTM_PARAMS = "?utm_source=Variety+Wallpaper+Changer&utm_medium=referral" rate_limiting_started_time = 0 @@ -62,11 +66,11 @@ return "unsplash_v2" def get_default_throttling(self): - return Throttling(max_downloads_per_hour=20, max_queue_fills_per_hour=3) + return Throttling(max_downloads_per_hour=10, max_queue_fills_per_hour=1) def get_unsplash_api_url(self): return "https://api.unsplash.com/photos/random?count=30&client_id={}{}".format( - UnsplashDownloader.CLIENT_ID, + Util.unxor(UnsplashDownloader.HASH, UnsplashDownloader.API_KEY), "&orientation=landscape" if self.get_variety().options.use_landscape_enabled else "", ) @@ -81,7 +85,7 @@ logger.info(lambda: "Filling Unsplash queue from " + url) r = Util.request(url) - if int(r.headers.get("X-Ratelimit-Remaining", 1000000)) < 100: + if int(r.headers.get("X-Ratelimit-Remaining", 1000000)) < 1000: UnsplashDownloader.rate_limiting_started_time = time.time() queue = [] @@ -125,7 +129,9 @@ download_loc = extraData.get("unsplashDownloadLocation") reported = extraData.get("unsplashDownloadReported") if download_loc and not reported: - url = "{}?client_id={}".format(download_loc, UnsplashDownloader.CLIENT_ID) + url = "{}?client_id={}".format( + download_loc, Util.unxor(UnsplashDownloader.HASH, UnsplashDownloader.API_KEY) + ) Util.fetch(url) meta["extraData"]["unsplashDownloadReported"] = True Util.write_metadata(img, meta) diff -Nru variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/variety/plugins/builtin/downloaders/WallhavenSource.py variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/variety/plugins/builtin/downloaders/WallhavenSource.py --- variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/variety/plugins/builtin/downloaders/WallhavenSource.py 2020-02-12 00:00:46.000000000 +0000 +++ variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/variety/plugins/builtin/downloaders/WallhavenSource.py 2020-07-20 09:02:09.000000000 +0000 @@ -30,7 +30,7 @@ @classmethod def get_info(cls): return { - "name": "MediaRSSSource", + "name": "WallhavenSource", "description": _("Configurable source for fetching images from Wallhaven.cc"), "author": "Peter Levi", "version": "0.1", @@ -65,7 +65,7 @@ return _("Enter keywords or paste URL here: ") def get_ui_short_description(self): - return _("Fetch images from a MediaRSS feed") + return _("Fetch images from Wallhaven.cc for a given criteria") def validate(self, query): valid = WallhavenDownloader.validate(query) diff -Nru variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/variety/PreferencesVarietyDialog.py variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/variety/PreferencesVarietyDialog.py --- variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/variety/PreferencesVarietyDialog.py 2020-02-12 00:00:46.000000000 +0000 +++ variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/variety/PreferencesVarietyDialog.py 2020-07-20 09:02:09.000000000 +0000 @@ -274,9 +274,13 @@ self.ui.slideshow_zoom.set_value(self.options.slideshow_zoom) self.ui.slideshow_pan.set_value(self.options.slideshow_pan) + self.unsupported_sources = [] self.ui.sources.get_model().clear() for s in self.options.sources: - self.ui.sources.get_model().append(self.source_to_model_row(s)) + if s[1] in Options.get_all_supported_source_types(): + self.ui.sources.get_model().append(self.source_to_model_row(s)) + else: + self.unsupported_sources.append(s) if not hasattr(self, "enabled_toggled_handler_id"): self.enabled_toggled_handler_id = self.ui.sources_enabled_checkbox_renderer.connect( @@ -937,6 +941,8 @@ self.options.sources = [] for r in self.ui.sources.get_model(): self.options.sources.append(self.model_row_to_source(r)) + for s in self.unsupported_sources: + self.options.sources.append(s) if os.access(self.fetched_chooser.get_folder(), os.W_OK): self.options.fetched_folder = self.fetched_chooser.get_folder() diff -Nru variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/variety/Util.py variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/variety/Util.py --- variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/variety/Util.py 2020-02-12 00:00:46.000000000 +0000 +++ variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/variety/Util.py 2020-07-20 09:02:09.000000000 +0000 @@ -13,6 +13,7 @@ # You should have received a copy of the GNU General Public License along # with this program. If not, see . ### END LICENSE +import base64 import codecs import datetime import functools @@ -30,6 +31,7 @@ import threading import time import urllib.parse +from itertools import cycle import bs4 import requests @@ -602,7 +604,7 @@ return f @staticmethod - def request(url, data=None, stream=False, method=None, timeout=5, headers=None, verify=True): + def request(url, data=None, stream=False, method=None, timeout=5, headers=None): if url.startswith("//"): url = "http:" + url headers = headers or {} @@ -617,7 +619,6 @@ stream=stream, allow_redirects=True, timeout=timeout, - verify=verify, ) r.raise_for_status() return r @@ -651,6 +652,11 @@ return bs4.BeautifulSoup(Util.fetch(url, data, **request_kwargs), "xml") @staticmethod + def unxor(text, key): + ciphertext = base64.decodestring(text) + return "".join(chr(x ^ ord(y)) for (x, y) in zip(ciphertext, cycle(key))) + + @staticmethod def folderpath(folder): p = os.path.normpath(folder) if not p.endswith("/"): diff -Nru variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/variety/VarietyOptionParser.py variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/variety/VarietyOptionParser.py --- variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/variety/VarietyOptionParser.py 2020-02-12 00:00:46.000000000 +0000 +++ variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/variety/VarietyOptionParser.py 2020-07-20 09:02:09.000000000 +0000 @@ -175,6 +175,13 @@ ) parser.add_option( + "--toggle-no-effects", + action="store_true", + dest="toggle_no_effects", + help=_('Toggle "Show Without Effects" for current image'), + ) + + parser.add_option( "--quotes-next", action="store_true", dest="quotes_next", help=_("Show Next quote") ) diff -Nru variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/variety/VarietyWindow.py variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/variety/VarietyWindow.py --- variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/variety/VarietyWindow.py 2020-02-12 00:00:46.000000000 +0000 +++ variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/variety/VarietyWindow.py 2020-07-20 09:02:09.000000000 +0000 @@ -666,11 +666,10 @@ def load_banned(self): self.banned = set() try: - partial = os.path.join(self.config_folder, "banned.txt.partial") - with open(partial, encoding="utf8") as f: + banned = os.path.join(self.config_folder, "banned.txt") + with open(banned, encoding="utf8") as f: for line in f: self.banned.add(line.strip()) - os.rename(partial, os.path.join(self.config_folder, "banned.txt")) except Exception: logger.info(lambda: "Missing or invalid banned URLs list, no URLs will be banned") @@ -722,7 +721,7 @@ if favs_op is None: holder.copy_to_favorites.set_visible(False) holder.move_to_favorites.set_visible(False) - elif favs_op is "favorite": + elif favs_op == "favorite": holder.copy_to_favorites.set_label(_("Already in Favorites")) holder.copy_to_favorites.set_visible(True) holder.move_to_favorites.set_visible(False) @@ -838,7 +837,7 @@ self.update_favorites_menuitems(self.ind, auto_changed, favs_op) self.ind.show_origin.set_visible(bool(label)) - self.ind.show_origin.set_sensitive("noOriginPage" not in info) + self.ind.show_origin.set_sensitive(bool(info and "noOriginPage" not in info)) if label: self.ind.show_origin.set_label(label) @@ -1413,9 +1412,11 @@ def apply_copyto_operation(self, to_set): if self.options.copyto_enabled: folder = self.get_actual_copyto_folder() - target_file = os.path.join( - folder, "variety-copied-wallpaper-%s.jpg" % Util.random_hash() + target_fname = "variety-copied-wallpaper-%s%s" % ( + Util.random_hash(), + os.path.splitext(to_set)[1], ) + target_file = os.path.join(folder, target_fname) self.cleanup_old_wallpapers(folder, "variety-copied-wallpaper") try: shutil.copy(to_set, target_file) @@ -1597,10 +1598,7 @@ if not img: with self.prepared_lock: # with some big probability, use one of the unseen_downloads - if ( - random.random() < self.options.download_preference_ratio - or not self._has_local_sources() - ): + if random.random() < self.options.download_preference_ratio: enabled_unseen_downloads = self._enabled_unseen_downloads() if enabled_unseen_downloads: unseen = random.choice(list(enabled_unseen_downloads)) @@ -1659,7 +1657,8 @@ dl.state["unseen_downloads"] = [f for f in unseen if os.path.exists(f)] dl.save_state() - # trigger download after some interval to reduce resource usage while the wallpaper changes + # trigger download after some interval to reduce resource usage while + # the wallpaper changes delay_dl_timer = threading.Timer(2, self.trigger_download) delay_dl_timer.daemon = True delay_dl_timer.start() @@ -2408,6 +2407,9 @@ elif options.toggle_pause: self.on_pause_resume() + if options.toggle_no_effects: + self.toggle_no_effects(not bool(self.no_effects_on)) + if options.history: self.show_hide_history() if options.downloads: @@ -3028,6 +3030,8 @@ for source in self.options.sources: if source[0]: type = source[1] + if type not in Options.get_all_supported_source_types(): + continue location = source[2] if type == Options.SourceType.IMAGE: diff -Nru variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/variety_lib/varietyconfig.py variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/variety_lib/varietyconfig.py --- variety-0.8.3~git202002112348.d6b51f8~ppa885~ubuntu19.10.1/variety_lib/varietyconfig.py 2020-02-12 00:00:46.000000000 +0000 +++ variety-0.8.4~git202007161842.723c800~ppa901~ubuntu19.10.1/variety_lib/varietyconfig.py 2020-07-20 09:02:09.000000000 +0000 @@ -23,7 +23,7 @@ # for easy development / running from source. __variety_data_directory__ = "../data" __license__ = "GPL-3" -__version__ = "0.8.3" +__version__ = "0.8.4" import os