Check-in [6569edc420]
Overview
| Comment: | Remove ancient dependency. (Whole favicon module needs refurbishment though. Might be feasible to turn it into a plugin meanwhile.) | 
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive | 
| Timelines: | family | ancestors | descendants | both | trunk | 
| Files: | files | file ages | folders | 
| SHA1: | 
6569edc4200367df1665ba6f6ea5a70e | 
| User & Date: | mario on 2015-04-14 16:39:13 | 
| Other Links: | manifest | tags | 
Context
| 
   2015-04-14 
 | ||
| 16:43 | Old helper script to make streamripper add genre. Though there are `-D` pattern options that often work better. And KStreamripper or fIcy/fPls might be more modern. check-in: 39e61e9915 user: mario tags: trunk | |
| 16:39 | Remove ancient dependency. (Whole favicon module needs refurbishment though. Might be feasible to turn it into a plugin meanwhile.) check-in: 6569edc420 user: mario tags: trunk | |
| 16:36 | Last tagged release (2.1.6) check-in: baed88d243 user: mario tags: trunk | |
Changes
Modified favicon.py from [bf959d4ee7] to [0407b40e06].
  | 
  | < | | | | | | > | | | | | | < < |  | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40  | 
# encoding: utf-8
# api: streamtuner2
# title: favicon download
# description: retrieves favicons for station homepages, plus utility code for display preparation
# config:
#    { name: favicon_google_first, type: bool, value: 1, description: "always use google favicon to png conversion service" }
#    { name: favicon_google_only,  type: bool, value: 1, description: "don't try other favicon retrieval methods, if google service fails" }
#    { name: favicon_delete_stub , type: bool, value: 1, description: "delete placeholder favicons" }
# type: function
# category: ui
# priority: standard
#
# This module fetches favicon.ico files and prepares .png images for each domain
# in the stations list. Homepage URLs are used for this.
#
# Files end up in:
#    /home/user/.config/streamtuner2/icons/www.example.org.png
#
# Currently relies on Google conversion service, because urllib+PIL conversion
# method is still flaky, and a bit slower. Future version might use imagemagick.
always_google = 1      # use favicon service for speed
only_google = 1        # if that fails, try our other/slower methods?
delete_google_stub = 1   # don't keep placeholder images
google_placeholder_filesizes = (726,896)
import os, os.path
from compat2and3 import xrange, urllib
import re
from config import conf
from threading import Thread
import ahttp
# ensure that we don't try to download a single favicon twice per session,
# if it's not available the first time, we won't get it after switching stations back and forth
tried_urls = []
 | 
| ︙ | ︙ |