Ivars преди 7 години
родител
ревизия
38749fc8ad
променени са 4 файла, в които са добавени 60 реда и са изтрити 9 реда
  1. 7
    0
      changelog.md
  2. 7
    2
      get_picons.py
  3. 11
    4
      imake.bat
  4. 35
    3
      readme.md

+ 7
- 0
changelog.md Целия файл

@@ -0,0 +1,7 @@
1
+**0.4b** (29.03.2017)
2
+- [bugfix] url change
3
+- using simple picture instead of high-res
4
+
5
+**0.3** (11.06.2013)
6
+- initial public release
7
+- html parsing is done wit regex instead of BeautifulSoup

+ 7
- 2
get_picons.py Целия файл

@@ -110,7 +110,7 @@ def main(argv):
110 110
 def create_picons(package):
111 111
     "Create picons files for package"
112 112
     global services,options
113
-    url_package = "http://www.lyngsat.com/packages/%s.html"%package
113
+    url_package = "https://www.lyngsat.com/packages/%s.html"%package
114 114
     if options.debug:
115 115
         print "** Downloading and looking %s for picons"%url_package
116 116
     num_picons = 0
@@ -148,7 +148,12 @@ def create_picons(package):
148 148
                 b=0
149 149
             icon_url = html_attr("src",td[b])
150 150
             if icon_url:
151
-                icon_url = "http://www.lyngsat.com" + icon_url.group(1).replace("/icon","/logo").replace(".gif",".jpg")
151
+                #icon_url = "http://www.lyngsat.com" + icon_url.group(1).replace("/icon","/logo").replace(".gif",".jpg")
152
+                # https://www.lyngsat.com/logo/tv/vv/viasat_history.png
153
+                # https://www.lyngsat-logo.com/hires/vv/viasat_history.png
154
+                icon_url = "https://www.lyngsat.com" + icon_url.group(1) # simple picture
155
+                # TODO - varētu ņemt labo bildi un pēc tam to jēdzīgi apstrādāt ?
156
+                #icon_url = "https://www.lyngsat-logo.com" + icon_url.group(1).replace("/logo/tv","/hires") # advanced picture
152 157
             else:
153 158
                 icon_url = ""
154 159
             name = html_text(td[b+1]).group(1)

+ 11
- 4
imake.bat Целия файл

@@ -1,6 +1,6 @@
1 1
 @echo off
2 2
 :=== Parameters ===
3
-set ver=0.4
3
+set ver=0.4b
4 4
 set prog=GetPicons
5 5
 set pack_name=enigma2-plugin-extensions-getpicons
6 6
 set pack_prefix=enigma2-plugin-extensions-
@@ -10,6 +10,7 @@ set ext_dir=usr\lib\enigma2\python\Plugins\Extensions\
10 10
 set script_dir=usr\script\
11 11
 set ipk_dir=ipkg\
12 12
 set release_dir=release\
13
+set feed_dir=q:\web\feed\
13 14
 
14 15
 set AR=\MinGW\bin\ar.exe
15 16
 set TAR=\MinGW\msys\1.0\bin\tar.exe
@@ -17,7 +18,7 @@ set TAR=\MinGW\msys\1.0\bin\tar.exe
17 18
 :=== data files
18 19
 if exist %ipk_dir% rm -r -f %ipk_dir%
19 20
 mkdir %ipk_dir%
20
-for %%f in (readme.txt,__init__.py,plugin.py,get_picons.py) do xcopy /q  /y %%f %ipk_dir%data\%ext_dir%%prog%\
21
+for %%f in (readme.md,changelog.md,__init__.py,plugin.py,get_picons.py) do xcopy /q  /y %%f %ipk_dir%data\%ext_dir%%prog%\
21 22
 for %%f in (get_picons.sh ) do xcopy  /q /y %%f %ipk_dir%data\%script_dir%
22 23
 
23 24
 :=== control file ===
@@ -29,10 +30,10 @@ echo Version: %ver%
29 30
 echo Package: %pack_name%
30 31
 echo Description: %desc%
31 32
 echo Architecture: all
32
-echo Section: 
33
+echo Section:
33 34
 echo Priority: optional
34 35
 echo Maintainer: ivars777@gmail.com
35
-echo Homepage: 
36
+echo Homepage:
36 37
 echo Depends: python-xml python-imaging requests
37 38
 echo Source:
38 39
 ) >%ipk_dir%CONTROL\control
@@ -74,3 +75,9 @@ if exist %release_dir%%pack_name%_%ver%.ipk del %release_dir%%pack_name%_%ver%.i
74 75
 mv %release_dir%%pack_name%_%ver% %release_dir%%pack_name%_%ver%.ipk
75 76
 
76 77
 
78
+copy %release_dir%%pack_name%_%ver%.ipk %feed_dir%%pack_name%_%ver%.ipk
79
+pushd  %feed_dir%
80
+python c:\Python27\Scripts\opkg-make-index . >Packages
81
+dos2unix Packages
82
+gzip -f -k Packages
83
+popd

+ 35
- 3
readme.md Целия файл

@@ -1,7 +1,39 @@
1 1
 # GetPicons
2 2
 
3
-### Enigma2 plugin to dowload and create channels picons files form lyngsat.com
3
+#### Enigma2 plugin to dowload and create channels picons files form lyngsat.com
4 4
 
5
-------------
6
-Copyright (c) 2015-2016 ivars777 (ivars777@gmail.com)  
5
+Dowloads and creates Enigma2 channels picons files form lyngsat.com (straight forward downloading and resizing without transparency and other fine tunings).
6
+Picons for all channels in lamed are downloaded (you can subselect particular sattelites or packages via paremeters).
7
+No symlinks are created for same images.
8
+
9
+You can run it several ways:
10
+
11
+1. As a Dreambox plugin (GetPicons)
12
+2. From Dreambox command line (/usr/script/get_picons.sh)
13
+3. From PC command line
14
+
15
+**Prerequisites**:
16
+- Python 2.x
17
+- Python libraries-  Imaging (PIL) (usually part of standart python)
18
+
19
+**Usage (command line):**
20
+```
21
+python get_picons.py [options]
22
+```
23
+Options:
24
+
25
+    -p PACKAGE_LIST, --package=PACKAGE_LIST     list of package names (html file name in lyngsat),
26
+                                                e.g "viasat,ntvplus36"
27
+    -s  SAT_LIST, --sat=SAT_LIST                list of sattelite positions, e.g. "4.9,-0.8"
28
+    -z  SIZE                                    icon size, e.g. "100x60", default - "220x132"
29
+    -f PATH, --folder PATH                      picon files output folder, default - "/media/hdd/picon"
30
+    -e PATH, --enigma PATH                      enigma2 folder whera lamedb,settings are located, default - "/etc/enigma2"
31
+                                                you can use urls, e.g. "ftp://root@receiver_address/etc/enigma2"
32
+    -o, -overwrite                              overwrite existing picons file (default - no)
33
+    -d, -debug                                  display work progress and write debug info to file for not found services
34
+    -h, --help                                  this help file
35
+
36
+
37
+
38
+Copyright (c) 2015-2016 ivars777 (ivars777@gmail.com)
7 39
 Distributed under the GNU GPL v3. For full terms see http://www.gnu.org/licenses/gpl-3.0.en.html