summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules3
m---------.tests0
-rw-r--r--.tests-config.json5
-rw-r--r--.travis.yml11
-rw-r--r--plugin.audio.hearthis_at/addon.py4
-rw-r--r--plugin.audio.hearthis_at/addon.xml4
-rw-r--r--plugin.googledrive/LICENSE.txt674
-rw-r--r--plugin.googledrive/README.md15
-rw-r--r--plugin.googledrive/addon.py264
-rw-r--r--plugin.googledrive/addon.xml39
-rw-r--r--plugin.googledrive/fanart.jpgbin0 -> 49599 bytes
-rw-r--r--plugin.googledrive/icon.pngbin0 -> 28447 bytes
-rw-r--r--plugin.googledrive/resources/__init__.py0
-rw-r--r--plugin.googledrive/resources/language/resource.language.en_gb/strings.po77
-rw-r--r--plugin.googledrive/resources/language/resource.language.he_il/strings.po77
-rw-r--r--plugin.googledrive/resources/lib/__init__.py0
-rw-r--r--plugin.googledrive/resources/lib/provider/__init__.py0
-rw-r--r--plugin.googledrive/resources/lib/provider/googledrive.py51
-rw-r--r--plugin.googledrive/resources/settings.xml16
-rw-r--r--plugin.googledrive/service.py26
-rw-r--r--plugin.onedrive/LICENSE.txt674
-rw-r--r--plugin.onedrive/README.md15
-rw-r--r--plugin.onedrive/addon.py210
-rw-r--r--plugin.onedrive/addon.xml43
-rw-r--r--plugin.onedrive/fanart.jpgbin0 -> 40717 bytes
-rw-r--r--plugin.onedrive/icon.pngbin0 -> 24988 bytes
-rw-r--r--plugin.onedrive/resources/__init__.py0
-rw-r--r--plugin.onedrive/resources/language/resource.language.en_gb/strings.po70
-rw-r--r--plugin.onedrive/resources/language/resource.language.he_il/strings.po70
-rw-r--r--plugin.onedrive/resources/lib/__init__.py0
-rw-r--r--plugin.onedrive/resources/lib/migration.py57
-rw-r--r--plugin.onedrive/resources/lib/provider/__init__.py0
-rw-r--r--plugin.onedrive/resources/lib/provider/onedrive.py74
-rw-r--r--plugin.onedrive/resources/settings.xml16
-rw-r--r--plugin.onedrive/service.py26
-rw-r--r--plugin.video.akibapass/LICENSE.txt661
-rw-r--r--plugin.video.akibapass/README.md42
-rw-r--r--plugin.video.akibapass/addon.xml33
-rw-r--r--plugin.video.akibapass/changelog.txt18
-rw-r--r--plugin.video.akibapass/default.py37
-rw-r--r--plugin.video.akibapass/fanart.jpgbin0 -> 66161 bytes
-rw-r--r--plugin.video.akibapass/icon.pngbin0 -> 39115 bytes
-rw-r--r--plugin.video.akibapass/resources/__init__.py1
-rw-r--r--plugin.video.akibapass/resources/language/resource.language.de_de/strings.po71
-rw-r--r--plugin.video.akibapass/resources/language/resource.language.en_gb/strings.po71
-rw-r--r--plugin.video.akibapass/resources/lib/__init__.py1
-rw-r--r--plugin.video.akibapass/resources/lib/akibapass.py114
-rw-r--r--plugin.video.akibapass/resources/lib/cmdargs.py51
-rw-r--r--plugin.video.akibapass/resources/lib/login.py95
-rw-r--r--plugin.video.akibapass/resources/lib/netapi.py294
-rw-r--r--plugin.video.akibapass/resources/lib/view.py110
-rw-r--r--plugin.video.akibapass/resources/media/screenshot-01.jpgbin0 -> 435540 bytes
-rw-r--r--plugin.video.akibapass/resources/media/screenshot-02.jpgbin0 -> 459999 bytes
-rw-r--r--plugin.video.akibapass/resources/media/screenshot-03.jpgbin0 -> 410796 bytes
-rw-r--r--plugin.video.akibapass/resources/settings.xml5
-rw-r--r--plugin.video.btsportvideo/LICENSE21
-rw-r--r--plugin.video.btsportvideo/README.md9
-rw-r--r--plugin.video.btsportvideo/addon.py127
-rw-r--r--plugin.video.btsportvideo/addon.xml27
-rw-r--r--plugin.video.btsportvideo/resources/__init__.py0
-rw-r--r--plugin.video.btsportvideo/resources/fanart.jpgbin0 -> 70327 bytes
-rw-r--r--plugin.video.btsportvideo/resources/icon.pngbin0 -> 17881 bytes
-rw-r--r--plugin.video.btsportvideo/resources/language/resource.language.en_gb/strings.po33
-rw-r--r--plugin.video.btsportvideo/resources/lib/__init__.py0
-rw-r--r--plugin.video.btsportvideo/resources/lib/api.py106
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/LICENSE.txt0
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/README.md70
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/addon.py152
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/addon.xml48
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/fanart.jpgbin599681 -> 599681 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/icon.pngbin233631 -> 233631 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/__init__.py0
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/language/resource.language.en_gb/strings.po109
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/language/resource.language.fr_fr/strings.po126
-rwxr-xr-xplugin.video.catchuptvandmore/resources/language/resource.language.he.il/strings.po179
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/lib/__init__.py0
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/lib/channels/__init__.py0
-rwxr-xr-xplugin.video.catchuptvandmore/resources/lib/channels/eu/__init__.py0
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/lib/channels/eu/arte.py (renamed from plugin.video.catchuptvandmore/resources/lib/channels/fr/arte.py)230
-rwxr-xr-xplugin.video.catchuptvandmore/resources/lib/channels/eu/euronews.py193
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/lib/channels/fr/6play.py160
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/lib/channels/fr/__init__.py0
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/lib/channels/fr/bfmtv.py824
-rw-r--r--plugin.video.catchuptvandmore/resources/lib/channels/fr/c.py210
-rw-r--r--plugin.video.catchuptvandmore/resources/lib/channels/fr/canalplus.py407
-rwxr-xr-xplugin.video.catchuptvandmore/resources/lib/channels/fr/france24.py294
-rwxr-xr-xplugin.video.catchuptvandmore/resources/lib/channels/fr/groupecanal.py699
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/lib/channels/fr/gulli.py227
-rw-r--r--plugin.video.catchuptvandmore/resources/lib/channels/fr/itele.py208
-rwxr-xr-xplugin.video.catchuptvandmore/resources/lib/channels/fr/lcp.py594
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/lib/channels/fr/lequipe.py286
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/lib/channels/fr/nrj.py770
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/lib/channels/fr/numero23.py402
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/lib/channels/fr/pluzz.py461
-rwxr-xr-xplugin.video.catchuptvandmore/resources/lib/channels/fr/publicsenat.py444
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/lib/channels/fr/tf1.py635
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/lib/common.py16
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/lib/simpleplugin.py0
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/lib/skeleton.py45
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/lib/utils.py14
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/categories/eu.pngbin0 -> 54623 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/categories/fr.pngbin0 -> 35083 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/eu/arte.png (renamed from plugin.video.catchuptvandmore/resources/media/channels/fr/arte.png)bin23700 -> 23700 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/eu/arte_fanart.pngbin0 -> 9650 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/eu/euronews.pngbin0 -> 30470 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/eu/euronews_fanart.pngbin0 -> 338427 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/01net.pngbin0 -> 68110 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/01net_fanart.pngbin0 -> 735809 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/6ter.pngbin100963 -> 100963 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/6ter_fanart.pngbin277616 -> 277616 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/bfmbusiness.pngbin0 -> 69286 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/bfmbusiness_fanart.pngbin0 -> 250165 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/bfmtv.pngbin35775 -> 35775 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/bfmtv_fanart.pngbin483976 -> 483976 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/bruce.pngbin0 -> 73215 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/bruce_fanart.pngbin0 -> 213058 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/c8.pngbin85413 -> 85413 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/c8_fanart.pngbin201320 -> 201320 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/cherie25.pngbin65360 -> 65360 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/cherie25_fanart.pngbin0 -> 72366 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/cnews.pngbin0 -> 25355 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/cnews_fanart.pngbin0 -> 59350 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/comedy.pngbin0 -> 65960 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/comedy_fanart.pngbin0 -> 143152 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/cplus.png (renamed from plugin.video.catchuptvandmore/resources/media/channels/fr/canalplus.png)bin23038 -> 23038 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/cplus_fanart.png (renamed from plugin.video.catchuptvandmore/resources/media/channels/fr/canalplus_fanart.png)bin104838 -> 104838 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/crazy_kitchen.pngbin0 -> 101293 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/crazy_kitchen_fanart.pngbin0 -> 282736 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/cstar.pngbin36243 -> 36243 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/cstar_fanart.pngbin128048 -> 128048 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/france2.pngbin53728 -> 53728 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/france24.pngbin0 -> 72117 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/france24_fanart.pngbin0 -> 70440 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/france2_fanart.pngbin333122 -> 333122 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/france3.pngbin31569 -> 31569 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/france3_fanart.pngbin176208 -> 176208 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/france4.pngbin78093 -> 78093 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/france4_fanart.pngbin0 -> 37397 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/france5.pngbin51222 -> 51222 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/france5_fanart.pngbin0 -> 59985 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/franceinfo.pngbin0 -> 25302 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/franceinfo_fanart.pngbin0 -> 8461 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/franceo.pngbin46934 -> 46934 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/franceo_fanart.pngbin0 -> 131619 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/gulli.pngbin162929 -> 162929 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/gulli_fanart.pngbin318305 -> 318305 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/hd1.pngbin24214 -> 24214 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/hd1_fanart.pngbin629402 -> 629402 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/home.pngbin0 -> 109893 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/home_fanart.pngbin0 -> 142116 bytes
-rw-r--r--plugin.video.catchuptvandmore/resources/media/channels/fr/itele.pngbin26801 -> 0 bytes
-rw-r--r--plugin.video.catchuptvandmore/resources/media/channels/fr/itele_fanart.pngbin85354 -> 0 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/la_1ere.pngbin0 -> 41223 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/la_1ere_fanart.pngbin0 -> 187947 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/lci.pngbin0 -> 72945 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/lci_fanart.pngbin0 -> 31063 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/lcp.pngbin0 -> 41450 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/lcp_fanart.pngbin0 -> 31906 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/lequipe.pngbin32528 -> 32528 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/lequipe_fanart.pngbin82760 -> 82760 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/m6.pngbin125343 -> 125343 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/m6_fanart.pngbin569115 -> 569115 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/nrj12.pngbin73550 -> 73550 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/nrj12_fanart.pngbin340086 -> 340086 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/nt1.pngbin178003 -> 178003 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/nt1_fanart.pngbin339900 -> 339900 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/numero23.pngbin37779 -> 38500 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/numero23_fanart.pngbin0 -> 96249 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/parispremiere.pngbin0 -> 39528 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/parispremiere_fanart.pngbin0 -> 233673 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/publicsenat.pngbin0 -> 34680 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/publicsenat_fanart.pngbin0 -> 72575 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/rmc.pngbin0 -> 55653 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/rmc_fanart.pngbin0 -> 612196 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/rmcdecouverte.pngbin0 -> 105602 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/stories.pngbin0 -> 100143 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/stories_fanart.pngbin0 -> 276211 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/styles.pngbin0 -> 157869 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/styles_fanart.pngbin0 -> 193117 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/teva.pngbin0 -> 49930 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/teva_fanart.pngbin0 -> 60951 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/tf1.pngbin38203 -> 38203 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/tf1_fanart.pngbin694530 -> 694530 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/tfou.pngbin0 -> 249979 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/tfou_fanart.pngbin0 -> 229547 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/tmc.pngbin25166 -> 25166 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/tmc_fanart.pngbin345299 -> 345299 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/media/channels/fr/w9.pngbin115591 -> 115591 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/w9_fanart.pngbin0 -> 31425 bytes
-rwxr-xr-xplugin.video.catchuptvandmore/resources/media/channels/fr/xtra.pngbin0 -> 59140 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/screenshots/screenshot-01.jpgbin534015 -> 534015 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/screenshots/screenshot-02.jpgbin543386 -> 543386 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/screenshots/screenshot-03.jpgbin532567 -> 532567 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/screenshots/screenshot-04.jpgbin809400 -> 809400 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/screenshots/screenshot-05.jpgbin849740 -> 849740 bytes
-rwxr-xr-x[-rw-r--r--]plugin.video.catchuptvandmore/resources/settings.xml266
-rw-r--r--plugin.video.cheddar/LICENSE674
-rw-r--r--plugin.video.cheddar/README.md1
-rw-r--r--plugin.video.cheddar/addon.xml4
-rw-r--r--plugin.video.cheddar/default.py191
-rw-r--r--plugin.video.cheddar/resources/__init__.py0
-rw-r--r--plugin.video.cheddar/resources/lib/__init__.py0
-rw-r--r--plugin.video.cheddar/resources/lib/cheddar.py212
-rw-r--r--plugin.video.cnn/LICENSE674
-rw-r--r--plugin.video.cnn/README.md1
-rw-r--r--plugin.video.cnn/addon.xml29
-rw-r--r--plugin.video.cnn/default.py23
-rw-r--r--plugin.video.cnn/resources/__init__.py0
-rw-r--r--plugin.video.cnn/resources/images/fanart.jpgbin0 -> 137849 bytes
-rw-r--r--plugin.video.cnn/resources/images/icon.pngbin0 -> 36156 bytes
-rw-r--r--plugin.video.cnn/resources/images/screenshot01.pngbin0 -> 593175 bytes
-rw-r--r--plugin.video.cnn/resources/images/screenshot02.pngbin0 -> 712649 bytes
-rw-r--r--plugin.video.cnn/resources/images/screenshot03.pngbin0 -> 735814 bytes
-rw-r--r--plugin.video.cnn/resources/language/resource.language.en_gb/strings.po29
-rw-r--r--plugin.video.cnn/resources/lib/__init__.py0
-rw-r--r--plugin.video.cnn/resources/lib/cnn.py208
-rw-r--r--plugin.video.cnn/resources/settings.xml5
-rw-r--r--plugin.video.conversasabenfica/LICENSE692
-rw-r--r--plugin.video.conversasabenfica/addon.xml34
-rw-r--r--plugin.video.conversasabenfica/changelog.txt2
-rw-r--r--plugin.video.conversasabenfica/main.py9
-rw-r--r--plugin.video.conversasabenfica/resources/__init__.py0
-rw-r--r--plugin.video.conversasabenfica/resources/images/fanart.jpgbin0 -> 321249 bytes
-rw-r--r--plugin.video.conversasabenfica/resources/images/icon.pngbin0 -> 174459 bytes
-rw-r--r--plugin.video.conversasabenfica/resources/images/screenshot-1.pngbin0 -> 1605460 bytes
-rw-r--r--plugin.video.conversasabenfica/resources/images/screenshot-2.pngbin0 -> 1422436 bytes
-rw-r--r--plugin.video.conversasabenfica/resources/images/screenshot-3.pngbin0 -> 1588561 bytes
-rw-r--r--plugin.video.conversasabenfica/resources/images/screenshot-4.pngbin0 -> 2068728 bytes
-rw-r--r--plugin.video.conversasabenfica/resources/language/resource.language.en_gb/strings.po55
-rw-r--r--plugin.video.conversasabenfica/resources/language/resource.language.pt_pt/strings.po57
-rw-r--r--plugin.video.conversasabenfica/resources/lib/__init__.py0
-rw-r--r--plugin.video.conversasabenfica/resources/lib/addonutils.py18
-rw-r--r--plugin.video.conversasabenfica/resources/lib/kodiutils.py85
-rw-r--r--plugin.video.conversasabenfica/resources/lib/plugin.py62
-rw-r--r--plugin.video.conversasabenfica/resources/lib/youtubelib.py143
-rw-r--r--plugin.video.conversasabenfica/resources/settings.xml8
-rw-r--r--plugin.video.earthtouch/LICENSE.txt339
-rw-r--r--plugin.video.earthtouch/addon.py32
-rw-r--r--plugin.video.earthtouch/addon.xml29
-rw-r--r--plugin.video.earthtouch/resources/credits.txt2
-rw-r--r--plugin.video.earthtouch/resources/fanart.jpgbin0 -> 214363 bytes
-rw-r--r--plugin.video.earthtouch/resources/icon.pngbin0 -> 14329 bytes
-rw-r--r--plugin.video.earthtouch/resources/screenshots/screenshot000.jpgbin0 -> 169966 bytes
-rw-r--r--plugin.video.earthtouch/resources/screenshots/screenshot001.jpgbin0 -> 270330 bytes
-rw-r--r--plugin.video.earthtouch/resources/screenshots/screenshot002.jpgbin0 -> 404249 bytes
-rw-r--r--plugin.video.ecbtv/LICENSE21
-rw-r--r--plugin.video.ecbtv/addon.py187
-rw-r--r--plugin.video.ecbtv/addon.xml27
-rw-r--r--plugin.video.ecbtv/resources/__init__.py0
-rw-r--r--plugin.video.ecbtv/resources/fanart.jpgbin0 -> 293139 bytes
-rw-r--r--plugin.video.ecbtv/resources/icon.pngbin0 -> 48179 bytes
-rw-r--r--plugin.video.ecbtv/resources/language/resource.language.en_gb/strings.po45
-rw-r--r--plugin.video.ecbtv/resources/lib/__init__.py0
-rw-r--r--plugin.video.ecbtv/resources/lib/api.py247
-rw-r--r--plugin.video.embycon/addon.xml2
-rw-r--r--plugin.video.embycon/resources/language/resource.language.en_gb/strings.po85
-rw-r--r--plugin.video.embycon/resources/lib/action_menu.py46
-rw-r--r--plugin.video.embycon/resources/lib/downloadutils.py70
-rw-r--r--plugin.video.embycon/resources/lib/functions.py377
-rw-r--r--plugin.video.embycon/resources/lib/menu_functions.py34
-rw-r--r--plugin.video.embycon/resources/lib/play_utils.py174
-rw-r--r--plugin.video.embycon/resources/lib/translation.py20
-rw-r--r--plugin.video.embycon/resources/lib/utils.py231
-rw-r--r--plugin.video.embycon/resources/lib/widgets.py398
-rw-r--r--plugin.video.embycon/resources/settings.xml10
-rw-r--r--plugin.video.embycon/resources/skins/default/720p/ActionMenu.xml67
-rw-r--r--plugin.video.embycon/resources/skins/default/720p/ResumeDialog.xml1
-rw-r--r--plugin.video.embycon/resources/skins/skin.estuary/xml/Home-17.1.xml12
-rw-r--r--plugin.video.embycon/resources/skins/skin.estuary/xml/Home-17.3-elec.xml1064
-rw-r--r--plugin.video.embycon/resources/skins/skin.estuary/xml/Home-17.3.xml18
-rw-r--r--plugin.video.embycon/service.py60
-rw-r--r--plugin.video.fitnessblenderv2/LICENSE692
-rw-r--r--plugin.video.fitnessblenderv2/README.md8
-rw-r--r--plugin.video.fitnessblenderv2/addon.xml32
-rw-r--r--plugin.video.fitnessblenderv2/changelog.txt6
-rw-r--r--plugin.video.fitnessblenderv2/main.py7
-rw-r--r--plugin.video.fitnessblenderv2/resources/__init__.py0
-rw-r--r--plugin.video.fitnessblenderv2/resources/images/banner.pngbin0 -> 36321 bytes
-rw-r--r--plugin.video.fitnessblenderv2/resources/images/fanart.jpgbin0 -> 201013 bytes
-rw-r--r--plugin.video.fitnessblenderv2/resources/images/icon.pngbin0 -> 13266 bytes
-rw-r--r--plugin.video.fitnessblenderv2/resources/images/screenshot000.pngbin0 -> 881171 bytes
-rw-r--r--plugin.video.fitnessblenderv2/resources/images/screenshot001.pngbin0 -> 944370 bytes
-rw-r--r--plugin.video.fitnessblenderv2/resources/images/screenshot002.pngbin0 -> 386394 bytes
-rw-r--r--plugin.video.fitnessblenderv2/resources/language/resource.language.en_gb/strings.po53
-rw-r--r--plugin.video.fitnessblenderv2/resources/language/resource.language.pt_pt/strings.po57
-rw-r--r--plugin.video.fitnessblenderv2/resources/lib/__init__.py0
-rw-r--r--plugin.video.fitnessblenderv2/resources/lib/addonutils.py18
-rw-r--r--plugin.video.fitnessblenderv2/resources/lib/kodiutils.py85
-rw-r--r--plugin.video.fitnessblenderv2/resources/lib/plugin.py62
-rw-r--r--plugin.video.fitnessblenderv2/resources/lib/youtubelib.py143
-rw-r--r--plugin.video.fitnessblenderv2/resources/settings.xml8
-rw-r--r--plugin.video.hak5/addon.xml6
-rw-r--r--plugin.video.hak5/changelog.txt7
-rw-r--r--plugin.video.hak5/resources/lib/hak5_const.py7
-rw-r--r--plugin.video.hak5/resources/lib/hak5_list_episodes.py81
-rw-r--r--plugin.video.hak5/resources/lib/hak5_list_seasons.py10
-rw-r--r--plugin.video.hak5/resources/lib/hak5_main.py18
-rw-r--r--plugin.video.hak5/resources/lib/hak5_play.py25
-rw-r--r--plugin.video.iplayerwww/addon.xml23
-rw-r--r--plugin.video.iplayerwww/default.py3
-rw-r--r--plugin.video.iplayerwww/resources/lib/ipwww_common.py22
-rw-r--r--plugin.video.iplayerwww/resources/lib/ipwww_video.py145
-rw-r--r--plugin.video.itsapixelthing/LICENSE692
-rw-r--r--plugin.video.itsapixelthing/README.md18
-rw-r--r--plugin.video.itsapixelthing/addon.xml32
-rw-r--r--plugin.video.itsapixelthing/changelog.txt2
-rw-r--r--plugin.video.itsapixelthing/main.py9
-rw-r--r--plugin.video.itsapixelthing/resources/__init__.py0
-rw-r--r--plugin.video.itsapixelthing/resources/images/fanart.jpgbin0 -> 690492 bytes
-rw-r--r--plugin.video.itsapixelthing/resources/images/icon.pngbin0 -> 83203 bytes
-rw-r--r--plugin.video.itsapixelthing/resources/images/screenshot-1.pngbin0 -> 1307374 bytes
-rw-r--r--plugin.video.itsapixelthing/resources/images/screenshot-2.pngbin0 -> 1736158 bytes
-rw-r--r--plugin.video.itsapixelthing/resources/images/screenshot-3.pngbin0 -> 1876632 bytes
-rw-r--r--plugin.video.itsapixelthing/resources/images/screenshot-4.pngbin0 -> 2399262 bytes
-rw-r--r--plugin.video.itsapixelthing/resources/language/resource.language.en_gb/strings.po53
-rw-r--r--plugin.video.itsapixelthing/resources/language/resource.language.pt_pt/strings.po57
-rw-r--r--plugin.video.itsapixelthing/resources/lib/__init__.py0
-rw-r--r--plugin.video.itsapixelthing/resources/lib/addonutils.py18
-rw-r--r--plugin.video.itsapixelthing/resources/lib/kodiutils.py85
-rw-r--r--plugin.video.itsapixelthing/resources/lib/plugin.py62
-rw-r--r--plugin.video.itsapixelthing/resources/lib/youtubelib.py143
-rw-r--r--plugin.video.itsapixelthing/resources/settings.xml8
-rw-r--r--plugin.video.johnlocker/LICENSE.txt339
-rw-r--r--plugin.video.johnlocker/addon.py141
-rw-r--r--plugin.video.johnlocker/addon.xml29
-rw-r--r--plugin.video.johnlocker/resources/fanart.jpgbin0 -> 28240 bytes
-rw-r--r--plugin.video.johnlocker/resources/icon.pngbin0 -> 15333 bytes
-rw-r--r--plugin.video.johnlocker/resources/screenshots/screenshot000.jpgbin0 -> 79420 bytes
-rw-r--r--plugin.video.johnlocker/resources/screenshots/screenshot001.jpgbin0 -> 179282 bytes
-rw-r--r--plugin.video.johnlocker/resources/screenshots/screenshot002.jpgbin0 -> 303909 bytes
-rw-r--r--plugin.video.kla.tv/LICENSE.txt674
-rw-r--r--plugin.video.kla.tv/addon.py180
-rw-r--r--plugin.video.kla.tv/addon.xml36
-rw-r--r--plugin.video.kla.tv/resources/fanart.jpgbin0 -> 114702 bytes
-rw-r--r--plugin.video.kla.tv/resources/icon.pngbin0 -> 45705 bytes
-rw-r--r--plugin.video.kla.tv/resources/language/resource.language.de_de/strings.po39
-rw-r--r--plugin.video.kla.tv/resources/language/resource.language.en_gb/strings.po39
-rw-r--r--plugin.video.kla.tv/resources/language/resource.language.fr_fr/strings.po39
-rw-r--r--plugin.video.kla.tv/resources/language/resource.language.pl_pl/strings.po39
-rw-r--r--plugin.video.kla.tv/resources/settings.xml6
-rw-r--r--plugin.video.massengeschmack/addon.xml2
-rw-r--r--plugin.video.massengeschmack/changelog.txt5
-rw-r--r--plugin.video.massengeschmack/resources/datasources/asynchron.json2
-rw-r--r--plugin.video.massengeschmack/resources/datasources/moritz.json20
-rw-r--r--plugin.video.massengeschmack/resources/media/fanart-moritz.jpgbin0 -> 62613 bytes
-rw-r--r--plugin.video.mediacorp/LICENSE.txt282
-rw-r--r--plugin.video.mediacorp/README.txt11
-rw-r--r--plugin.video.mediacorp/addon.xml27
-rw-r--r--plugin.video.mediacorp/changelog.txt4
-rw-r--r--plugin.video.mediacorp/default.py13
-rw-r--r--plugin.video.mediacorp/icon.pngbin0 -> 13344 bytes
-rw-r--r--plugin.video.mediacorp/resources/__init__.py1
-rw-r--r--plugin.video.mediacorp/resources/lib/__init__.py1
-rw-r--r--plugin.video.mediacorp/resources/lib/scraper.py137
-rw-r--r--plugin.video.mediathek/addon.xml2
-rw-r--r--plugin.video.mediathek/changelog.txt1
-rw-r--r--plugin.video.mediathek/mediathek/ard.py27
-rw-r--r--plugin.video.mediathek/mediathek/kika.py74
-rw-r--r--plugin.video.mediathek/simplexbmc.py2
-rw-r--r--plugin.video.metalvideo/LICENSE.txt339
-rw-r--r--plugin.video.metalvideo/addon.py282
-rw-r--r--plugin.video.metalvideo/addon.xml29
-rw-r--r--plugin.video.metalvideo/resources/fanart.jpgbin0 -> 93807 bytes
-rw-r--r--plugin.video.metalvideo/resources/icon.pngbin0 -> 29379 bytes
-rw-r--r--plugin.video.metalvideo/resources/language/resource.language.en_gb/strings.po49
-rw-r--r--plugin.video.metalvideo/resources/screenshots/screenshot000.jpgbin0 -> 162635 bytes
-rw-r--r--plugin.video.metalvideo/resources/screenshots/screenshot001.jpgbin0 -> 192080 bytes
-rw-r--r--plugin.video.metalvideo/resources/screenshots/screenshot002.jpgbin0 -> 305071 bytes
-rw-r--r--plugin.video.metalvideo/resources/settings.xml7
-rw-r--r--plugin.video.mlbtv/addon.xml6
-rw-r--r--plugin.video.mlbtv/main.py28
-rw-r--r--plugin.video.mlbtv/resources/language/resource.language.en_gb/strings.po4
-rw-r--r--plugin.video.mlbtv/resources/lib/globals.py1
-rw-r--r--plugin.video.mlbtv/resources/settings.xml3
-rw-r--r--plugin.video.montreal.greek-tv/LICENSE.txt674
-rw-r--r--plugin.video.montreal.greek-tv/README.md7
-rw-r--r--plugin.video.montreal.greek-tv/addon.py114
-rw-r--r--plugin.video.montreal.greek-tv/addon.xml51
-rw-r--r--plugin.video.montreal.greek-tv/changelog.txt19
-rw-r--r--plugin.video.montreal.greek-tv/fanart.jpgbin0 -> 197387 bytes
-rw-r--r--plugin.video.montreal.greek-tv/icon.pngbin0 -> 19683 bytes
-rw-r--r--plugin.video.montreal.greek-tv/resources/__init__.py1
-rw-r--r--plugin.video.montreal.greek-tv/resources/language/resource.language.el_gr/strings.po40
-rw-r--r--plugin.video.montreal.greek-tv/resources/language/resource.language.en_gb/strings.po39
-rw-r--r--plugin.video.montreal.greek-tv/resources/lib/__init__.py27
-rw-r--r--plugin.video.montreal.greek-tv/resources/lib/cache.py149
-rw-r--r--plugin.video.montreal.greek-tv/resources/lib/control.py147
-rw-r--r--plugin.video.montreal.greek-tv/resources/lib/directory.py146
-rw-r--r--plugin.video.montreal.greek-tv/resources/lib/workers.py34
-rw-r--r--plugin.video.montreal.greek-tv/resources/lib/youtube.py187
-rw-r--r--plugin.video.montreal.greek-tv/resources/media/livetv.pngbin0 -> 19683 bytes
-rw-r--r--plugin.video.montreal.greek-tv/resources/media/radio.pngbin0 -> 14503 bytes
-rw-r--r--plugin.video.montreal.greek-tv/resources/media/youtube.pngbin0 -> 14743 bytes
-rw-r--r--plugin.video.montreal.greek-tv/resources/settings.xml6
-rw-r--r--plugin.video.myvevo/LICENSE.txt282
-rw-r--r--plugin.video.myvevo/README.txt14
-rw-r--r--plugin.video.myvevo/addon.xml27
-rw-r--r--plugin.video.myvevo/changelog.txt8
-rw-r--r--plugin.video.myvevo/default.py13
-rw-r--r--plugin.video.myvevo/fanart.jpgbin0 -> 92278 bytes
-rw-r--r--plugin.video.myvevo/icon.pngbin0 -> 9132 bytes
-rw-r--r--plugin.video.myvevo/resources/__init__.py1
-rw-r--r--plugin.video.myvevo/resources/language/resource.language.en_gb/strings.po91
-rw-r--r--plugin.video.myvevo/resources/lib/__init__.py1
-rw-r--r--plugin.video.myvevo/resources/lib/scraper.py361
-rw-r--r--plugin.video.myvevo/resources/settings.xml10
-rw-r--r--plugin.video.news12/LICENSE.md675
-rw-r--r--plugin.video.news12/addon.xml29
-rw-r--r--plugin.video.news12/default.py23
-rw-r--r--plugin.video.news12/resources/__init__.py0
-rw-r--r--plugin.video.news12/resources/images/fanart.jpgbin0 -> 120821 bytes
-rw-r--r--plugin.video.news12/resources/images/icon.pngbin0 -> 101334 bytes
-rw-r--r--plugin.video.news12/resources/images/screenshot01.pngbin0 -> 617535 bytes
-rw-r--r--plugin.video.news12/resources/images/screenshot02.pngbin0 -> 618461 bytes
-rw-r--r--plugin.video.news12/resources/images/screenshot03.pngbin0 -> 763686 bytes
-rw-r--r--plugin.video.news12/resources/language/resource.language.en_gb/strings.po42
-rw-r--r--plugin.video.news12/resources/lib/__init__.py0
-rw-r--r--plugin.video.news12/resources/lib/news12.py254
-rw-r--r--plugin.video.news12/resources/settings.xml5
-rw-r--r--plugin.video.newsmaxtv/LICENSE.md675
-rw-r--r--plugin.video.newsmaxtv/addon.xml26
-rw-r--r--plugin.video.newsmaxtv/default.py23
-rw-r--r--plugin.video.newsmaxtv/resources/__init__.py0
-rw-r--r--plugin.video.newsmaxtv/resources/images/fanart.jpgbin0 -> 295788 bytes
-rw-r--r--plugin.video.newsmaxtv/resources/images/icon.pngbin0 -> 53826 bytes
-rw-r--r--plugin.video.newsmaxtv/resources/images/screenshot01.pngbin0 -> 1028922 bytes
-rw-r--r--plugin.video.newsmaxtv/resources/images/screenshot02.pngbin0 -> 896103 bytes
-rw-r--r--plugin.video.newsmaxtv/resources/language/resource.language.en_gb/strings.po25
-rw-r--r--plugin.video.newsmaxtv/resources/lib/__init__.py0
-rw-r--r--plugin.video.newsmaxtv/resources/lib/newsmaxtv.py166
-rw-r--r--plugin.video.newsmaxtv/resources/settings.xml4
-rw-r--r--plugin.video.newson/addon.xml8
-rw-r--r--plugin.video.newson/default.py255
-rw-r--r--plugin.video.newson/fanart.jpgbin139008 -> 0 bytes
-rw-r--r--plugin.video.newson/resources/__init__.py0
-rw-r--r--plugin.video.newson/resources/images/fanart.jpgbin0 -> 103323 bytes
-rw-r--r--plugin.video.newson/resources/images/icon.png (renamed from plugin.video.newson/icon.png)bin34531 -> 34531 bytes
-rw-r--r--plugin.video.newson/resources/images/newscast.jpgbin35353 -> 41811 bytes
-rw-r--r--plugin.video.newson/resources/images/videoclips.jpgbin34096 -> 40763 bytes
-rw-r--r--plugin.video.newson/resources/lib/__init__.py0
-rw-r--r--plugin.video.newson/resources/lib/newson.py271
-rw-r--r--plugin.video.newsy/LICENSE.md675
-rw-r--r--plugin.video.newsy/addon.xml28
-rw-r--r--plugin.video.newsy/default.py23
-rw-r--r--plugin.video.newsy/resources/__init__.py0
-rw-r--r--plugin.video.newsy/resources/images/fanart.jpgbin0 -> 174505 bytes
-rw-r--r--plugin.video.newsy/resources/images/icon.pngbin0 -> 47618 bytes
-rw-r--r--plugin.video.newsy/resources/images/screenshot01.pngbin0 -> 585484 bytes
-rw-r--r--plugin.video.newsy/resources/images/screenshot02.pngbin0 -> 867025 bytes
-rw-r--r--plugin.video.newsy/resources/language/resource.language.en_gb/strings.po29
-rw-r--r--plugin.video.newsy/resources/lib/__init__.py0
-rw-r--r--plugin.video.newsy/resources/lib/newsy.py215
-rw-r--r--plugin.video.newsy/resources/settings.xml5
-rw-r--r--plugin.video.nfl.gamepass/README.md64
-rw-r--r--plugin.video.nfl.gamepass/addon.xml24
-rw-r--r--plugin.video.nfl.gamepass/changelog.txt18
-rw-r--r--plugin.video.nfl.gamepass/default.py443
-rw-r--r--plugin.video.nfl.gamepass/resources/language/resource.language.de_de/strings.po (renamed from plugin.video.nfl.gamepass/resources/language/German/strings.po)76
-rw-r--r--plugin.video.nfl.gamepass/resources/language/resource.language.en_gb/strings.po (renamed from plugin.video.nfl.gamepass/resources/language/English/strings.po)24
-rw-r--r--plugin.video.nfl.gamepass/resources/language/resource.language.ja_jp/strings.po (renamed from plugin.video.nfl.gamepass/resources/language/Japanese/strings.po)38
-rw-r--r--plugin.video.nfl.gamepass/resources/language/resource.language.nl_nl/strings.po (renamed from plugin.video.nfl.gamepass/resources/language/Dutch/strings.po)62
-rw-r--r--plugin.video.nfl.gamepass/resources/language/resource.language.ru_ru/strings.po (renamed from plugin.video.nfl.gamepass/resources/language/Russian/strings.po)34
-rw-r--r--plugin.video.nfl.gamepass/resources/language/resource.language.uk_ua/strings.po (renamed from plugin.video.nfl.gamepass/resources/language/Ukrainian/strings.po)34
-rw-r--r--plugin.video.nfl.gamepass/resources/lib/pigskin.py675
-rw-r--r--plugin.video.nfl.gamepass/resources/settings.xml7
-rw-r--r--plugin.video.playonbrowser/LICENSE.md675
-rw-r--r--plugin.video.playonbrowser/README.md5
-rw-r--r--plugin.video.playonbrowser/addon.xml30
-rw-r--r--plugin.video.playonbrowser/default.py339
-rw-r--r--plugin.video.playonbrowser/resources/images/fanart.jpgbin0 -> 90284 bytes
-rw-r--r--plugin.video.playonbrowser/resources/images/icon.pngbin0 -> 129179 bytes
-rw-r--r--plugin.video.playonbrowser/resources/images/screenshot01.pngbin0 -> 673767 bytes
-rw-r--r--plugin.video.playonbrowser/resources/images/screenshot02.pngbin0 -> 369188 bytes
-rw-r--r--plugin.video.playonbrowser/resources/images/screenshot03.pngbin0 -> 553127 bytes
-rw-r--r--plugin.video.playonbrowser/resources/images/screenshot04.pngbin0 -> 543111 bytes
-rw-r--r--plugin.video.playonbrowser/resources/language/resource.language.en_gb/strings.po61
-rw-r--r--plugin.video.playonbrowser/resources/settings.xml10
-rw-r--r--plugin.video.plutotv/addon.xml4
-rw-r--r--plugin.video.plutotv/default.py484
-rw-r--r--plugin.video.plutotv/resources/__init__.py0
-rw-r--r--plugin.video.plutotv/resources/lib/__init__.py0
-rw-r--r--plugin.video.plutotv/resources/lib/plutotv.py493
-rw-r--r--plugin.video.psvue/addon.xml4
-rw-r--r--plugin.video.psvue/main.py80
-rw-r--r--plugin.video.psvue/resources/language/resource.language.en_gb/strings.po59
-rw-r--r--plugin.video.psvue/resources/lib/ps_vue.py266
-rw-r--r--plugin.video.psvue/resources/lib/sony.py162
-rw-r--r--plugin.video.psvue/resources/settings.xml34
-rw-r--r--plugin.video.redbull.tv/LICENSE.txt674
-rw-r--r--plugin.video.redbull.tv/__init__.py0
-rw-r--r--plugin.video.redbull.tv/addon.xml16
-rw-r--r--plugin.video.redbull.tv/default.py85
-rw-r--r--plugin.video.redbull.tv/fanart.jpgbin0 -> 1010633 bytes
-rw-r--r--plugin.video.redbull.tv/icon.pngbin0 -> 73501 bytes
-rw-r--r--plugin.video.redbull.tv/resources/__init__.py0
-rw-r--r--plugin.video.redbull.tv/resources/language/English/strings.xml24
-rw-r--r--plugin.video.redbull.tv/resources/lib/__init__.py0
-rw-r--r--plugin.video.redbull.tv/resources/lib/redbulltv_client.py111
-rw-r--r--plugin.video.redbull.tv/resources/lib/utils.py17
-rw-r--r--plugin.video.redbull.tv/resources/settings.xml6
-rw-r--r--plugin.video.science.friday/LICENSE.txt339
-rw-r--r--plugin.video.science.friday/addon.py154
-rw-r--r--plugin.video.science.friday/addon.xml29
-rw-r--r--plugin.video.science.friday/resources/fanart.jpgbin0 -> 477824 bytes
-rw-r--r--plugin.video.science.friday/resources/icon.pngbin0 -> 4991 bytes
-rw-r--r--plugin.video.science.friday/resources/language/resource.language.en_gb/strings.po45
-rw-r--r--plugin.video.science.friday/resources/screenshots/screenshot000.jpgbin0 -> 123748 bytes
-rw-r--r--plugin.video.science.friday/resources/screenshots/screenshot001.jpgbin0 -> 176832 bytes
-rw-r--r--plugin.video.science.friday/resources/screenshots/screenshot002.jpgbin0 -> 308722 bytes
-rw-r--r--plugin.video.science.friday/resources/settings.xml6
-rw-r--r--plugin.video.simpsonsworld/addon.xml9
-rw-r--r--plugin.video.simpsonsworld/resources/lib/globals.py58
-rw-r--r--plugin.video.simpsonsworld/resources/settings.xml2
-rw-r--r--plugin.video.skynews/LICENSE.md675
-rw-r--r--plugin.video.skynews/addon.xml28
-rw-r--r--plugin.video.skynews/default.py23
-rw-r--r--plugin.video.skynews/resources/__init__.py0
-rw-r--r--plugin.video.skynews/resources/images/fanart.jpgbin0 -> 125067 bytes
-rw-r--r--plugin.video.skynews/resources/images/icon.pngbin0 -> 79615 bytes
-rw-r--r--plugin.video.skynews/resources/images/screenshot01.pngbin0 -> 589143 bytes
-rw-r--r--plugin.video.skynews/resources/images/screenshot02.pngbin0 -> 739755 bytes
-rw-r--r--plugin.video.skynews/resources/language/resource.language.en_gb/strings.po25
-rw-r--r--plugin.video.skynews/resources/lib/__init__.py0
-rw-r--r--plugin.video.skynews/resources/lib/skynews.py171
-rw-r--r--plugin.video.skynews/resources/settings.xml4
-rw-r--r--plugin.video.spiketv/LICENSE674
-rw-r--r--plugin.video.spiketv/README.md1
-rw-r--r--plugin.video.spiketv/addon.xml28
-rw-r--r--plugin.video.spiketv/default.py23
-rw-r--r--plugin.video.spiketv/resources/__init__.py0
-rw-r--r--plugin.video.spiketv/resources/images/fanart.jpgbin0 -> 121527 bytes
-rw-r--r--plugin.video.spiketv/resources/images/icon.pngbin0 -> 26072 bytes
-rw-r--r--plugin.video.spiketv/resources/images/screenshot01.pngbin0 -> 522006 bytes
-rw-r--r--plugin.video.spiketv/resources/images/screenshot02.pngbin0 -> 783908 bytes
-rw-r--r--plugin.video.spiketv/resources/images/screenshot03.pngbin0 -> 731921 bytes
-rw-r--r--plugin.video.spiketv/resources/language/resource.language.en_gb/strings.po29
-rw-r--r--plugin.video.spiketv/resources/lib/__init__.py0
-rw-r--r--plugin.video.spiketv/resources/lib/spiketv.py317
-rw-r--r--plugin.video.spiketv/resources/settings.xml5
-rw-r--r--plugin.video.spurs-tv/addon.py4
-rw-r--r--plugin.video.spurs-tv/addon.xml4
-rw-r--r--plugin.video.spurs-tv/changelog.txt6
-rw-r--r--plugin.video.spurs-tv/resources/lib/new_stadium.py2
-rw-r--r--plugin.video.trekyards/LICENSE674
-rw-r--r--plugin.video.trekyards/README.md1
-rw-r--r--plugin.video.trekyards/addon.xml24
-rw-r--r--plugin.video.trekyards/default.py22
-rw-r--r--plugin.video.trekyards/resources/images/fanart.jpgbin0 -> 259318 bytes
-rw-r--r--plugin.video.trekyards/resources/images/icon.pngbin0 -> 378169 bytes
-rw-r--r--plugin.video.tvvn/LICENSE.txt674
-rw-r--r--plugin.video.tvvn/README.txt11
-rw-r--r--plugin.video.tvvn/addon.xml26
-rw-r--r--plugin.video.tvvn/changelog.txt102
-rw-r--r--plugin.video.tvvn/data.json1165
-rw-r--r--plugin.video.tvvn/fanart.jpgbin0 -> 243286 bytes
-rw-r--r--plugin.video.tvvn/icon.pngbin0 -> 34604 bytes
-rw-r--r--plugin.video.tvvn/resources/language/English/strings.xml16
-rw-r--r--plugin.video.tvvn/resources/logos/antv.pngbin0 -> 10969 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/default.pngbin0 -> 37109 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/globaltv.pngbin0 -> 12247 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/htv7.pngbin0 -> 20659 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/htv9.pngbin0 -> 22230 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/lifetv.pngbin0 -> 16030 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/lsaigontv.pngbin0 -> 24405 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/saigontv.pngbin0 -> 17570 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/sctv.pngbin0 -> 16904 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/vantv.pngbin0 -> 31910 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/vbstv.pngbin0 -> 27141 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/vietfacetv.pngbin0 -> 25004 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/vov.pngbin0 -> 16340 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/vov1.pngbin0 -> 17357 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/vov2.pngbin0 -> 18487 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/vov3.pngbin0 -> 18956 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/vov5.pngbin0 -> 19812 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/vpoptv.pngbin0 -> 14339 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/vtc1.pngbin0 -> 21287 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/vtc10.pngbin0 -> 22156 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/vtc2.pngbin0 -> 21534 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/vtv1.pngbin0 -> 10106 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/vtv2.pngbin0 -> 13642 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/vtv3.pngbin0 -> 13398 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/vtv4.pngbin0 -> 12240 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/vtv6.pngbin0 -> 14623 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/vtv9.pngbin0 -> 13668 bytes
-rw-r--r--plugin.video.tvvn/resources/logos/vyuhatv.pngbin0 -> 25015 bytes
-rw-r--r--plugin.video.tvvn/resources/settings.xml13
-rw-r--r--plugin.video.tvvn/tvvn.py284
-rw-r--r--plugin.video.ustvnow/LICENSE674
-rw-r--r--plugin.video.ustvnow/README.md0
-rw-r--r--plugin.video.ustvnow/addon.xml14
-rw-r--r--plugin.video.ustvnow/default.py634
-rw-r--r--plugin.video.ustvnow/resources/__init__.py0
-rw-r--r--plugin.video.ustvnow/resources/images/screenshot01.pngbin561123 -> 576212 bytes
-rw-r--r--plugin.video.ustvnow/resources/images/screenshot02.pngbin693317 -> 623725 bytes
-rw-r--r--plugin.video.ustvnow/resources/images/screenshot03.pngbin517590 -> 323137 bytes
-rw-r--r--plugin.video.ustvnow/resources/images/screenshot04.pngbin751334 -> 222154 bytes
-rw-r--r--plugin.video.ustvnow/resources/images/screenshot05.pngbin379036 -> 222154 bytes
-rw-r--r--plugin.video.ustvnow/resources/language/resource.language.en_gb/strings.po26
-rw-r--r--plugin.video.ustvnow/resources/lib/__init__.py0
-rw-r--r--plugin.video.ustvnow/resources/lib/net.py (renamed from plugin.video.ustvnow/net.py)63
-rw-r--r--plugin.video.ustvnow/resources/lib/ustvnow.py787
-rw-r--r--plugin.video.ustvnow/resources/settings.xml12
-rw-r--r--plugin.video.ustvnow/resources/skins/default/1080i/script.module.uepg.guide.xml673
-rw-r--r--plugin.video.ustvnow/resources/skins/default/1080i/script.module.uepg.splash.xml21
-rw-r--r--plugin.video.ustvnow/resources/skins/default/media/Arrow.pngbin0 -> 698 bytes
-rw-r--r--plugin.video.ustvnow/resources/skins/default/media/Background.pngbin0 -> 108563 bytes
-rw-r--r--plugin.video.ustvnow/resources/skins/default/media/Bar.pngbin0 -> 473 bytes
-rw-r--r--plugin.video.ustvnow/resources/skins/default/media/Blur.pngbin0 -> 2772469 bytes
-rw-r--r--plugin.video.ustvnow/resources/skins/default/media/ButtonFocus.pngbin0 -> 472 bytes
-rw-r--r--plugin.video.ustvnow/resources/skins/default/media/CC.pngbin0 -> 2104 bytes
-rw-r--r--plugin.video.ustvnow/resources/skins/default/media/Lines.pngbin0 -> 603 bytes
-rw-r--r--plugin.video.ustvnow/resources/skins/default/media/Live.pngbin0 -> 1782 bytes
-rw-r--r--plugin.video.ustvnow/resources/skins/default/media/Overlay.pngbin0 -> 192843 bytes
-rw-r--r--plugin.video.ustvnow/resources/skins/default/media/PastFade.pngbin0 -> 131 bytes
-rw-r--r--plugin.video.ustvnow/resources/skins/default/media/Splash.gifbin0 -> 748468 bytes
-rw-r--r--plugin.video.ustvnow/resources/skins/default/media/Splash.pngbin0 -> 226441 bytes
-rw-r--r--plugin.video.ustvnow/resources/skins/default/media/TimeBar.pngbin0 -> 701 bytes
-rw-r--r--plugin.video.ustvnow/resources/skins/default/media/USTVnow - Copy.pngbin0 -> 15213 bytes
-rw-r--r--plugin.video.ustvnow/resources/skins/default/media/USTVnow.pngbin0 -> 17791 bytes
-rw-r--r--plugin.video.ustvnow/resources/skins/default/media/White.pngbin0 -> 281 bytes
-rw-r--r--plugin.video.ustvnow/resources/skins/default/media/epg-genres/COLOR_ButtonNoFocus.pngbin0 -> 484 bytes
-rw-r--r--plugin.video.vrt.nu/addon.py14
-rw-r--r--plugin.video.vrt.nu/addon.xml26
-rw-r--r--plugin.video.vrt.nu/resources/lib/kodiwrappers/kodiwrapper.py11
-rw-r--r--plugin.video.vrt.nu/resources/lib/kodiwrappers/sortmethod.py1
-rw-r--r--plugin.video.vrt.nu/resources/lib/vrtplayer/urltostreamservice.py8
-rw-r--r--plugin.video.vrt.nu/resources/lib/vrtplayer/vrtplayer.py12
-rw-r--r--plugin.video.wakanim/LICENSE.txt661
-rw-r--r--plugin.video.wakanim/README.md42
-rw-r--r--plugin.video.wakanim/addon.xml36
-rw-r--r--plugin.video.wakanim/changelog.txt25
-rw-r--r--plugin.video.wakanim/default.py37
-rw-r--r--plugin.video.wakanim/fanart.jpgbin0 -> 89082 bytes
-rw-r--r--plugin.video.wakanim/icon.pngbin0 -> 18136 bytes
-rw-r--r--plugin.video.wakanim/resources/__init__.py1
-rw-r--r--plugin.video.wakanim/resources/language/resource.language.de_de/strings.po87
-rw-r--r--plugin.video.wakanim/resources/language/resource.language.en_gb/strings.po87
-rw-r--r--plugin.video.wakanim/resources/language/resource.language.fr_fr/strings.po87
-rw-r--r--plugin.video.wakanim/resources/lib/__init__.py1
-rw-r--r--plugin.video.wakanim/resources/lib/cmdargs.py51
-rw-r--r--plugin.video.wakanim/resources/lib/login.py95
-rw-r--r--plugin.video.wakanim/resources/lib/netapi.py299
-rw-r--r--plugin.video.wakanim/resources/lib/view.py110
-rw-r--r--plugin.video.wakanim/resources/lib/wakanim.py125
-rw-r--r--plugin.video.wakanim/resources/media/screenshot-01.jpgbin0 -> 361928 bytes
-rw-r--r--plugin.video.wakanim/resources/media/screenshot-02.jpgbin0 -> 410309 bytes
-rw-r--r--plugin.video.wakanim/resources/media/screenshot-03.jpgbin0 -> 469164 bytes
-rw-r--r--plugin.video.wakanim/resources/settings.xml7
-rw-r--r--plugin.video.watchmojo/LICENSE.txt339
-rw-r--r--plugin.video.watchmojo/addon.py177
-rw-r--r--plugin.video.watchmojo/addon.xml29
-rw-r--r--plugin.video.watchmojo/resources/fanart.jpgbin0 -> 391386 bytes
-rw-r--r--plugin.video.watchmojo/resources/icon.pngbin0 -> 9174 bytes
-rw-r--r--plugin.video.watchmojo/resources/screenshots/screenshot000.jpgbin0 -> 197586 bytes
-rw-r--r--plugin.video.watchmojo/resources/screenshots/screenshot001.jpgbin0 -> 282268 bytes
-rw-r--r--plugin.video.watchmojo/resources/screenshots/screenshot002.jpgbin0 -> 269275 bytes
656 files changed, 41591 insertions, 5345 deletions
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..2c14b30
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule ".tests"]
+ path = .tests
+ url = https://github.com/xbmc/addon-check.git
diff --git a/.tests b/.tests
new file mode 160000
+Subproject 749ab0cbaa6c42a30b5e4f33bd3acbcae59ac4e
diff --git a/.tests-config.json b/.tests-config.json
new file mode 100644
index 0000000..e55fc18
--- /dev/null
+++ b/.tests-config.json
@@ -0,0 +1,5 @@
+{
+ "check_legacy_language_path": true,
+ "check_legacy_strings_xml": true,
+ "check_license_file_exists": true
+} \ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..33caa66
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,11 @@
+language: python
+python:
+ - "3.6"
+
+install:
+ - pip install Pillow
+
+# command to run our tests
+script:
+ - cd .tests
+ - python check_repo.py \ No newline at end of file
diff --git a/plugin.audio.hearthis_at/addon.py b/plugin.audio.hearthis_at/addon.py
index daf66f7..f1f4e63 100644
--- a/plugin.audio.hearthis_at/addon.py
+++ b/plugin.audio.hearthis_at/addon.py
@@ -86,9 +86,7 @@ def list_users(userlist, pagination = None, first=False, pre=[], post=[]):
for u in userlist:
items.append({'label': '%s%s (%s %s)' % ((u'[\u2665] ' if u.get('following', False) else u''), u['username'], str(u['track_count']), _('tracks')),
'icon': u['avatar_url'],
- 'context_menu': [
- context_item_toggle('follow', u['following'], {'user': u['permalink']})
- ],
+ 'context_menu': context_item_toggle('follow', u['following'], {'user': u['permalink']}),
'path': plugin.url_for('show_user_first', user=u['permalink'], page=1, first=True)})
items = items + post
items.append(pn_button(pagination, 1, len(userlist)))
diff --git a/plugin.audio.hearthis_at/addon.xml b/plugin.audio.hearthis_at/addon.xml
index baa6bb6..4477d9e 100644
--- a/plugin.audio.hearthis_at/addon.xml
+++ b/plugin.audio.hearthis_at/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.audio.hearthis_at" name="Hearthis.at" version="1.0.2" provider-name="Eike Baran">
+<addon id="plugin.audio.hearthis_at" name="Hearthis.at" version="1.0.3" provider-name="Eike Baran">
<requires>
<import addon="xbmc.python" version="2.25.0" />
<import addon="script.module.kodiswift" version="0.0.1" />
@@ -19,6 +19,8 @@
<description lang="de_DE">Hearthis.at ist eine Online-Musikplattform, auf welcher Nutzer ihre Werke hochladen, aufnehmen, bewerben und teilen können. Dieses Addon erlaubt Zugriff auf die wichtigsten Funktionen der Plattform um diese Inhalte abzurufen.</description>
<disclaimer lang="en_GB">Use at own risk. Code may be faulty, clog your drain or kill your cat.</disclaimer>
<news>
+v1.0.3 (2017-08-15)
+- fixed search for artists
v1.0.2 (2017-07-22)
- fixed bug that would prevent non-logged-in users from using the addon
v1.0.1 (2017-07-21)
diff --git a/plugin.googledrive/LICENSE.txt b/plugin.googledrive/LICENSE.txt
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/plugin.googledrive/LICENSE.txt
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/plugin.googledrive/README.md b/plugin.googledrive/README.md
new file mode 100644
index 0000000..2d9fc8f
--- /dev/null
+++ b/plugin.googledrive/README.md
@@ -0,0 +1,15 @@
+# Google Drive KODI Addon
+Google Drive for KODI
+
+Play all your media from Google Drive including Videos, Music and Pictures.
+* Unlimited accounts
+* Playback your music and videos. Listing of videos with thumbnails.
+* Use Google Drive as a source.
+* Subtitles can be assigned automatically if a .str file exists with the same name as the video.
+* Export your videos to your library (.strm files). You can export your music too, but kodi won't support it yet. It's a Kodi issue for now.
+* Show your photos individually or run a slideshow of them. Listing of pictures with thumbnails.
+* Auto-Refreshed slideshow.
+* Use of OAuth 2 login. You don't have to write your user/password within the add-on. Use the login process in your browser.
+* Extremely fast. Using the Google Drive API
+
+This program is not affiliated with or sponsored by Google.
diff --git a/plugin.googledrive/addon.py b/plugin.googledrive/addon.py
new file mode 100644
index 0000000..3c3c91a
--- /dev/null
+++ b/plugin.googledrive/addon.py
@@ -0,0 +1,264 @@
+#-------------------------------------------------------------------------------
+# Copyright (C) 2017 Carlos Guzman (cguZZman) carlosguzmang@protonmail.com
+#
+# This file is part of Google Drive for Kodi
+#
+# Google Drive for Kodi is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Cloud Drive Common Module for Kodi is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+#-------------------------------------------------------------------------------
+
+import datetime
+import urllib
+
+from clouddrive.common.cache.simplecache import SimpleCache
+from clouddrive.common.ui.addon import CloudDriveAddon
+from clouddrive.common.utils import Utils
+from resources.lib.provider.googledrive import GoogleDrive
+from urllib2 import HTTPError
+
+
+class GoogleDriveAddon(CloudDriveAddon):
+ _provider = GoogleDrive()
+ _parameters = {'spaces': 'drive', 'prettyPrint': 'false'}
+ _file_fileds = 'id,name,mimeType,description,hasThumbnail,thumbnailLink,modifiedTime,owners(permissionId),parents,size,imageMediaMetadata(width),videoMediaMetadata'
+ _cache = None
+ _child_count_supported = False
+ _change_token = None
+ _extension_map = {
+ 'html' : 'text/html',
+ 'htm' : 'text/html',
+ 'txt' : 'text/plain',
+ 'rtf' : 'application/rtf',
+ 'odf' : 'application/vnd.oasis.opendocument.text',
+ 'pdf' : 'application/pdf',
+ 'doc' : 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
+ 'docx' : 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
+ 'epub' : 'application/epub+zip',
+ 'xls' : 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+ 'sxc' : 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+ 'csv' : 'text/csv',
+ 'ppt' : 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
+ 'pptx' : 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
+ 'sxi' : 'application/vnd.oasis.opendocument.presentation',
+ 'json' : 'application/vnd.google-apps.script+json'
+ }
+ def __init__(self):
+ self._cache = SimpleCache()
+ super(GoogleDriveAddon, self).__init__()
+
+ def get_provider(self):
+ return self._provider
+
+ def get_my_files_menu_name(self):
+ return self._addon.getLocalizedString(32013)
+
+ def get_custom_drive_folders(self, driveid):
+ self._account_manager.load()
+ drive_folders = []
+ drive_folders.append({'name' : self._common_addon.getLocalizedString(32058), 'path' : 'sharedWithMe'})
+ if self._content_type == 'image':
+ drive_folders.append({'name' : self._addon.getLocalizedString(32007), 'path' : 'photos'})
+ drive_folders.append({'name' : self._addon.getLocalizedString(32014), 'path' : 'starred'})
+ return drive_folders
+
+ def new_change_token_slideshow(self, change_token, driveid, item_driveid=None, item_id=None, path=None):
+ self._provider.configure(self._account_manager, driveid)
+ if not change_token:
+ response = self._provider.get('/changes/startPageToken', parameters = self._parameters)
+ self._change_token = Utils.get_safe_value(response, 'startPageToken')
+ change_token = 1
+ else:
+ page_token = self._change_token
+ while page_token:
+ self._parameters['pageToken'] = page_token
+ self._parameters['fields'] = 'nextPageToken,newStartPageToken,changes(file(id,name,parents))'
+ response = self._provider.get('/changes', parameters = self._parameters)
+ if self.cancel_operation():
+ return
+ self._change_token = Utils.get_safe_value(response, 'newStartPageToken', self._change_token)
+ changes = Utils.get_safe_value(response, 'changes', [])
+ for change in changes:
+ f = Utils.get_safe_value(change, 'file', {})
+ parents = Utils.get_safe_value(f, 'parents', [])
+ parents.append(f['id'])
+ if item_id in parents:
+ return change_token + 1
+ page_token = Utils.get_safe_value(response, 'nextPageToken')
+ return change_token
+
+ def get_folder_items(self, driveid, item_driveid=None, item_id=None, path=None, on_items_page_completed=None):
+ self._provider.configure(self._account_manager, driveid)
+ item_driveid = Utils.default(item_driveid, driveid)
+ self._parameters['fields'] = 'files(%s),nextPageToken' % self._file_fileds
+ if item_id:
+ self._parameters['q'] = '\'%s\' in parents' % item_id
+ elif path == 'sharedWithMe' or path == 'starred':
+ self._parameters['q'] = path
+ elif path == 'photos':
+ self._parameters['spaces'] = path
+ else:
+ if path == '/':
+ self._parameters['q'] = '\'root\' in parents'
+ else:
+ item = self.get_item_by_path(path)
+ self._parameters['q'] = '\'%s\' in parents' % item['id']
+ files = self._provider.get('/files', parameters = self._parameters)
+ if self.cancel_operation():
+ return
+ return self.process_files(driveid, files, on_items_page_completed)
+
+ def search(self, query, driveid, item_driveid=None, item_id=None, on_items_page_completed=None):
+ self._provider.configure(self._account_manager, driveid)
+ item_driveid = Utils.default(item_driveid, driveid)
+ self._parameters['fields'] = 'files(%s)' % self._file_fileds
+ query = 'fullText contains \'%s\'' % query
+ if item_id:
+ query += ' and \'%s\' in parents' % item_id
+ self._parameters['q'] = query
+ files = self._provider.get('/files', parameters = self._parameters)
+ if self.cancel_operation():
+ return
+ return self.process_files(driveid, files, on_items_page_completed)
+
+ def process_files(self, driveid, files, on_items_page_completed=None):
+ items = []
+ for f in files['files']:
+ item = self._extract_item(f)
+ cache_key = self._addonid+'-drive-'+driveid+'-item_driveid-'+item['drive_id']+'-item_id-'+item['id']+'-path-None'
+ self._cache.set(cache_key, f, expiration=datetime.timedelta(minutes=1))
+ items.append(item)
+ if on_items_page_completed:
+ on_items_page_completed(items)
+ if 'nextPageToken' in files:
+ self._parameters['pageToken'] = files['nextPageToken']
+ next_files = self._provider.get('/files', parameters = self._parameters)
+ if self.cancel_operation():
+ return
+ items.extend(self.process_files(driveid, next_files, on_items_page_completed))
+ return items
+
+ def _extract_item(self, f, include_download_info=False):
+ size = long('%s' % Utils.get_safe_value(f, 'size', 0))
+ item = {
+ 'id': f['id'],
+ 'name': f['name'],
+ 'name_extension' : Utils.get_extension(f['name']),
+ 'drive_id' : Utils.get_safe_value(Utils.get_safe_value(f, 'owners', [{}])[0], 'permissionId'),
+ 'mimetype' : Utils.get_safe_value(f, 'mimeType', ''),
+ 'last_modified_date' : Utils.get_safe_value(f,'modifiedTime'),
+ 'size': size,
+ 'description': Utils.get_safe_value(f, 'description', '')
+ }
+ if item['mimetype'] == 'application/vnd.google-apps.folder':
+ item['folder'] = {
+ 'child_count' : 0
+ }
+ if 'videoMediaMetadata' in f:
+ video = f['videoMediaMetadata']
+ item['video'] = {
+ 'width' : Utils.get_safe_value(video, 'width'),
+ 'height' : Utils.get_safe_value(video, 'height'),
+ 'duration' : long('%s' % Utils.get_safe_value(video, 'durationMillis', 0)) / 1000
+ }
+ if 'imageMediaMetadata' in f:
+ item['image'] = {
+ 'size' : size
+ }
+ if 'hasThumbnail' in f and f['hasThumbnail']:
+ item['thumbnail'] = Utils.get_safe_value(f, 'thumbnailLink')
+ if include_download_info:
+ parameters = {
+ 'alt': 'media',
+ 'access_token': self._provider.get_access_tokens()['access_token']
+ }
+ url = self._provider._get_api_url() + '/files/%s' % item['id']
+ if 'size' not in f and item['mimetype'] == 'application/vnd.google-apps.document':
+ url += '/export'
+ parameters['mimeType'] = self.get_mimetype_by_extension(item['name_extension'])
+ item['download_info'] = {
+ 'url' : url + '?%s' % urllib.urlencode(parameters)
+ }
+ return item
+
+ def get_mimetype_by_extension(self, extension):
+ if extension and extension in self._extension_map:
+ return self._extension_map[extension]
+ return self._extension_map['pdf']
+
+ def get_item_by_path(self, path, include_download_info=False):
+ if path[:1] == '/':
+ path = path[1:]
+ if path[-1:] == '/':
+ path = path[:-1]
+ parts = path.split('/')
+ parent = 'root'
+ current_path = ''
+ item = None
+ self._parameters['fields'] = 'files(%s)' % self._file_fileds
+ for part in parts:
+ part = urllib.unquote(part)
+ current_path += '/%s' % part
+ self._parameters['q'] = '\'%s\' in parents and name = \'%s\'' % (parent, part)
+ files = self._provider.get('/files', parameters = self._parameters)
+ if (len(files['files']) > 0):
+ for f in files['files']:
+ item = self._extract_item(f, include_download_info)
+ parent = item['id']
+ cache_key = self._addonid+'-drive-None-item_driveid-None-item_id-None-path-'+current_path
+ self._cache.set(cache_key, f, expiration=datetime.timedelta(minutes=1))
+ break
+ else:
+ item = None
+ break
+ if not item:
+ raise HTTPError(path, 404, 'Not found', None, None)
+ return item
+
+ def get_item(self, driveid, item_driveid=None, item_id=None, path=None, find_subtitles=False, include_download_info=False):
+ self._provider.configure(self._account_manager, driveid)
+ item_driveid = Utils.default(item_driveid, driveid)
+ cache_key = self._addonid+'-drive-'+driveid+'-item_driveid-'+Utils.str(item_driveid)+'-item_id-'+Utils.str(item_id)+'-path-'+Utils.str(path)
+ f = self._cache.get(cache_key)
+ if f:
+ item = self._extract_item(f, include_download_info)
+ else:
+ cache_key = self._addonid+'-drive-None-item_driveid-None-item_id-None-path-'+path
+ f = self._cache.get(cache_key)
+ if f:
+ item = self._extract_item(f, include_download_info)
+ else:
+ self._parameters['fields'] = self._file_fileds
+ if not item_id and path == '/':
+ item_id = 'root'
+ if item_id:
+ f = self._provider.get('/files/%s' % item_id, parameters = self._parameters)
+ self._cache.set(cache_key, f, expiration=datetime.timedelta(seconds=59))
+ item = self._extract_item(f, include_download_info)
+ else:
+ item = self.get_item_by_path(path, include_download_info)
+
+ if find_subtitles:
+ subtitles = []
+ self._parameters['q'] = 'name contains \'%s\'' % urllib.quote(Utils.remove_extension(item['name']))
+ files = self._provider.get('/files', parameters = self._parameters)
+ for f in files['files']:
+ subtitle = self._extract_item(f, include_download_info)
+ if subtitle['name_extension'] == 'srt' or subtitle['name_extension'] == 'sub' or subtitle['name_extension'] == 'sbv':
+ subtitles.append(subtitle)
+ if subtitles:
+ item['subtitles'] = subtitles
+ return item
+
+if __name__ == '__main__':
+ GoogleDriveAddon().route()
+
diff --git a/plugin.googledrive/addon.xml b/plugin.googledrive/addon.xml
new file mode 100644
index 0000000..3234fbf
--- /dev/null
+++ b/plugin.googledrive/addon.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<addon id="plugin.googledrive" name="Google Drive" version="1.0.0" provider-name="Carlos Guzman (cguZZman)">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0" />
+ <import addon="script.module.clouddrive.common"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource" library="addon.py">
+ <provides>image audio video</provides>
+ </extension>
+ <extension point="xbmc.service" library="service.py" start="login" />
+ <extension point="xbmc.addon.metadata">
+ <platform>all</platform>
+ <summary lang="en_GB">Google Drive for KODI</summary>
+ <description lang="en_GB">
+Play all your media from Google Drive including Videos, Music and Pictures.
+ - Unlimited number of accounts.
+ - Search over your drive.
+ - Auto-Refreshed slideshow.
+ - Export your videos to your library (.strm files)
+ - Use Google Drive as a source
+ - This program is not affiliated with or sponsored by Google.
+ </description>
+ <summary lang="he_IL">כונן Google Drive של מיקרוסופט עבור קודי</summary>
+ <description lang="he_IL">
+הפעל את כל המדיה שלך מ- Google Drive כולל וידאו, מוסיקה ותמונות.
+  - מספר בלתי מוגבל של חשבונות.
+  - חיפוש ומציאת הכונן שלך.
+  - ריענון מצגת אוטומטית.
+  - ייצוא קטעי הווידאו לספרייה שלך (קבצי .strm)
+  - שימוש ב-Google Drive כמקור
+  - תוכנית זו אינה קשורה או ממומנת על ידי Google.
+ </description>
+ <license>GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007</license>
+ <source>https://github.com/cguZZman/plugin.googledrive</source>
+ <forum>https://github.com/cguZZman/plugin.googledrive/issues</forum>
+ <website>https://addons.kodi.tv/show/plugin.googledrive</website>
+ <news>v1.0.0 - Nov 6, 2017: First release</news>
+ </extension>
+</addon>
diff --git a/plugin.googledrive/fanart.jpg b/plugin.googledrive/fanart.jpg
new file mode 100644
index 0000000..ea18662
--- /dev/null
+++ b/plugin.googledrive/fanart.jpg
Binary files differ
diff --git a/plugin.googledrive/icon.png b/plugin.googledrive/icon.png
new file mode 100644
index 0000000..e29a502
--- /dev/null
+++ b/plugin.googledrive/icon.png
Binary files differ
diff --git a/plugin.googledrive/resources/__init__.py b/plugin.googledrive/resources/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.googledrive/resources/__init__.py
diff --git a/plugin.googledrive/resources/language/resource.language.en_gb/strings.po b/plugin.googledrive/resources/language/resource.language.en_gb/strings.po
new file mode 100644
index 0000000..763da17
--- /dev/null
+++ b/plugin.googledrive/resources/language/resource.language.en_gb/strings.po
@@ -0,0 +1,77 @@
+# Kodi Media Center language file
+# Addon Name: Google Drive
+# Addon id: plugin.googledrive
+# Addon Provider: Carlos Guzman (cguZZman)
+msgid ""
+msgstr ""
+"Project-Id-Version: Kodi Addons\n"
+"Report-Msgid-Bugs-To: alanwww1@xbmc.org\n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Kodi Translation Team\n"
+"Language-Team: English (http://www.transifex.com/projects/p/xbmc-addons/language/en/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "#32000"
+msgid "Account"
+msgstr ""
+
+msgctxt "#32001"
+msgid "Video Library Export Folder"
+msgstr ""
+
+msgctxt "#32002"
+msgid "Music Library Export Folder"
+msgstr ""
+
+msgctxt "#32003"
+msgid "Before export to library, remove previous files and folders"
+msgstr ""
+
+msgctxt "#32004"
+msgid "When playing videos, set the subtitle file located next to the video (.srt)"
+msgstr ""
+
+msgctxt "#32005"
+msgid "Auto-Refreshed slideshow"
+msgstr ""
+
+msgctxt "#32006"
+msgid "Refresh interval in minutes"
+msgstr ""
+
+msgctxt "#32007"
+msgid "Google Photos"
+msgstr ""
+
+msgctxt "#32008"
+msgid "-unused-Special: Camera Roll"
+msgstr ""
+
+msgctxt "#32009"
+msgid "-unused-Special: Music"
+msgstr ""
+
+msgctxt "#32010"
+msgid "Recursive auto-refreshed slideshow"
+msgstr ""
+
+msgctxt "#32011"
+msgid "Common Settings"
+msgstr ""
+
+msgctxt "#32012"
+msgid "Open Cloud Drive Common Settings..."
+msgstr ""
+
+msgctxt "#32013"
+msgid "My Drive"
+msgstr ""
+
+msgctxt "#32014"
+msgid "Starred"
+msgstr ""
diff --git a/plugin.googledrive/resources/language/resource.language.he_il/strings.po b/plugin.googledrive/resources/language/resource.language.he_il/strings.po
new file mode 100644
index 0000000..83986dc
--- /dev/null
+++ b/plugin.googledrive/resources/language/resource.language.he_il/strings.po
@@ -0,0 +1,77 @@
+# Kodi Media Center language file
+# Addon Name: Google Drive
+# Addon id: plugin.googledrive
+# Addon Provider: Carlos Guzman (cguZZman)
+msgid ""
+msgstr ""
+"Project-Id-Version: Kodi Addons\n"
+"Report-Msgid-Bugs-To: alanwww1@xbmc.org\n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: 2017-10-19 11:41+0300\n"
+"Last-Translator: A. Dambledore\n"
+"Language-Team: Eng2Heb\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: he_IL\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "#32000"
+msgid "Account"
+msgstr "חשבון"
+
+msgctxt "#32001"
+msgid "Video Library Export Folder"
+msgstr "תיקיית ייצוא ספריית וידאו"
+
+msgctxt "#32002"
+msgid "Music Library Export Folder"
+msgstr "תיקיית ייצוא ספריית מוזיקה"
+
+msgctxt "#32003"
+msgid "Before export to library, remove previous files and folders"
+msgstr "לפני ייצוא לספריה, הסר את הקבצים והתיקיות הקודמים"
+
+msgctxt "#32004"
+msgid "When playing videos, set the subtitle file located next to the video (.srt)"
+msgstr "בעת ניגון וידאו, הגדר את קובץ הכתוביות הממוקם ליד הווידאו (.srt)"
+
+msgctxt "#32005"
+msgid "Auto-Refreshed slideshow"
+msgstr "מצגת עם רענון אוטומטי"
+
+msgctxt "#32006"
+msgid "Refresh interval in minutes"
+msgstr "מרווח זמן לרענון בדקות"
+
+msgctxt "#32007"
+msgid "Google Photos"
+msgstr "אלבומי Google"
+
+msgctxt "#32008"
+msgid "-unused-Special: Camera Roll"
+msgstr "-לא בשימוש-מיוחד: סרט צילום"
+
+msgctxt "#32009"
+msgid "-unused-Special: Music"
+msgstr "-לא בשימוש-מיוחד: מוזיקה"
+
+msgctxt "#32010"
+msgid "Recursive auto-refreshed slideshow"
+msgstr "רקורסיבית אוטומטי לרענן שקופיות"
+
+msgctxt "#32011"
+msgid "Common Settings"
+msgstr "הגדרות נפוצות"
+
+msgctxt "#32012"
+msgid "Open Cloud Drive Common Settings..."
+msgstr "פתח הגדרות נפוצות של כונן ענן ..."
+
+msgctxt "#32013"
+msgid "My Drive"
+msgstr "הכונן שלי"
+
+msgctxt "#32014"
+msgid "Starred"
+msgstr "כיכב"
diff --git a/plugin.googledrive/resources/lib/__init__.py b/plugin.googledrive/resources/lib/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.googledrive/resources/lib/__init__.py
diff --git a/plugin.googledrive/resources/lib/provider/__init__.py b/plugin.googledrive/resources/lib/provider/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.googledrive/resources/lib/provider/__init__.py
diff --git a/plugin.googledrive/resources/lib/provider/googledrive.py b/plugin.googledrive/resources/lib/provider/googledrive.py
new file mode 100644
index 0000000..d1e1104
--- /dev/null
+++ b/plugin.googledrive/resources/lib/provider/googledrive.py
@@ -0,0 +1,51 @@
+#-------------------------------------------------------------------------------
+# Copyright (C) 2017 Carlos Guzman (cguZZman) carlosguzmang@protonmail.com
+#
+# This file is part of Google Drive for Kodi
+#
+# Google Drive for Kodi is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Cloud Drive Common Module for Kodi is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+#-------------------------------------------------------------------------------
+
+from clouddrive.common.remote.provider import Provider
+
+
+class GoogleDrive(Provider):
+ __api_url = 'https://www.googleapis.com/drive/v3'
+ _user = None
+
+ def __init__(self):
+ super(GoogleDrive, self).__init__('googledrive')
+
+ def _get_api_url(self):
+ return self.__api_url
+
+ def _get_request_headers(self):
+ return None
+
+ def get_account(self, request_params={}, access_tokens={}):
+ me = self.get('/about', parameters={'fields':'user'}, request_params=request_params, access_tokens=access_tokens)
+ if not me or not 'user' in me:
+ raise Exception('NoAccountInfo')
+ self._user = me['user']
+ return { 'id' : self._user['permissionId'], 'name' : self._user['displayName']}
+
+ def get_drives(self, request_params={}, access_tokens={}):
+ drives = [{
+ 'id' : self._user['permissionId'],
+ 'name' : '',
+ 'type' : ''
+ }]
+ return drives
+
+ \ No newline at end of file
diff --git a/plugin.googledrive/resources/settings.xml b/plugin.googledrive/resources/settings.xml
new file mode 100644
index 0000000..5ac9125
--- /dev/null
+++ b/plugin.googledrive/resources/settings.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<settings >
+ <category label="32000">
+ <setting label="32001" type="folder" id="video_library_folder" option="writeable"/>
+ <setting label="32002" type="folder" id="music_library_folder" option="writeable"/>
+ <setting label="32003" type="bool" id="clean_folder" default="true" value="true"/>
+ <setting label="32004" type="bool" id="set_subtitle" default="true" value="true"/>
+ </category>
+ <category label="32005">
+ <setting label="32006" type="number" id="slideshow_refresh_interval" default="5" value="5"/>
+ <setting label="32010" type="bool" id="slideshow_recursive" default="false" value="false"/>
+ </category>
+ <category label="32011">
+ <setting label="32012" type="action" option="close" action="RunPlugin(plugin://plugin.googledrive/?action=_open_common_settings)"/>
+ </category>
+</settings>
diff --git a/plugin.googledrive/service.py b/plugin.googledrive/service.py
new file mode 100644
index 0000000..7851df0
--- /dev/null
+++ b/plugin.googledrive/service.py
@@ -0,0 +1,26 @@
+#-------------------------------------------------------------------------------
+# Copyright (C) 2017 Carlos Guzman (cguZZman) carlosguzmang@protonmail.com
+#
+# This file is part of Google Drive for Kodi
+#
+# Google Drive for Kodi is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Cloud Drive Common Module for Kodi is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+#-------------------------------------------------------------------------------
+
+from clouddrive.common.service.rpc import RpcService
+from clouddrive.common.service.utils import ServiceUtil
+from addon import GoogleDriveAddon
+
+
+if __name__ == '__main__':
+ ServiceUtil.run([RpcService(GoogleDriveAddon())]) \ No newline at end of file
diff --git a/plugin.onedrive/LICENSE.txt b/plugin.onedrive/LICENSE.txt
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/plugin.onedrive/LICENSE.txt
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/plugin.onedrive/README.md b/plugin.onedrive/README.md
new file mode 100644
index 0000000..2b573b3
--- /dev/null
+++ b/plugin.onedrive/README.md
@@ -0,0 +1,15 @@
+# Onedrive KODI Addon
+OneDrive for KODI
+
+Play all your media from Microsoft OneDrive including Videos, Music and Pictures.
+* Unlimited personal or business accounts
+* Playback your music and videos. Listing of videos with thumbnails.
+* Use OneDrive as a source.
+* Subtitles can be assigned automatically if a .str file exists next to the video.
+* Export your videos to your library (.strm files). You can export your music too, but kodi won't support it yet. It's a Kodi issue for now.
+* Show your photos individually or run a slideshow of them. Listing of pictures with thumbnails.
+* Auto-Refreshed slideshow.
+* Use of OAuth 2 login. You don't have to write your user/password within the add-on. Use the login process in your browser.
+* Extremely fast. Using the Microsoft Graph API
+
+This program is not affiliated with or sponsored by Microsoft.
diff --git a/plugin.onedrive/addon.py b/plugin.onedrive/addon.py
new file mode 100644
index 0000000..c3ab948
--- /dev/null
+++ b/plugin.onedrive/addon.py
@@ -0,0 +1,210 @@
+#-------------------------------------------------------------------------------
+# Copyright (C) 2017 Carlos Guzman (cguZZman) carlosguzmang@protonmail.com
+#
+# This file is part of OneDrive for Kodi
+#
+# OneDrive for Kodi is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Cloud Drive Common Module for Kodi is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+#-------------------------------------------------------------------------------
+
+import datetime
+import urllib
+
+from clouddrive.common.cache.simplecache import SimpleCache
+from clouddrive.common.ui.addon import CloudDriveAddon
+from clouddrive.common.utils import Utils
+from resources.lib.provider.onedrive import OneDrive
+from clouddrive.common.ui.utils import KodiUtils
+from resources.lib.migration import MigrateAccounts
+
+
+class OneDriveAddon(CloudDriveAddon):
+ _provider = OneDrive()
+ _extra_parameters = {'expand': 'thumbnails'}
+ _cache = None
+
+ def __init__(self):
+ self._cache = SimpleCache()
+ super(OneDriveAddon, self).__init__()
+
+ def get_provider(self):
+ return self._provider
+
+ def get_custom_drive_folders(self, driveid):
+ self._account_manager.load()
+ drive = self._account_manager.get_drive_by_driveid(driveid)
+ drive_folders = []
+ if drive['type'] == 'personal':
+ if self._content_type == 'image':
+ path = 'special/photos'
+ params = {'action': '_slideshow', 'content_type': self._content_type, 'driveid': driveid, 'path': path}
+ context_options = [(self._common_addon.getLocalizedString(32032), 'RunPlugin('+self._addon_url + '?' + urllib.urlencode(params)+')')]
+ drive_folders.append({'name' : self._addon.getLocalizedString(32007), 'path' : path, 'context_options': context_options})
+
+ path = 'special/cameraroll'
+ params['path'] = path
+ context_options = [(self._common_addon.getLocalizedString(32032), 'RunPlugin('+self._addon_url + '?' + urllib.urlencode(params)+')')]
+ drive_folders.append({'name' : self._addon.getLocalizedString(32008), 'path' : path, 'context_options': context_options})
+ elif self._content_type == 'audio':
+ drive_folders.append({'name' : self._addon.getLocalizedString(32009), 'path' : 'special/music'})
+ drive_folders.append({'name' : self._common_addon.getLocalizedString(32053), 'path' : 'recent'})
+ if drive['type'] != 'documentLibrary':
+ drive_folders.append({'name' : self._common_addon.getLocalizedString(32058), 'path' : 'sharedWithMe'})
+ return drive_folders
+
+ def get_folder_items(self, driveid, item_driveid=None, item_id=None, path=None, on_items_page_completed=None):
+ self._provider.configure(self._account_manager, driveid)
+ item_driveid = Utils.default(item_driveid, driveid)
+ if item_id:
+ files = self._provider.get('/drives/'+item_driveid+'/items/' + item_id + '/children', parameters = self._extra_parameters)
+ elif path == 'sharedWithMe' or path == 'recent':
+ files = self._provider.get('/drives/'+driveid+'/' + path)
+ else:
+ if path == '/':
+ path = 'root'
+ else:
+ parts = path.split('/')
+ if len(parts) > 1 and not parts[0]:
+ path = 'root:'+path+':'
+ files = self._provider.get('/drives/'+driveid+'/' + path + '/children', parameters = self._extra_parameters)
+ if self.cancel_operation():
+ return
+ return self.process_files(driveid, files, on_items_page_completed)
+
+ def search(self, query, driveid, item_driveid=None, item_id=None, on_items_page_completed=None):
+ self._provider.configure(self._account_manager, driveid)
+ item_driveid = Utils.default(item_driveid, driveid)
+ url = '/drives/'
+ if item_id:
+ url += item_driveid+'/items/' + item_id
+ else:
+ url += driveid
+ url += '/search(q=\''+urllib.quote(query)+'\')'
+ self._extra_parameters['filter'] = 'file ne null'
+ files = self._provider.get(url, parameters = self._extra_parameters)
+ if self.cancel_operation():
+ return
+ return self.process_files(driveid, files, on_items_page_completed)
+
+ def process_files(self, driveid, files, on_items_page_completed=None):
+ items = []
+ for f in files['value']:
+ f = Utils.get_safe_value(f, 'remoteItem', f)
+ item = self._extract_item(f)
+ cache_key = self._addonid+'-drive-'+driveid+'-item_driveid-'+item['drive_id']+'-item_id-'+item['id']+'-path-None'
+ self._cache.set(cache_key, f, expiration=datetime.timedelta(minutes=1))
+ items.append(item)
+ if on_items_page_completed:
+ on_items_page_completed(items)
+ if '@odata.nextLink' in files:
+ next_files = self._provider.get(files['@odata.nextLink'])
+ if self.cancel_operation():
+ return
+ items.extend(self.process_files(driveid, next_files, on_items_page_completed))
+ return items
+
+ def _extract_item(self, f, include_download_info=False):
+ item = {
+ 'id': f['id'],
+ 'name': f['name'],
+ 'name_extension' : Utils.get_extension(f['name']),
+ 'drive_id' : Utils.get_safe_value(Utils.get_safe_value(f, 'parentReference', {}), 'driveId'),
+ 'mimetype' : Utils.get_safe_value(Utils.get_safe_value(f, 'file', {}), 'mimeType'),
+ 'last_modified_date' : Utils.get_safe_value(f,'lastModifiedDateTime'),
+ 'size': Utils.get_safe_value(f, 'size', 0),
+ 'description': Utils.get_safe_value(f, 'description', '')
+ }
+ if 'folder' in f:
+ item['folder'] = {
+ 'child_count' : Utils.get_safe_value(f['folder'],'childCount',0)
+ }
+ if 'video' in f:
+ video = f['video']
+ item['video'] = {
+ 'width' : Utils.get_safe_value(video,'width', 0),
+ 'height' : Utils.get_safe_value(video, 'height', 0),
+ 'duration' : Utils.get_safe_value(video, 'duration', 0) /1000
+ }
+ if 'audio' in f:
+ audio = f['audio']
+ item['audio'] = {
+ 'tracknumber' : Utils.get_safe_value(audio, 'track'),
+ 'discnumber' : Utils.get_safe_value(audio, 'disc'),
+ 'duration' : int(Utils.get_safe_value(audio, 'duration') or '0') / 1000,
+ 'year' : Utils.get_safe_value(audio, 'year'),
+ 'genre' : Utils.get_safe_value(audio, 'genre'),
+ 'album': Utils.get_safe_value(audio, 'album'),
+ 'artist': Utils.get_safe_value(audio, 'artist'),
+ 'title': Utils.get_safe_value(audio, 'title')
+ }
+ if 'image' in f or 'photo' in f:
+ item['image'] = {
+ 'size' : Utils.get_safe_value(f, 'size', 0)
+ }
+ if 'thumbnails' in f and type(f['thumbnails']) == list and len(f['thumbnails']) > 0:
+ thumbnails = f['thumbnails'][0]
+ item['thumbnail'] = Utils.get_safe_value(Utils.get_safe_value(thumbnails, 'large', {}), 'url', '')
+ if include_download_info:
+ item['download_info'] = {
+ 'url' : Utils.get_safe_value(f,'@microsoft.graph.downloadUrl')
+ }
+ return item
+
+ def get_item(self, driveid, item_driveid=None, item_id=None, path=None, find_subtitles=False, include_download_info=False):
+ self._provider.configure(self._account_manager, driveid)
+ item_driveid = Utils.default(item_driveid, driveid)
+ cache_key = self._addonid+'-drive-'+driveid+'-item_driveid-'+Utils.str(item_driveid)+'-item_id-'+Utils.str(item_id)+'-path-'+Utils.str(path)
+ f = self._cache.get(cache_key)
+ if not f :
+ if item_id:
+ f = self._provider.get('/drives/'+item_driveid+'/items/' + item_id, parameters = self._extra_parameters)
+ elif path == 'sharedWithMe' or path == 'recent':
+ return
+ else:
+ if path == '/':
+ path = 'root'
+ else:
+ parts = path.split('/')
+ if len(parts) > 1 and not parts[0]:
+ path = 'root:'+path+':'
+ f = self._provider.get('/drives/'+driveid+'/' + path, parameters = self._extra_parameters)
+ self._cache.set(cache_key, f, expiration=datetime.timedelta(seconds=59))
+ item = self._extract_item(f, include_download_info)
+ if find_subtitles:
+ subtitles = []
+ parent_id = Utils.get_safe_value(Utils.get_safe_value(f, 'parentReference', {}), 'id')
+ search_url = '/drives/'+item_driveid+'/items/' + parent_id + '/search(q=\'{'+urllib.quote(Utils.remove_extension(item['name']))+'}\')'
+ files = self._provider.get(search_url)
+ for f in files['value']:
+ subtitle = self._extract_item(f, include_download_info)
+ if subtitle['name_extension'] == 'srt' or subtitle['name_extension'] == 'sub' or subtitle['name_extension'] == 'sbv':
+ subtitles.append(subtitle)
+ if subtitles:
+ item['subtitles'] = subtitles
+ return item
+
+ def _rename_action(self):
+ self._action = Utils.get_safe_value({
+ 'open_folder': '_list_folder',
+ 'open_drive': '_list_drive',
+ }, self._action, self._action)
+
+if __name__ == '__main__':
+ onedrive_addon = OneDriveAddon()
+ if not KodiUtils.get_addon_setting('migrated'):
+ try:
+ MigrateAccounts()
+ except Exception as e:
+ onedrive_addon._handle_exception(e, False)
+ onedrive_addon.route()
+
diff --git a/plugin.onedrive/addon.xml b/plugin.onedrive/addon.xml
new file mode 100644
index 0000000..3b1bf0c
--- /dev/null
+++ b/plugin.onedrive/addon.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<addon id="plugin.onedrive" name="OneDrive" version="2.0.0" provider-name="Carlos Guzman (cguZZman)">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0" />
+ <import addon="script.module.clouddrive.common"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource" library="addon.py">
+ <provides>image audio video</provides>
+ </extension>
+ <extension point="xbmc.service" library="service.py" start="login" />
+ <extension point="xbmc.addon.metadata">
+ <platform>all</platform>
+ <summary lang="en_GB">Microsoft OneDrive for KODI</summary>
+ <description lang="en_GB">
+Play all your media from OneDrive including Videos, Music and Pictures.
+ - Unlimited number of personal or business accounts.
+ - Search over your drive.
+ - Auto-Refreshed slideshow.
+ - Export your videos to your library (.strm files)
+ - Use OneDrive as a source
+ - This program is not affiliated with or sponsored by Microsoft.
+ </description>
+ <summary lang="he_IL">כונן OneDrive של מיקרוסופט עבור קודי</summary>
+ <description lang="he_IL">
+הפעל את כל המדיה שלך מ- OneDrive כולל וידאו, מוסיקה ותמונות.
+  - מספר בלתי מוגבל של חשבונות אישיים או עסקיים.
+  - חיפוש ומציאת הכונן שלך.
+  - ריענון מצגת אוטומטית.
+  - ייצוא קטעי הווידאו לספרייה שלך (קבצי .strm)
+  - שימוש ב-OneDrive כמקור
+  - תוכנית זו אינה מזוהה עם או בחסות מיקרוסופט.
+ </description>
+ <license>GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007</license>
+ <source>https://github.com/cguZZman/plugin.onedrive</source>
+ <forum>https://github.com/cguZZman/plugin.onedrive/issues</forum>
+ <website>https://addons.kodi.tv/show/plugin.onedrive</website>
+ <news>
+v2.0.0 released Nov 06, 2017:
+- Remake using script.module.clouddrive.common library
+- Fix OneDrive for Business functionality
+ </news>
+ </extension>
+</addon>
diff --git a/plugin.onedrive/fanart.jpg b/plugin.onedrive/fanart.jpg
new file mode 100644
index 0000000..59c89d3
--- /dev/null
+++ b/plugin.onedrive/fanart.jpg
Binary files differ
diff --git a/plugin.onedrive/icon.png b/plugin.onedrive/icon.png
new file mode 100644
index 0000000..7b8a1d9
--- /dev/null
+++ b/plugin.onedrive/icon.png
Binary files differ
diff --git a/plugin.onedrive/resources/__init__.py b/plugin.onedrive/resources/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.onedrive/resources/__init__.py
diff --git a/plugin.onedrive/resources/language/resource.language.en_gb/strings.po b/plugin.onedrive/resources/language/resource.language.en_gb/strings.po
new file mode 100644
index 0000000..bd17338
--- /dev/null
+++ b/plugin.onedrive/resources/language/resource.language.en_gb/strings.po
@@ -0,0 +1,70 @@
+# Kodi Media Center language file
+# Addon Name: OneDrive
+# Addon id: plugin.onedrive
+# Addon Provider: Carlos Guzman (cguZZman)
+msgid ""
+msgstr ""
+"Project-Id-Version: Kodi Addons\n"
+"Report-Msgid-Bugs-To: alanwww1@xbmc.org\n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Kodi Translation Team\n"
+"Language-Team: English (http://www.transifex.com/projects/p/xbmc-addons/language/en/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "#32000"
+msgid "Account"
+msgstr ""
+
+msgctxt "#32001"
+msgid "Video Library Export Folder"
+msgstr ""
+
+msgctxt "#32002"
+msgid "Music Library Export Folder"
+msgstr ""
+
+msgctxt "#32003"
+msgid "Before export to library, remove previous files and folders"
+msgstr ""
+
+msgctxt "#32004"
+msgid "When playing videos, set the subtitle file located next to the video (.srt)"
+msgstr ""
+
+msgctxt "#32005"
+msgid "Auto-Refreshed slideshow"
+msgstr ""
+
+msgctxt "#32006"
+msgid "Refresh interval in minutes"
+msgstr ""
+
+msgctxt "#32007"
+msgid "Special: Photos"
+msgstr ""
+
+msgctxt "#32008"
+msgid "Special: Camera Roll"
+msgstr ""
+
+msgctxt "#32009"
+msgid "Special: Music"
+msgstr ""
+
+msgctxt "#32010"
+msgid "Recursive auto-refreshed slideshow"
+msgstr ""
+
+msgctxt "#32011"
+msgid "Common Settings"
+msgstr ""
+
+msgctxt "#32012"
+msgid "Open Cloud Drive Common Settings..."
+msgstr ""
+
diff --git a/plugin.onedrive/resources/language/resource.language.he_il/strings.po b/plugin.onedrive/resources/language/resource.language.he_il/strings.po
new file mode 100644
index 0000000..dbe8f80
--- /dev/null
+++ b/plugin.onedrive/resources/language/resource.language.he_il/strings.po
@@ -0,0 +1,70 @@
+# Kodi Media Center language file
+# Addon Name: OneDrive
+# Addon id: plugin.onedrive
+# Addon Provider: Carlos Guzman (cguZZman)
+msgid ""
+msgstr ""
+"Project-Id-Version: Kodi Addons\n"
+"Report-Msgid-Bugs-To: alanwww1@xbmc.org\n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: 2017-10-19 11:41+0300\n"
+"Last-Translator: A. Dambledore\n"
+"Language-Team: Eng2Heb\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: he_IL\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "#32000"
+msgid "Account"
+msgstr "חשבון"
+
+msgctxt "#32001"
+msgid "Video Library Export Folder"
+msgstr "תיקיית ייצוא ספריית וידאו"
+
+msgctxt "#32002"
+msgid "Music Library Export Folder"
+msgstr "תיקיית ייצוא ספריית מוזיקה"
+
+msgctxt "#32003"
+msgid "Before export to library, remove previous files and folders"
+msgstr "לפני ייצוא לספריה, הסר את הקבצים והתיקיות הקודמים"
+
+msgctxt "#32004"
+msgid "When playing videos, set the subtitle file located next to the video (.srt)"
+msgstr "בעת ניגון וידאו, הגדר את קובץ הכתוביות הממוקם ליד הווידאו (.srt)"
+
+msgctxt "#32005"
+msgid "Auto-Refreshed slideshow"
+msgstr "מצגת עם רענון אוטומטי"
+
+msgctxt "#32006"
+msgid "Refresh interval in minutes"
+msgstr "מרווח זמן לרענון בדקות"
+
+msgctxt "#32007"
+msgid "Special: Photos"
+msgstr "מיוחד: תמונות"
+
+msgctxt "#32008"
+msgid "Special: Camera Roll"
+msgstr "מיוחד: סיבוב המצלמה"
+
+msgctxt "#32009"
+msgid "Special: Music"
+msgstr "מיוחד: מוסיקה"
+
+msgctxt "#32010"
+msgid "Recursive auto-refreshed slideshow"
+msgstr "רענן מצגת באופן רקורסיבי ואוטומטי"
+
+msgctxt "#32011"
+msgid "Common Settings"
+msgstr "הגדרות נפוצות"
+
+msgctxt "#32012"
+msgid "Open Cloud Drive Common Settings..."
+msgstr "פתח הגדרות נפוצות של כונן ענן ..."
+
diff --git a/plugin.onedrive/resources/lib/__init__.py b/plugin.onedrive/resources/lib/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.onedrive/resources/lib/__init__.py
diff --git a/plugin.onedrive/resources/lib/migration.py b/plugin.onedrive/resources/lib/migration.py
new file mode 100644
index 0000000..2614edc
--- /dev/null
+++ b/plugin.onedrive/resources/lib/migration.py
@@ -0,0 +1,57 @@
+#-------------------------------------------------------------------------------
+# Copyright (C) 2017 Carlos Guzman (cguZZman) carlosguzmang@protonmail.com
+#
+# This file is part of OneDrive for Kodi
+#
+# OneDrive for Kodi is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Cloud Drive Common Module for Kodi is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+#-------------------------------------------------------------------------------
+
+import os
+from clouddrive.common.utils import Utils
+from clouddrive.common.ui.utils import KodiUtils
+from ConfigParser import ConfigParser
+from clouddrive.common.account import AccountManager
+from clouddrive.common.ui.logger import Logger
+from clouddrive.common.exception import UIException
+
+
+class MigrateAccounts(object):
+ def __init__(self):
+ profile_path = Utils.unicode(KodiUtils.translate_path(KodiUtils.get_addon_info('profile')))
+ ini_path = os.path.join(profile_path, 'onedrive.ini')
+ if os.path.exists(ini_path):
+ config = ConfigParser()
+ account_manager = AccountManager(profile_path)
+ config.read(ini_path)
+ for driveid in config.sections():
+ Logger.notice('Migrating drive %s...' % driveid)
+ account = { 'id' : driveid, 'name' : config.get(driveid, 'name')}
+ account['drives'] = [{
+ 'id' : driveid,
+ 'name' : '',
+ 'type' : 'migrated'
+ }]
+ account['access_tokens'] = {
+ 'access_token': config.get(driveid, 'access_token'),
+ 'refresh_token': config.get(driveid, 'refresh_token'),
+ 'expires_in': 0,
+ 'date': 0
+ }
+ try:
+ account_manager.add_account(account)
+ except Exception as e:
+ raise UIException(32021, e)
+ os.remove(ini_path)
+ KodiUtils.set_addon_setting('migrated', 'true')
+ \ No newline at end of file
diff --git a/plugin.onedrive/resources/lib/provider/__init__.py b/plugin.onedrive/resources/lib/provider/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.onedrive/resources/lib/provider/__init__.py
diff --git a/plugin.onedrive/resources/lib/provider/onedrive.py b/plugin.onedrive/resources/lib/provider/onedrive.py
new file mode 100644
index 0000000..f146a6a
--- /dev/null
+++ b/plugin.onedrive/resources/lib/provider/onedrive.py
@@ -0,0 +1,74 @@
+#-------------------------------------------------------------------------------
+# Copyright (C) 2017 Carlos Guzman (cguZZman) carlosguzmang@protonmail.com
+#
+# This file is part of OneDrive for Kodi
+#
+# OneDrive for Kodi is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Cloud Drive Common Module for Kodi is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+#-------------------------------------------------------------------------------
+
+from clouddrive.common.remote.provider import Provider
+from clouddrive.common.utils import Utils
+
+
+class OneDrive(Provider):
+ __api_url = 'https://graph.microsoft.com/v1.0'
+
+ def __init__(self):
+ super(OneDrive, self).__init__('onedrive')
+
+ def _get_api_url(self):
+ return self.__api_url
+
+ def _get_request_headers(self):
+ return None
+
+ def get_account(self, request_params={}, access_tokens={}):
+ me = self.get('/me', request_params=request_params, access_tokens=access_tokens)
+ if not me:
+ raise Exception('NoAccountInfo')
+ return { 'id' : me['id'], 'name' : me['displayName']}
+
+ def get_drives(self, request_params={}, access_tokens={}):
+ response = self.get('/drives', request_params=request_params, access_tokens=access_tokens)
+ drives = []
+ drives_id_list =[]
+ for drive in response['value']:
+ drives_id_list.append(drive['id'])
+ drives.append({
+ 'id' : drive['id'],
+ 'name' : Utils.get_safe_value(drive, 'name', ''),
+ 'type' : drive['driveType']
+ })
+
+ response = self.get('/me/drives', request_params=request_params, access_tokens=access_tokens)
+ for drive in response['value']:
+ if not drive['id'] in drives_id_list:
+ drives_id_list.append(drive['id'])
+ drives.append({
+ 'id' : drive['id'],
+ 'name' : Utils.get_safe_value(drive, 'name', ''),
+ 'type' : drive['driveType']
+ })
+ return drives
+
+ def get_drive_type_name(self, drive_type):
+ if drive_type == 'personal':
+ return 'OneDrive Personal'
+ elif drive_type == 'business':
+ return 'OneDrive for Business'
+ elif drive_type == 'documentLibrary':
+ return ' SharePoint Document Library'
+ return drive_type
+
+ \ No newline at end of file
diff --git a/plugin.onedrive/resources/settings.xml b/plugin.onedrive/resources/settings.xml
new file mode 100644
index 0000000..d4ee6f7
--- /dev/null
+++ b/plugin.onedrive/resources/settings.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<settings >
+ <category label="32000">
+ <setting label="32001" type="folder" id="video_library_folder" option="writeable"/>
+ <setting label="32002" type="folder" id="music_library_folder" option="writeable"/>
+ <setting label="32003" type="bool" id="clean_folder" default="true" value="true"/>
+ <setting label="32004" type="bool" id="set_subtitle" default="true" value="true"/>
+ </category>
+ <category label="32005">
+ <setting label="32006" type="number" id="slideshow_refresh_interval" default="5" value="5"/>
+ <setting label="32010" type="bool" id="slideshow_recursive" default="false" value="false"/>
+ </category>
+ <category label="32011">
+ <setting label="32012" type="action" option="close" action="RunPlugin(plugin://plugin.onedrive/?action=_open_common_settings)"/>
+ </category>
+</settings>
diff --git a/plugin.onedrive/service.py b/plugin.onedrive/service.py
new file mode 100644
index 0000000..2f35115
--- /dev/null
+++ b/plugin.onedrive/service.py
@@ -0,0 +1,26 @@
+#-------------------------------------------------------------------------------
+# Copyright (C) 2017 Carlos Guzman (cguZZman) carlosguzmang@protonmail.com
+#
+# This file is part of OneDrive for Kodi
+#
+# OneDrive for Kodi is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Cloud Drive Common Module for Kodi is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+#-------------------------------------------------------------------------------
+
+from addon import OneDriveAddon
+from clouddrive.common.service.rpc import RpcService
+from clouddrive.common.service.utils import ServiceUtil
+
+
+if __name__ == '__main__':
+ ServiceUtil.run([RpcService(OneDriveAddon())]) \ No newline at end of file
diff --git a/plugin.video.akibapass/LICENSE.txt b/plugin.video.akibapass/LICENSE.txt
new file mode 100644
index 0000000..dba13ed
--- /dev/null
+++ b/plugin.video.akibapass/LICENSE.txt
@@ -0,0 +1,661 @@
+ GNU AFFERO GENERAL PUBLIC LICENSE
+ Version 3, 19 November 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU Affero General Public License is a free, copyleft license for
+software and other kinds of works, specifically designed to ensure
+cooperation with the community in the case of network server software.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+our General Public Licenses are intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ Developers that use our General Public Licenses protect your rights
+with two steps: (1) assert copyright on the software, and (2) offer
+you this License which gives you legal permission to copy, distribute
+and/or modify the software.
+
+ A secondary benefit of defending all users' freedom is that
+improvements made in alternate versions of the program, if they
+receive widespread use, become available for other developers to
+incorporate. Many developers of free software are heartened and
+encouraged by the resulting cooperation. However, in the case of
+software used on network servers, this result may fail to come about.
+The GNU General Public License permits making a modified version and
+letting the public access it on a server without ever releasing its
+source code to the public.
+
+ The GNU Affero General Public License is designed specifically to
+ensure that, in such cases, the modified source code becomes available
+to the community. It requires the operator of a network server to
+provide the source code of the modified version running there to the
+users of that server. Therefore, public use of a modified version, on
+a publicly accessible server, gives the public access to the source
+code of the modified version.
+
+ An older license, called the Affero General Public License and
+published by Affero, was designed to accomplish similar goals. This is
+a different license, not a version of the Affero GPL, but Affero has
+released a new version of the Affero GPL which permits relicensing under
+this license.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU Affero General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Remote Network Interaction; Use with the GNU General Public License.
+
+ Notwithstanding any other provision of this License, if you modify the
+Program, your modified version must prominently offer all users
+interacting with it remotely through a computer network (if your version
+supports such interaction) an opportunity to receive the Corresponding
+Source of your version by providing access to the Corresponding Source
+from a network server at no charge, through some standard or customary
+means of facilitating copying of software. This Corresponding Source
+shall include the Corresponding Source for any work covered by version 3
+of the GNU General Public License that is incorporated pursuant to the
+following paragraph.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the work with which it is combined will remain governed by version
+3 of the GNU General Public License.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU Affero General Public License from time to time. Such new versions
+will be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU Affero General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU Affero General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU Affero General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source. For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code. There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU AGPL, see
+<http://www.gnu.org/licenses/>.
diff --git a/plugin.video.akibapass/README.md b/plugin.video.akibapass/README.md
new file mode 100644
index 0000000..9d3c56a
--- /dev/null
+++ b/plugin.video.akibapass/README.md
@@ -0,0 +1,42 @@
+# Akibapass plugin for Kodi
+
+Akibapass a KODI (XBMC) plugin for Akibapass.de.
+
+Git repo: https://github.com/MrKrabat/plugin.video.akibapass
+
+Forum posting: https://www.kodinerds.net/index.php/Thread/58346-Release-Akibapass-de/
+
+**WARNING: You MUST be a PREMIUM member OR buy videos to use this plugin!**
+***
+
+Compatibility
+
+| Device | Kodi | Status |
+| ------------- | ------------- | ------------- |
+| Windows | 17.x | Yes |
+| Linux | 17.x | Yes |
+| MacOS | 17.x | untested |
+| Android | 17.x | Yes |
+| iOS | 17.x | untested |
+| RaspberryPi | 17.x | Yes |
+***
+
+What this plugin currently can do:
+- [x] Login with your account
+- [x] Search for animes
+- [x] Show "My Downloads"
+- [x] Show "My Collection"
+- [x] Show/browse all available anime
+- [x] Show/browse all seasons/arcs of an anime
+- [x] Show/browse all episodes of an season/arc
+- [x] Display various informations (Kodi displays not all we provide)
+- [x] Reactivate videos/streams
+- [x] Watch videos you have bought
+- [x] Watch videos with premium subscription
+***
+
+_Akibapass is a registered trademark of the peppermint anime gmbh.
+This website and addon is not affiliated with Akibapass or peppermint anime gmbh._
+
+_Kodi® (formerly known as XBMC™) is a registered trademark of the XBMC Foundation.
+This website and addon is not affiliated with Kodi, Team Kodi, or the XBMC Foundation._ \ No newline at end of file
diff --git a/plugin.video.akibapass/addon.xml b/plugin.video.akibapass/addon.xml
new file mode 100644
index 0000000..bcc3af4
--- /dev/null
+++ b/plugin.video.akibapass/addon.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<addon id="plugin.video.akibapass" name="Akibapass" version="0.5.0" provider-name="MrKrabat">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="script.module.beautifulsoup4" version="4.3.2"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource" library="default.py">
+ <provides>video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <platform>all</platform>
+ <language>de</language>
+ <summary lang="en_GB">Watch videos from the german platform Akibapass.de!</summary>
+ <summary lang="de_DE">Schaue Videos von der deutschen Streaming Plattform Akibapass.de!</summary>
+ <description lang="en_GB">All of your favorite series directly from japan here at Akibapass.de. Access new simulcasts and a lot of classics.</description>
+ <description lang="de_DE">Alle deine Lieblingsserien direkt aus Japan bei Akibapass.de. Zugang zu aktuellen Simulcasts und jeder Menge Klassikern.</description>
+ <disclaimer lang="en_GB">WARNING: You MUST be a PREMIUM member or BUY videos to use this plugin</disclaimer>
+ <disclaimer lang="de_DE">HINWEIS: Du MUSST PREMIUM Mitglied sein oder Videos KAUFEN um dieses Plugin zu benutzen</disclaimer>
+ <news>v0.5.0 (2017.10.10)[CR]- Removed internal server redirect</news>
+ <license>GNU Affero General Public License, v3</license>
+ <forum>https://www.kodinerds.net/index.php/Thread/58346-Release-Akibapass-de/</forum>
+ <website>https://www.akibapass.de/</website>
+ <source>https://github.com/MrKrabat/plugin.video.akibapass</source>
+ <email></email>
+ <assets>
+ <icon>icon.png</icon>
+ <fanart>fanart.jpg</fanart>
+ <screenshot>resources/media/screenshot-01.jpg</screenshot>
+ <screenshot>resources/media/screenshot-02.jpg</screenshot>
+ <screenshot>resources/media/screenshot-03.jpg</screenshot>
+ </assets>
+ </extension>
+</addon>
diff --git a/plugin.video.akibapass/changelog.txt b/plugin.video.akibapass/changelog.txt
new file mode 100644
index 0000000..0ba01cb
--- /dev/null
+++ b/plugin.video.akibapass/changelog.txt
@@ -0,0 +1,18 @@
+v0.5.0 (2017.10.10)
+- Removed internal server redirect
+
+v0.3.0 (2017.10.10)
+- Added screenshots
+- Small optimations
+- Internal rewrites
+- Fixed possible encoding problem
+
+v0.2.1 (2017.10.07)
+- Removed playback of downloadable videos (streaming still possible)
+
+v0.2.0 (2017.10.03)
+- Added video streaming
+- Added API
+
+v0.1.0 (2017.09.20)
+- Initial BETA release
diff --git a/plugin.video.akibapass/default.py b/plugin.video.akibapass/default.py
new file mode 100644
index 0000000..11f2571
--- /dev/null
+++ b/plugin.video.akibapass/default.py
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+# Akibapass - Watch videos from the german anime platform Akibapass.de on Kodi.
+# Copyright (C) 2016 - 2017 MrKrabat
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import sys
+import xbmc
+import xbmcaddon
+
+
+_plugId = "plugin.video.akibapass"
+
+# plugin constants
+_addon = xbmcaddon.Addon(id=_plugId)
+_plugin = _addon.getAddonInfo("name")
+_version = _addon.getAddonInfo("version")
+
+xbmc.log("[PLUGIN] %s: version %s initialized" % (_plugin, _version))
+
+if __name__ == "__main__":
+ from resources.lib import akibapass
+ # start addon
+ akibapass.main()
+
+sys.modules.clear()
diff --git a/plugin.video.akibapass/fanart.jpg b/plugin.video.akibapass/fanart.jpg
new file mode 100644
index 0000000..92a1307
--- /dev/null
+++ b/plugin.video.akibapass/fanart.jpg
Binary files differ
diff --git a/plugin.video.akibapass/icon.png b/plugin.video.akibapass/icon.png
new file mode 100644
index 0000000..8754f98
--- /dev/null
+++ b/plugin.video.akibapass/icon.png
Binary files differ
diff --git a/plugin.video.akibapass/resources/__init__.py b/plugin.video.akibapass/resources/__init__.py
new file mode 100644
index 0000000..b93054b
--- /dev/null
+++ b/plugin.video.akibapass/resources/__init__.py
@@ -0,0 +1 @@
+# Dummy file to make this directory a package.
diff --git a/plugin.video.akibapass/resources/language/resource.language.de_de/strings.po b/plugin.video.akibapass/resources/language/resource.language.de_de/strings.po
new file mode 100644
index 0000000..8ff3032
--- /dev/null
+++ b/plugin.video.akibapass/resources/language/resource.language.de_de/strings.po
@@ -0,0 +1,71 @@
+# Kodi Media Center language file
+msgid ""
+msgstr ""
+"Project-Id-Version: Kodi Addons\n"
+"Report-Msgid-Bugs-To: alanwww1@kodi.org\n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: de\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+
+# Akibapass Settings
+
+msgctxt "#30001"
+msgid "Username"
+msgstr "Benutzername"
+
+msgctxt "#30002"
+msgid "Password"
+msgstr "Passwort"
+
+
+# Akibapass Menue
+
+msgctxt "#30020"
+msgid "Catalog"
+msgstr "Katalog"
+
+msgctxt "#30021"
+msgid "Search"
+msgstr "Suchen"
+
+msgctxt "#30022"
+msgid "My downloads"
+msgstr "Meine Downloads"
+
+msgctxt "#30023"
+msgid "My collection"
+msgstr "Meine Sammlung"
+
+msgctxt "#30024"
+msgid "Watch trailer"
+msgstr "Trailer ansehen"
+
+
+# Akibapass Messages
+
+msgctxt "#30040"
+msgid "Login failed"
+msgstr "Login fehlgeschlagen"
+
+msgctxt "#30041"
+msgid "An error occurred"
+msgstr "Ein Fehler ist aufgetreten"
+
+msgctxt "#30042"
+msgid "Reactivation failed of this video"
+msgstr "Reaktivierung fehlgeschlagen dieses Videos"
+
+msgctxt "#30043"
+msgid "You need to be a premium member or own this video"
+msgstr "Du musst premium nutzer sein oder das Video gekauft haben"
+
+msgctxt "#30044"
+msgid "Failed to play video"
+msgstr "Fehlgeschlagen das Video abzuspielen"
diff --git a/plugin.video.akibapass/resources/language/resource.language.en_gb/strings.po b/plugin.video.akibapass/resources/language/resource.language.en_gb/strings.po
new file mode 100644
index 0000000..113396e
--- /dev/null
+++ b/plugin.video.akibapass/resources/language/resource.language.en_gb/strings.po
@@ -0,0 +1,71 @@
+# Kodi Media Center language file
+msgid ""
+msgstr ""
+"Project-Id-Version: Kodi Addons\n"
+"Report-Msgid-Bugs-To: alanwww1@kodi.org\n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+
+# Akibapass Settings
+
+msgctxt "#30001"
+msgid "Username"
+msgstr ""
+
+msgctxt "#30002"
+msgid "Password"
+msgstr ""
+
+
+# Akibapass Menue
+
+msgctxt "#30020"
+msgid "Catalog"
+msgstr ""
+
+msgctxt "#30021"
+msgid "Search"
+msgstr ""
+
+msgctxt "#30022"
+msgid "My downloads"
+msgstr ""
+
+msgctxt "#30023"
+msgid "My collection"
+msgstr ""
+
+msgctxt "#30024"
+msgid "Watch trailer"
+msgstr ""
+
+
+# Akibapass Messages
+
+msgctxt "#30040"
+msgid "Login failed"
+msgstr ""
+
+msgctxt "#30041"
+msgid "An error occurred"
+msgstr ""
+
+msgctxt "#30042"
+msgid "Reactivation failed of this video"
+msgstr ""
+
+msgctxt "#30043"
+msgid "You need to be a premium member or own this video"
+msgstr ""
+
+msgctxt "#30044"
+msgid "Failed to play video"
+msgstr ""
diff --git a/plugin.video.akibapass/resources/lib/__init__.py b/plugin.video.akibapass/resources/lib/__init__.py
new file mode 100644
index 0000000..b93054b
--- /dev/null
+++ b/plugin.video.akibapass/resources/lib/__init__.py
@@ -0,0 +1 @@
+# Dummy file to make this directory a package.
diff --git a/plugin.video.akibapass/resources/lib/akibapass.py b/plugin.video.akibapass/resources/lib/akibapass.py
new file mode 100644
index 0000000..5a6e7ac
--- /dev/null
+++ b/plugin.video.akibapass/resources/lib/akibapass.py
@@ -0,0 +1,114 @@
+# -*- coding: utf-8 -*-
+# Akibapass - Watch videos from the german anime platform Akibapass.de on Kodi.
+# Copyright (C) 2016 - 2017 MrKrabat
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import sys
+
+import xbmc
+import xbmcgui
+import xbmcplugin
+
+import cmdargs
+import login
+import netapi
+import view
+
+
+def main():
+ """Main function for the addon
+ """
+ args = cmdargs.parse()
+
+ # check if account is set
+ username = args._addon.getSetting("akiba_username")
+ password = args._addon.getSetting("akiba_password")
+
+ if not (username and password):
+ # open addon settings
+ args._addon.openSettings()
+ return False
+ else:
+ # login
+ success = login.login(username, password, args)
+ if success:
+ # list menue
+ xbmcplugin.setContent(int(sys.argv[1]), "tvshows")
+ check_mode(args)
+ else:
+ # login failed
+ xbmc.log("[PLUGIN] %s: Login failed" % args._addonname, xbmc.LOGERROR)
+ xbmcgui.Dialog().ok(args._addonname, args._addon.getLocalizedString(30040))
+ return False
+
+
+def check_mode(args):
+ """Run mode-specific functions
+ """
+ if hasattr(args, "mode"):
+ mode = args.mode
+ elif hasattr(args, "id"):
+ # call from other plugin
+ mode = "videoplay"
+ args.url = "/de/v2/catalogue/episode/" + args.id
+ elif hasattr(args, "url"):
+ # call from other plugin
+ mode = "videoplay"
+ args.url = args.url[24:]
+ else:
+ mode = None
+
+ if not mode:
+ showMainMenue(args)
+ elif mode == "catalog":
+ netapi.showCatalog(args)
+ elif mode == "search":
+ netapi.searchAnime(args)
+ elif mode == "downloads":
+ netapi.myDownloads(args)
+ elif mode == "collection":
+ netapi.myCollection(args)
+ elif mode == "list_season":
+ netapi.listSeason(args)
+ elif mode == "list_episodes":
+ netapi.listEpisodes(args)
+ elif mode == "videoplay":
+ netapi.startplayback(args)
+ elif mode == "trailer":
+ item = xbmcgui.ListItem(getattr(args, "title", "Title not provided"), path=args.url)
+ xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item)
+ else:
+ # unkown mode
+ xbmc.log("[PLUGIN] %s: Failed in check_mode '%s'" % (args._addonname, str(mode)), xbmc.LOGERROR)
+ xbmcgui.Dialog().notification(args._addonname, args._addon.getLocalizedString(30041), xbmcgui.NOTIFICATION_ERROR)
+ showMainMenue(args)
+
+
+def showMainMenue(args):
+ """Show main menu
+ """
+ view.add_item(args,
+ {"title": args._addon.getLocalizedString(30020),
+ "mode": "catalog"})
+ view.add_item(args,
+ {"title": args._addon.getLocalizedString(30021),
+ "mode": "search"})
+ view.add_item(args,
+ {"title": args._addon.getLocalizedString(30022),
+ "mode": "downloads"})
+ view.add_item(args,
+ {"title": args._addon.getLocalizedString(30023),
+ "mode": "collection"})
+ view.endofdirectory()
diff --git a/plugin.video.akibapass/resources/lib/cmdargs.py b/plugin.video.akibapass/resources/lib/cmdargs.py
new file mode 100644
index 0000000..61cc975
--- /dev/null
+++ b/plugin.video.akibapass/resources/lib/cmdargs.py
@@ -0,0 +1,51 @@
+# -*- coding: utf-8 -*-
+# Akibapass - Watch videos from the german anime platform Akibapass.de on Kodi.
+# Copyright (C) 2016 - 2017 MrKrabat
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import sys
+import urllib
+import urlparse
+
+
+def parse():
+ """Decode arguments
+ """
+ if (sys.argv[2]):
+ return Args(urlparse.parse_qs(sys.argv[2][1:]))
+ else:
+ return Args({})
+
+
+class Args(object):
+ """Arguments class
+ Hold all arguments passed to the script and also persistent user data and
+ reference to the addon. It is intended to hold all data necessary for the
+ script.
+ """
+ def __init__(self, kwargs):
+ """Initialize arguments object
+ Hold also references to the addon which can't be kept at module level.
+ """
+ self._addon = sys.modules["__main__"]._addon
+ self._addonname = sys.modules["__main__"]._plugin
+ self._addonid = sys.modules["__main__"]._plugId
+ self._cj = None
+
+ for key, value in kwargs.iteritems():
+ if value:
+ kwargs[key] = urllib.unquote_plus(value[0])
+
+ self.__dict__.update(kwargs)
diff --git a/plugin.video.akibapass/resources/lib/login.py b/plugin.video.akibapass/resources/lib/login.py
new file mode 100644
index 0000000..d8df6ba
--- /dev/null
+++ b/plugin.video.akibapass/resources/lib/login.py
@@ -0,0 +1,95 @@
+# -*- coding: utf-8 -*-
+# Akibapass - Watch videos from the german anime platform Akibapass.de on Kodi.
+# Copyright (C) 2016 - 2017 MrKrabat
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import os
+import cookielib
+import urllib
+import urllib2
+
+import xbmc
+
+
+def login(username, password, args):
+ """Login and session handler
+ """
+ login_url = "https://www.akibapass.de/de/v2/account/login?ReturnUrl=%2Fde%2Fv2"
+
+ # create cookie path
+ cookiepath = os.path.join(
+ xbmc.translatePath(args._addon.getAddonInfo("profile")).decode("utf-8"),
+ "cookies.lwp")
+
+ # create cookiejar
+ cj = cookielib.LWPCookieJar()
+ args._cj = cj
+
+ # lets urllib2 handle cookies
+ opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
+ opener.addheaders = [("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36")]
+ opener.addheaders = [("Accept-Charset", "utf-8")]
+ urllib2.install_opener(opener)
+
+ # check if session exists
+ try:
+ cj.load(cookiepath, ignore_discard=True)
+
+ # check if session is valid
+ response = urllib2.urlopen("https://www.akibapass.de/de/v2/catalogue")
+ html = response.read()
+
+ if "Meine pers&#246;nlichen Informationen bearbeiten" in html:
+ # session is valid
+ return True
+
+ except IOError:
+ # cookie file does not exist
+ pass
+
+ # build POST data
+ post_data = urllib.urlencode({"username": username,
+ "password": password,
+ "remember": "1"})
+
+ # POST to login page
+ response = urllib2.urlopen(login_url, post_data)
+
+ # check for login string
+ html = response.read()
+
+ if "Meine pers&#246;nlichen Informationen bearbeiten" in html:
+ # save session to disk
+ cj.save(cookiepath, ignore_discard=True)
+ return True
+ else:
+ return False
+
+
+def getCookie(args):
+ """Returns all cookies as string and urlencoded
+ """
+ # create cookie path
+ cookiepath = os.path.join(
+ xbmc.translatePath(args._addon.getAddonInfo("profile")).decode("utf-8"),
+ "cookies.lwp")
+ # save session to disk
+ args._cj.save(cookiepath, ignore_discard=True)
+
+ ret = ""
+ for cookie in args._cj:
+ ret += urllib.urlencode({cookie.name : cookie.value}) + ";"
+
+ return "|User-Agent=Mozilla%2F5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F60.0.3112.113%20Safari%2F537.36&Cookie=" + ret[:-1]
diff --git a/plugin.video.akibapass/resources/lib/netapi.py b/plugin.video.akibapass/resources/lib/netapi.py
new file mode 100644
index 0000000..16abaa6
--- /dev/null
+++ b/plugin.video.akibapass/resources/lib/netapi.py
@@ -0,0 +1,294 @@
+# -*- coding: utf-8 -*-
+# Akibapass - Watch videos from the german anime platform Akibapass.de on Kodi.
+# Copyright (C) 2016 - 2017 MrKrabat
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import re
+import sys
+import urllib
+import urllib2
+from bs4 import BeautifulSoup
+
+import xbmc
+import xbmcgui
+import xbmcplugin
+
+import login
+import view
+
+
+def showCatalog(args):
+ """Show all animes
+ """
+ response = urllib2.urlopen("https://www.akibapass.de/de/v2/catalogue")
+ html = response.read()
+
+ soup = BeautifulSoup(html, "html.parser")
+ ul = soup.find("ul", {"class": "catalog_list"})
+
+ for li in ul.find_all("li"):
+ plot = li.find("p", {"class": "tooltip_text"})
+ stars = li.find("div", {"class": "stars"})
+ star = stars.find_all("span", {"class": "-no"})
+ thumb = li.img["src"].replace(" ", "%20")
+ if thumb[:4] != "http":
+ thumb = "https:" + thumb
+
+ view.add_item(args,
+ {"url": li.a["href"],
+ "title": li.find("div", {"class": "slider_item_description"}).span.strong.string.strip().encode("utf-8"),
+ "tvshowtitle": li.find("div", {"class": "slider_item_description"}).span.strong.string.strip().encode("utf-8"),
+ "mode": "list_season",
+ "thumb": thumb,
+ "fanart": thumb,
+ "rating": str(10 - len(star) * 2),
+ "plot": plot.contents[3].string.strip().encode("utf-8"),
+ "year": li.time.string.strip().encode("utf-8")},
+ isFolder=True, mediatype="video")
+
+ view.endofdirectory()
+
+
+def searchAnime(args):
+ """Search for animes
+ """
+ d = xbmcgui.Dialog().input(args._addon.getLocalizedString(30021), type=xbmcgui.INPUT_ALPHANUM)
+ if not d:
+ return
+
+ post_data = urllib.urlencode({"search": d})
+ response = urllib2.urlopen("https://www.akibapass.de/de/v2/catalogue/search", post_data)
+ html = response.read()
+
+ soup = BeautifulSoup(html, "html.parser")
+ ul = soup.find("ul", {"class": "catalog_list"})
+ if not ul:
+ view.endofdirectory()
+ return
+
+ for li in ul.find_all("li"):
+ plot = li.find("p", {"class": "tooltip_text"})
+ stars = li.find("div", {"class": "stars"})
+ star = stars.find_all("span", {"class": "-no"})
+ thumb = li.img["src"].replace(" ", "%20")
+ if thumb[:4] != "http":
+ thumb = "https:" + thumb
+
+ view.add_item(args,
+ {"url": li.a["href"],
+ "title": li.find("div", {"class": "slider_item_description"}).span.strong.string.strip().encode("utf-8"),
+ "mode": "list_season",
+ "thumb": thumb,
+ "fanart": thumb,
+ "rating": str(10 - len(star) * 2),
+ "plot": plot.contents[3].string.strip().encode("utf-8"),
+ "year": li.time.string.strip().encode("utf-8")},
+ isFolder=True, mediatype="video")
+
+ view.endofdirectory()
+
+
+def myDownloads(args):
+ """View download able animes
+ May not every episode is download able.
+ """
+ response = urllib2.urlopen("https://www.akibapass.de/de/v2/mydownloads")
+ html = response.read()
+
+ soup = BeautifulSoup(html, "html.parser")
+ container = soup.find("div", {"class": "big-item-list"})
+ if not container:
+ view.endofdirectory()
+ return
+
+ for div in container.find_all("div", {"class": "big-item-list_item"}):
+ thumb = div.img["src"].replace(" ", "%20")
+ if thumb[:4] != "http":
+ thumb = "https:" + thumb
+
+ view.add_item(args,
+ {"url": div.a["href"].replace("mydownloads/detail", "catalogue/show"),
+ "title": div.find("h3", {"class": "big-item_title"}).string.strip().encode("utf-8"),
+ "mode": "list_season",
+ "thumb": thumb,
+ "fanart": thumb},
+ isFolder=True, mediatype="video")
+
+ view.endofdirectory()
+
+
+def myCollection(args):
+ """View collection
+ """
+ response = urllib2.urlopen("https://www.akibapass.de/de/v2/collection")
+ html = response.read()
+
+ soup = BeautifulSoup(html, "html.parser")
+ container = soup.find("div", {"class": "big-item-list"})
+ if not container:
+ view.endofdirectory()
+ return
+
+ for div in container.find_all("div", {"class": "big-item-list_item"}):
+ thumb = div.img["src"].replace(" ", "%20")
+ if thumb[:4] != "http":
+ thumb = "https:" + thumb
+
+ view.add_item(args,
+ {"url": div.a["href"].replace("collection/detail", "catalogue/show"),
+ "title": div.find("h3", {"class": "big-item_title"}).string.strip().encode("utf-8"),
+ "mode": "list_season",
+ "thumb": thumb,
+ "fanart": thumb},
+ isFolder=True, mediatype="video")
+
+ view.endofdirectory()
+
+
+def listSeason(args):
+ """Show all seasons/arcs of an anime
+ """
+ response = urllib2.urlopen("https://www.akibapass.de" + args.url)
+ html = response.read()
+
+ soup = BeautifulSoup(html, "html.parser")
+
+ date = soup.find_all("span", {"class": "border-list_text"})[0].find_all("span")
+ year = date[2].string.strip().encode("utf-8")
+ date = year + "-" + date[1].string.strip().encode("utf-8") + "-" + date[0].string.strip().encode("utf-8")
+ originaltitle = soup.find_all("span", {"class": "border-list_text"})[1].string.strip().encode("utf-8")
+ studio = soup.find_all("span", {"class": "border-list_text"})[2].string.strip().encode("utf-8")
+ plot = soup.find("div", {"class": "serie_description"}).string.strip().encode("utf-8")
+ credits = soup.find("div", {"class": "serie_description_more"}).p.string.strip().encode("utf-8")
+ try:
+ trailer = soup.find("span", {"class": "js-video-open"})["data-video"]
+ trailer = "plugin://plugin.video.youtube/play/?video_id=" + trailer
+ view.add_item(args,
+ {"url": trailer,
+ "mode": "trailer",
+ "thumb": args.thumb.replace(" ", "%20"),
+ "fanart": args.fanart.replace(" ", "%20"),
+ "title": args._addon.getLocalizedString(30024)},
+ isFolder=False, mediatype="video")
+ except TypeError:
+ trailer = ""
+
+ for section in soup.find_all("h2", {"class": "slider-section_title"}):
+ if not section.span:
+ continue
+ title = section.get_text()[6:].strip()
+
+ view.add_item(args,
+ {"url": args.url,
+ "title": title.encode("utf-8"),
+ "mode": "list_episodes",
+ "thumb": args.thumb.replace(" ", "%20"),
+ "fanart": args.fanart.replace(" ", "%20"),
+ "season": title.encode("utf-8"),
+ "plot": plot,
+ "plotoutline": getattr(args, "plot", ""),
+ "studio": studio,
+ "year": year,
+ "premiered": date,
+ "trailer": trailer,
+ "originaltitle": originaltitle,
+ "credits": credits},
+ isFolder=True, mediatype="video")
+
+ view.endofdirectory()
+
+
+def listEpisodes(args):
+ """Show all episodes of an season/arc
+ """
+ response = urllib2.urlopen("https://www.akibapass.de" + args.url)
+ html = response.read()
+
+ soup = BeautifulSoup(html, "html.parser")
+
+ for season in soup.findAll(text=args.title):
+ parent = season.find_parent("li")
+ if not parent:
+ continue
+
+ thumb = parent.img["src"].replace(" ", "%20")
+ if thumb[:4] != "http":
+ thumb = "https:" + thumb
+
+ view.add_item(args,
+ {"url": parent.a["href"],
+ "title": parent.img["alt"].encode("utf-8"),
+ "mode": "videoplay",
+ "thumb": args.thumb.replace(" ", "%20"),
+ "fanart": args.fanart.replace(" ", "%20")},
+ isFolder=False, mediatype="video")
+
+ view.endofdirectory()
+
+
+def startplayback(args):
+ """Plays a video
+ """
+ response = urllib2.urlopen("https://www.akibapass.de" + args.url)
+ html = response.read()
+
+ soup = BeautifulSoup(html, "html.parser")
+
+ # check if not premium
+ if "Dieses Video ist nur f&#252;r Nutzer eines Abos verf&#252;gbar" in html:
+ xbmc.log("[PLUGIN] %s: You need to own this video or be a premium member '%s'" % (args._addonname, args.url), xbmc.LOGERROR)
+ xbmcgui.Dialog().ok(args._addonname, args._addon.getLocalizedString(30043))
+ return
+
+ # check if we have to reactivate video
+ if "reactivate" in html:
+ # reactivate video
+ a = soup.find("div", {"id": "jwplayer-container"}).a["href"]
+ response = urllib2.urlopen("https://www.akibapass.de" + a)
+ html = response.read()
+
+ # reload page
+ response = urllib2.urlopen("https://www.akibapass.de" + args.url)
+ html = response.read()
+ soup = BeautifulSoup(html, "html.parser")
+
+ # check if successfull
+ if "reactivate" in html:
+ xbmc.log("[PLUGIN] %s: Reactivation failed '%s'" % (args._addonname, args.url), xbmc.LOGERROR)
+ xbmcgui.Dialog().ok(args._addonname, args._addon.getLocalizedString(30042))
+ return
+
+ # using stream with hls+aes
+ if "Klicke hier, um den Flash-Player zu benutzen" in html:
+ # get stream file
+ regex = r"file: \"(.*?)\","
+ matches = re.search(regex, html).group(1)
+
+ if matches:
+ # manifest url
+ url = "https://www.akibapass.de" + matches
+
+ # play stream
+ item = xbmcgui.ListItem(getattr(args, "title", "Title not provided"), path=url + login.getCookie(args))
+ item.setMimeType("application/vnd.apple.mpegurl")
+ item.setContentLookup(False)
+ xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item)
+ else:
+ xbmc.log("[PLUGIN] %s: Failed to play stream" % args._addonname, xbmc.LOGERROR)
+ xbmcgui.Dialog().ok(args._addonname, args._addon.getLocalizedString(30044))
+
+ else:
+ xbmc.log("[PLUGIN] %s: You need to own this video or be a premium member '%s'" % (args._addonname, args.url), xbmc.LOGERROR)
+ xbmcgui.Dialog().ok(args._addonname, args._addon.getLocalizedString(30043))
diff --git a/plugin.video.akibapass/resources/lib/view.py b/plugin.video.akibapass/resources/lib/view.py
new file mode 100644
index 0000000..f72b985
--- /dev/null
+++ b/plugin.video.akibapass/resources/lib/view.py
@@ -0,0 +1,110 @@
+# -*- coding: utf-8 -*-
+# Akibapass - Watch videos from the german anime platform Akibapass.de on Kodi.
+# Copyright (C) 2016 - 2017 MrKrabat
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import sys
+import urllib
+
+import xbmc
+import xbmcgui
+import xbmcplugin
+
+
+# keys allowed in setInfo
+types = ["count", "size", "date", "genre", "year", "episode", "season", "top250", "tracknumber",
+ "rating", "userrating", "watched", "playcount", "overlay", "cast", "castandrole", "director",
+ "mpaa", "plot", "plotoutline", "title", "originaltitle", "sorttitle", "duration", "studio",
+ "tagline", "writer", "tvshowtitle", "premiered", "status", "code", "aired", "credits", "lastplayed",
+ "album", "artist", "votes", "trailer", "dateadded", "mediatype"]
+
+def endofdirectory():
+ # sort methods are required in library mode
+ xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_NONE)
+
+ # let xbmc know the script is done adding items to the list
+ xbmcplugin.endOfDirectory(handle = int(sys.argv[1]))
+
+
+def add_item(args, info, isFolder=True, total_items=0, mediatype="video"):
+ """Add item to directory listing.
+ """
+
+ # create list item
+ li = xbmcgui.ListItem(label = info["title"])
+
+ # get infoLabels
+ infoLabels = make_infolabel(args, info)
+ infoLabels["genre"] = "Anime"
+
+ # get url
+ u = build_url(args, info)
+
+ if isFolder:
+ # directory
+ li.setInfo(mediatype, infoLabels)
+ else:
+ # playable video
+ infoLabels["mediatype"] = "video"
+ li.setInfo(mediatype, infoLabels)
+ li.setProperty("IsPlayable", "true")
+
+ # set media image
+ li.setArt({"thumb": info.get("thumb", "DefaultFolder.png"),
+ "poster": info.get("thumb", "DefaultFolder.png"),
+ "banner": info.get("thumb", "DefaultFolder.png"),
+ "fanart": info.get("fanart", xbmc.translatePath(args._addon.getAddonInfo("fanart"))),
+ "icon": info.get("thumb", "DefaultFolder.png")})
+
+ # add item to list
+ xbmcplugin.addDirectoryItem(handle = int(sys.argv[1]),
+ url = u,
+ listitem = li,
+ isFolder = isFolder,
+ totalItems = total_items)
+
+
+def build_url(args, info):
+ """Create url
+ """
+ s = ""
+ # step 1 copy new information from info
+ for key, value in info.iteritems():
+ if value:
+ s = s + "&" + key + "=" + urllib.quote_plus(value)
+
+ # step 2 copy old information from args, but don't append twice
+ for key, value in args.__dict__.iteritems():
+ if value and key in types and not "&" + str(key) + "=" in s:
+ s = s + "&" + key + "=" + urllib.quote_plus(value)
+
+ return sys.argv[0] + "?" + s[1:]
+
+
+def make_infolabel(args, info):
+ """Generate infoLabels from existing dict
+ """
+ infoLabels = {}
+ # step 1 copy new information from info
+ for key, value in info.iteritems():
+ if value and key in types:
+ infoLabels[key] = value
+
+ # step 2 copy old information from args, but don't overwrite
+ for key, value in args.__dict__.iteritems():
+ if value and key in types and key not in infoLabels:
+ infoLabels[key] = value
+
+ return infoLabels
diff --git a/plugin.video.akibapass/resources/media/screenshot-01.jpg b/plugin.video.akibapass/resources/media/screenshot-01.jpg
new file mode 100644
index 0000000..aba9940
--- /dev/null
+++ b/plugin.video.akibapass/resources/media/screenshot-01.jpg
Binary files differ
diff --git a/plugin.video.akibapass/resources/media/screenshot-02.jpg b/plugin.video.akibapass/resources/media/screenshot-02.jpg
new file mode 100644
index 0000000..b92d09e
--- /dev/null
+++ b/plugin.video.akibapass/resources/media/screenshot-02.jpg
Binary files differ
diff --git a/plugin.video.akibapass/resources/media/screenshot-03.jpg b/plugin.video.akibapass/resources/media/screenshot-03.jpg
new file mode 100644
index 0000000..36bc3b4
--- /dev/null
+++ b/plugin.video.akibapass/resources/media/screenshot-03.jpg
Binary files differ
diff --git a/plugin.video.akibapass/resources/settings.xml b/plugin.video.akibapass/resources/settings.xml
new file mode 100644
index 0000000..775089f
--- /dev/null
+++ b/plugin.video.akibapass/resources/settings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<settings>
+ <setting id="akiba_username" type="text" label="30001" default=""/>
+ <setting id="akiba_password" type="text" label="30002" option="hidden" default=""/>
+</settings>
diff --git a/plugin.video.btsportvideo/LICENSE b/plugin.video.btsportvideo/LICENSE
new file mode 100644
index 0000000..b5d48b2
--- /dev/null
+++ b/plugin.video.btsportvideo/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 Lee Smith
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/plugin.video.btsportvideo/README.md b/plugin.video.btsportvideo/README.md
new file mode 100644
index 0000000..8a27e69
--- /dev/null
+++ b/plugin.video.btsportvideo/README.md
@@ -0,0 +1,9 @@
+BT Sport Video plugin for Kodi
+===========================================
+[![Travis CI](https://travis-ci.org/LS80/plugin.video.btsportvideo.svg?branch=master)](https://travis-ci.org/LS80/plugin.video.btsportvideo)
+
+A [Kodi](http://kodi.tv) plugin to watch videos from BT Sport at <https://sport.bt.com>.
+
+The plugin can be installed from the official Kodi addon repository.
+
+Contact: [Leopold](https://forum.kodi.tv/private.php?action=send&uid=82951) on <http://forum.kodi.tv>.
diff --git a/plugin.video.btsportvideo/addon.py b/plugin.video.btsportvideo/addon.py
new file mode 100644
index 0000000..d671ea6
--- /dev/null
+++ b/plugin.video.btsportvideo/addon.py
@@ -0,0 +1,127 @@
+###############################################################################
+#
+# MIT License
+#
+# Copyright (c) 2017 Lee Smith
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+###############################################################################
+
+import traceback
+# Workaround for 'Failed to import _strptime because the import lock is held by another thread.'
+import _strptime # pylint: disable=unused-import
+
+from kodiswift import Plugin
+import rollbar.kodi
+
+from resources.lib import api
+
+
+PAGE_SIZE = 9
+
+plugin = Plugin(addon_id='plugin.video.btsportvideo')
+
+
+def categories():
+ yield {'label': '[B]{}[/B]'.format(plugin.get_string(30002)),
+ 'path': plugin.url_for('search')}
+ yield {'label': '[B]{}[/B]'.format(plugin.get_string(30001)),
+ 'path': plugin.url_for('show_videos_by_category_first_page', category='all')}
+ for category in api.categories():
+ yield {'label': category,
+ 'path': plugin.url_for('show_videos_by_category_first_page',
+ category=category)}
+
+
+def items(func, route, page, **kwargs):
+ videos, npages = func(page=page, page_size=PAGE_SIZE, **kwargs)
+
+ if page > 1:
+ yield {
+ 'label': u'[B]<< {} ({})[/B]'.format(plugin.get_string(30003), page - 1),
+ 'path': plugin.url_for(route, page=page - 1, **kwargs)
+ }
+ if page < npages:
+ yield {
+ 'label': u'[B]{} ({}) >> [/B]'.format(plugin.get_string(30004), page + 1),
+ 'path': plugin.url_for(route, page=page + 1, **kwargs)
+ }
+
+ for video in videos:
+ yield {
+ 'label': video.title,
+ 'thumbnail': video.thumbnail,
+ 'path': video.url,
+ 'info': {
+ 'date': video.date.strftime('%d.%m.%Y'),
+ 'duration': video.duration
+ },
+ 'is_playable': True
+ }
+
+
+def show_videos(func, route, page, update_listing, **kwargs):
+ return plugin.finish(
+ items(func, route, page, **kwargs),
+ sort_methods=['playlist_order', 'date', 'title', 'duration'],
+ update_listing=update_listing
+ )
+
+
+@plugin.cached_route('/')
+def index():
+ return list(categories())
+
+
+@plugin.route('/videos/<category>', name='show_videos_by_category_first_page',
+ options={'update_listing': False})
+@plugin.route('/videos/<category>/<page>')
+def show_videos_by_category(category, page='1', update_listing=True):
+ return show_videos(api.videos, 'show_videos_by_category', int(page),
+ update_listing, category=category)
+
+
+@plugin.route('/search/<term>', name='show_search_results_first_page',
+ options={'update_listing': False})
+@plugin.route('/search/<term>/<page>')
+def show_search_results(term, page='1', update_listing=True):
+ return show_videos(api.search_results, 'show_search_results', int(page),
+ update_listing, term=term)
+
+
+@plugin.route('/search')
+def search():
+ term = plugin.keyboard(heading=plugin.get_string(30002))
+ if term:
+ url = plugin.url_for('show_search_results_first_page', term=term)
+ plugin.redirect(url)
+
+
+if __name__ == '__main__':
+ try:
+ plugin.run()
+ except Exception as exc:
+ if rollbar.kodi.error_report_requested(exc):
+ rollbar.kodi.report_error(
+ access_token='cc56a52c62c5418ebc87f97b1aa44669',
+ version=plugin.addon.getAddonInfo('version'),
+ url=plugin.request.url
+ )
+ plugin.log.error(traceback.format_exc())
diff --git a/plugin.video.btsportvideo/addon.xml b/plugin.video.btsportvideo/addon.xml
new file mode 100644
index 0000000..ecf24d7
--- /dev/null
+++ b/plugin.video.btsportvideo/addon.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<addon id="plugin.video.btsportvideo" name="BT Sport Video" version="0.1.1" provider-name="Leopold">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="script.module.kodiswift" version="0.0.8" optional="false"/>
+ <import addon="script.module.beautifulsoup4" version="4.3.1" optional="false"/>
+ <import addon="script.module.requests" version="2.4.3" optional="false"/>
+ <import addon="script.module.pyrollbar" version="0.13.17" optional="false"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource" library="addon.py">
+ <provides>video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <platform>all</platform>
+ <language>en</language>
+ <summary lang="en_gb">Watch videos from BT Sport</summary>
+ <description lang="en_gb">This plugin provides access to the videos from the BT Sport website</description>
+ <website>https://sport.bt.com</website>
+ <source>https://github.com/LS80/plugin.video.btsportvideo.git</source>
+ <license>MIT</license>
+ <assets>
+ <icon>resources/icon.png</icon>
+ <fanart>resources/fanart.jpg</fanart>
+ </assets>
+ <news></news>
+ </extension>
+</addon>
diff --git a/plugin.video.btsportvideo/resources/__init__.py b/plugin.video.btsportvideo/resources/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.btsportvideo/resources/__init__.py
diff --git a/plugin.video.btsportvideo/resources/fanart.jpg b/plugin.video.btsportvideo/resources/fanart.jpg
new file mode 100644
index 0000000..acbbbef
--- /dev/null
+++ b/plugin.video.btsportvideo/resources/fanart.jpg
Binary files differ
diff --git a/plugin.video.btsportvideo/resources/icon.png b/plugin.video.btsportvideo/resources/icon.png
new file mode 100644
index 0000000..ea1c085
--- /dev/null
+++ b/plugin.video.btsportvideo/resources/icon.png
Binary files differ
diff --git a/plugin.video.btsportvideo/resources/language/resource.language.en_gb/strings.po b/plugin.video.btsportvideo/resources/language/resource.language.en_gb/strings.po
new file mode 100644
index 0000000..850394c
--- /dev/null
+++ b/plugin.video.btsportvideo/resources/language/resource.language.en_gb/strings.po
@@ -0,0 +1,33 @@
+# Kodi Media Center language file
+# Addon Name: BT Sport Video
+# Addon id: plugin.video.btsportvideo
+# Addon Provider: Leopold
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Kodi Translation Team\n"
+"Language-Team: English (http://www.transifex.com/projects/p/xbmc-addons/language/en/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en_GB\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "#30001"
+msgid "All Videos"
+msgstr ""
+
+msgctxt "#30002"
+msgid "Search"
+msgstr ""
+
+msgctxt "#30003"
+msgid "Previous Page"
+msgstr ""
+
+msgctxt "#30004"
+msgid "Next Page"
+msgstr ""
diff --git a/plugin.video.btsportvideo/resources/lib/__init__.py b/plugin.video.btsportvideo/resources/lib/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.btsportvideo/resources/lib/__init__.py
diff --git a/plugin.video.btsportvideo/resources/lib/api.py b/plugin.video.btsportvideo/resources/lib/api.py
new file mode 100644
index 0000000..f8c4f5a
--- /dev/null
+++ b/plugin.video.btsportvideo/resources/lib/api.py
@@ -0,0 +1,106 @@
+###############################################################################
+#
+# MIT License
+#
+# Copyright (c) 2017 Lee Smith
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+###############################################################################
+
+'''
+Module for extracting video links from the BT Sport website
+'''
+
+from urlparse import urljoin
+from datetime import datetime
+import time
+from collections import namedtuple
+import math
+
+import requests
+from bs4 import BeautifulSoup
+
+
+CATEGORIES_URL = 'http://sport.bt.com/all-videos/videos-01364228997406'
+API_URL = 'http://api-search.sport.bt.com/search/sport/select'
+
+_Video = namedtuple('Video', 'title url thumbnail date duration')
+
+
+def _video_params(page, page_size):
+ '''Returns the common params for the BT Sport API'''
+ return dict(
+ fq='AssetType:BTVideo',
+ sort='publicationdate desc',
+ wt='json',
+ start=(page - 1) * page_size,
+ rows=page_size,
+ )
+
+
+def _soup(path=''):
+ '''Returns a BeautifulSoup tree for the specified path'''
+ url = urljoin(CATEGORIES_URL, path)
+ response = requests.get(url)
+ return BeautifulSoup(response.text, 'html.parser')
+
+
+def _date_from_str(date_str):
+ '''Returns a data object from a string.
+ datetime.strptime is avoided due to an issue with Python in Kodi.
+ Ignores possible milliseconds part by including only 19 characters.'''
+ return datetime(*(time.strptime(date_str[:19], '%Y-%m-%dT%H:%M:%S')[0:6])).date()
+
+
+def categories():
+ '''Generator for all sport categories on the website'''
+ for category in _soup().find('div', 'video-hub-nav')('a'):
+ if not category.text.startswith('All '):
+ yield category.text
+
+
+def _videos(videos_response):
+ for video in videos_response['docs']:
+ yield _Video(
+ title=video['h1title'],
+ url=video.get('hlsurl') or video.get('streamingurl'),
+ thumbnail=video.get('imageurl') or video.get('thumbnailURL'),
+ date=_date_from_str(video['publicationdate']),
+ duration=int(video['duration'])
+ )
+
+
+def _video_results(page=1, page_size=10, **params):
+ params.update(_video_params(page, page_size))
+ videos_response = requests.get(API_URL, params=params).json()['response']
+ num_pages = int(math.ceil(float(videos_response['numFound']) / page_size))
+ return _videos(videos_response), num_pages
+
+
+def videos(category=None, page=1, page_size=10):
+ '''Returns a generator for videos in a category and the number of pages'''
+ category = None if category.lower() == 'all' else category
+ query = 'tags:("{}")'.format(category) if category else 'Publist:btsport'
+ return _video_results(page, page_size, q=query)
+
+
+def search_results(term, page=1, page_size=10):
+ '''Returns a generator for video search results and the number of pages'''
+ return _video_results(page, page_size, q='text:{}'.format(term))
diff --git a/plugin.video.catchuptvandmore/LICENSE.txt b/plugin.video.catchuptvandmore/LICENSE.txt
index 0d6e108..0d6e108 100644..100755
--- a/plugin.video.catchuptvandmore/LICENSE.txt
+++ b/plugin.video.catchuptvandmore/LICENSE.txt
diff --git a/plugin.video.catchuptvandmore/README.md b/plugin.video.catchuptvandmore/README.md
index c4d3ff0..fb92358 100644..100755
--- a/plugin.video.catchuptvandmore/README.md
+++ b/plugin.video.catchuptvandmore/README.md
@@ -10,30 +10,54 @@ Catch-Up TV & More est compatible avec la dernière version de Kodi (Kodi 17 Kry
*This plugin brings together all the videos of the various services and channels of catch-up TV. Furthermore, this addon allows you to quickly access the videos and content offered by certain websites (coming soon).*
## Chaînes disponibles — *Available channels*
+### Europe
+- Arte *(Replay, Live TV)*
+- Euronews *(Live TV)*
+
### France
-- TF1
-- France 2
-- France 3
-- Canal +
-- France 5
-- M6
-- Arte
-- C8
-- W9
-- TMC
-- NT1
-- NRJ 12
-- France 4
-- BFM TV
-- i-Télé
-- CStar
-- Gulli
-- France Ô
-- HD1
-- L'Équipe
-- 6ter
-- Numéro 23
-- Chérie 25
+##### TV
+- TF1 *(Replay, Live TV)*
+- France 2 *(Replay, Live TV)*
+- France 3 *(Replay, Live TV)*
+- Canal + *(Replay, Live TV)*
+- France 5 *(Replay, Live TV)*
+- M6 *(Replay)*
+- C8 *(Replay, Live TV)*
+- W9 *(Replay)*
+- TMC *(Replay, Live TV)*
+- NT1 *(Replay, Live TV)*
+- NRJ 12 *(Replay, Live TV with NRJ account)*
+- France 4 *(Replay, Live TV)*
+- BFM TV *(Replay, Live TV)*
+- CNews *(Replay, Live TV)*
+- CStar *(Replay, Live TV)*
+- Gulli *(Replay, Live TV)*
+- France Ô *(Replay, Live TV)*
+- HD1 *(Replay, Live TV)*
+- L'Équipe *(Replay, Live TV)*
+- 6ter *(Replay)*
+- Numéro 23 *(Replay, Live TV)*
+- Chérie 25 *(Replay, Live TV with NRJ account)*
+- LCI *(Replay, Live TV)*
+- La 1ère — Outre-Mer *(Replay)*
+- France Info *(Live TV)*
+- BFM Business *(Replay, Live TV)*
+- RMC *(Replay, Live TV)*
+- RMC Découverte *(Replay, Live TV)*
+- LCP Assemblée Nationale *(Replay, Live TV)*
+- France 24 *(Replay, Live TV)*
+- Public Sénat *(Replay, Live TV)*
+
+##### Web TV
+- Stories — 6play *(Replay)*
+- Bruce — 6play *(Replay)*
+- Crazy Kitchen — 6play *(Replay)*
+- Home Time — 6play *(Replay)*
+- Sixième Style — 6play *(Replay)*
+- Comic — 6play *(Replay)*
+- Tfou — MyTF1 *(Replay)*
+- Xtra — MyTF1 *(Replay)*
+- 01Net TV
### Belgique — *Belgium*
- *à venir* — *coming soon*
diff --git a/plugin.video.catchuptvandmore/addon.py b/plugin.video.catchuptvandmore/addon.py
index 229d7d2..57eeee4 100644..100755
--- a/plugin.video.catchuptvandmore/addon.py
+++ b/plugin.video.catchuptvandmore/addon.py
@@ -21,20 +21,24 @@
"""
import imp
+import YDStreamUtils
+import YDStreamExtractor
from resources.lib import skeleton
from resources.lib import common
+YDStreamExtractor.disableDASHVideo(True)
+
# Useful path
-lib_path = common.sp.xbmc.translatePath(
+LIB_PATH = common.sp.xbmc.translatePath(
common.sp.os.path.join(
- common.addon.path,
+ common.ADDON.path,
"resources",
"lib"))
-media_path = (
+MEDIA_PATH = (
common.sp.xbmc.translatePath(
common.sp.os.path.join(
- common.addon.path,
+ common.ADDON.path,
"resources",
"media"
)))
@@ -42,10 +46,10 @@ media_path = (
# Initialize GNU gettext emulation in addon
# This allows to use UI strings from addon’s English
# strings.po file instead of numeric codes
-_ = common.addon.initialize_gettext()
+_ = common.ADDON.initialize_gettext()
-@common.plugin.action()
+@common.PLUGIN.action()
def root(params):
"""
Build the addon main menu
@@ -53,21 +57,34 @@ def root(params):
"""
listing = []
last_category_id = ''
- for category_id, string_id in skeleton.categories.iteritems():
- if common.plugin.get_setting(category_id):
+ for category_id, string_id in skeleton.CATEGORIES.iteritems():
+ if common.PLUGIN.get_setting(category_id):
last_category_id = category_id
last_window_title = _(string_id)
context_menu = []
hide = (
_('Hide'),
- 'XBMC.RunPlugin(' + common.plugin.get_url(
+ 'XBMC.RunPlugin(' + common.PLUGIN.get_url(
action='hide',
item_id=category_id) + ')'
)
+ media_category_path = common.sp.xbmc.translatePath(
+ common.sp.os.path.join(
+ MEDIA_PATH,
+ 'categories',
+ category_id[-2:]
+ )
+ )
+
+ icon = media_category_path + '.png'
+ fanart = media_category_path + '_fanart.png'
+
context_menu.append(hide)
listing.append({
+ 'icon': icon,
+ 'fanart': fanart,
'label': _(string_id),
- 'url': common.plugin.get_url(
+ 'url': common.PLUGIN.get_url(
action='list_channels',
category_id=category_id,
window_title=_(string_id)
@@ -81,7 +98,7 @@ def root(params):
params['window_title'] = last_window_title
return list_channels(params)
- return common.plugin.create_listing(
+ return common.PLUGIN.create_listing(
listing,
sort_methods=(
common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
@@ -89,7 +106,7 @@ def root(params):
)
-@common.plugin.action()
+@common.PLUGIN.action()
def list_channels(params):
"""
Build the channels list
@@ -97,12 +114,12 @@ def list_channels(params):
"""
# First, we sort channels by order
- channels_dict = skeleton.channels[params.category_id]
+ channels_dict = skeleton.CHANNELS[params.category_id]
channels = []
for channel_id, title in channels_dict.iteritems():
# If channel isn't disable
- if common.plugin.get_setting(channel_id):
- channel_order = common.plugin.get_setting(channel_id + '.order')
+ if common.PLUGIN.get_setting(channel_id):
+ channel_order = common.PLUGIN.get_setting(channel_id + '.order')
channel = (channel_order, channel_id, title)
channels.append(channel)
@@ -114,7 +131,7 @@ def list_channels(params):
# channel_id = channels.fr.6play.w9
[
channel_type, # channels
- channel_country, # fr
+ channel_category, # fr
channel_file, # 6play
channel_name # w9
] = channel_id.split('.')
@@ -122,14 +139,14 @@ def list_channels(params):
# channel_module = channels.fr.6play
channel_module = '.'.join((
channel_type,
- channel_country,
+ channel_category,
channel_file))
media_channel_path = common.sp.xbmc.translatePath(
common.sp.os.path.join(
- media_path,
+ MEDIA_PATH,
channel_type,
- channel_country,
+ channel_category,
channel_name
))
@@ -138,7 +155,7 @@ def list_channels(params):
item_down = (
_('Move down'),
- 'XBMC.RunPlugin(' + common.plugin.get_url(
+ 'XBMC.RunPlugin(' + common.PLUGIN.get_url(
action='move',
direction='down',
channel_id_order=channel_id + '.order',
@@ -146,7 +163,7 @@ def list_channels(params):
)
item_up = (
_('Move up'),
- 'XBMC.RunPlugin(' + common.plugin.get_url(
+ 'XBMC.RunPlugin(' + common.PLUGIN.get_url(
action='move',
direction='up',
channel_id_order=channel_id + '.order',
@@ -163,7 +180,7 @@ def list_channels(params):
hide = (
_('Hide'),
- 'XBMC.RunPlugin(' + common.plugin.get_url(
+ 'XBMC.RunPlugin(' + common.PLUGIN.get_url(
action='hide',
item_id=channel_id) + ')'
)
@@ -176,70 +193,74 @@ def list_channels(params):
'icon': icon,
'fanart': fanart,
'label': title,
- 'url': common.plugin.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
- next='list_shows_1',
+ next='root',
channel_name=channel_name,
channel_module=channel_module,
channel_id=channel_id,
- channel_country=channel_country,
+ channel_category=channel_category,
window_title=title
),
'context_menu': context_menu
})
- return common.plugin.create_listing(
+ return common.PLUGIN.create_listing(
listing,
sort_methods=(
common.sp.xbmcplugin.SORT_METHOD_UNSORTED,)
)
-@common.plugin.action()
-def channel_entry(params):
- """
- Last plugin action function in addon.py.
- Now we are going into the channel python file.
- The channel file can return folder or not item ; playable or not item
- """
+def get_channel_module(params):
if 'channel_name' in params and \
'channel_module' in params and \
'channel_id' in params and \
- 'channel_country' in params:
+ 'channel_category' in params:
channel_name = params.channel_name
channel_module = params.channel_module
channel_id = params.channel_id
- channel_country = params.channel_country
- with common.plugin.get_storage() as storage:
+ channel_category = params.channel_category
+ with common.PLUGIN.get_storage() as storage:
storage['last_channel_name'] = channel_name
storage['last_channel_module'] = channel_module
storage['last_channel_id'] = channel_id
- storage['last_channel_country'] = channel_country
+ storage['last_channel_category'] = channel_category
else:
- with common.plugin.get_storage() as storage:
+ with common.PLUGIN.get_storage() as storage:
channel_name = storage['last_channel_name']
channel_module = storage['last_channel_module']
channel_id = storage['last_channel_id']
- channel_country = storage['last_channel_country']
+ channel_category = storage['last_channel_category']
params['channel_name'] = channel_name
params['channel_id'] = channel_id
- params['channel_country'] = channel_country
+ params['channel_category'] = channel_category
channel_path = common.sp.xbmc.translatePath(
common.sp.os.path.join(
- lib_path,
+ LIB_PATH,
channel_module.replace('.', '/') + '.py'))
- channel = imp.load_source(
+ return imp.load_source(
channel_name,
channel_path)
+
+@common.PLUGIN.action()
+def channel_entry(params):
+ """
+ Last plugin action function in addon.py.
+ Now we are going into the channel python file.
+ The channel file can return folder or not item ; playable or not item
+ """
+ channel = get_channel_module(params)
+
# Let's go to the channel file ...
return channel.channel_entry(params)
-@common.plugin.action()
+@common.PLUGIN.action()
def move(params):
if params.direction == 'down':
offset = + 1
@@ -254,29 +275,60 @@ def move(params):
channel_swaped = eval(params.displayed_channels[k + offset])
channel_swaped_order = channel_swaped[0]
channel_swaped_id = channel_swaped[1]
- common.plugin.set_setting(
+ common.PLUGIN.set_setting(
params.channel_id_order,
channel_swaped_order)
- common.plugin.set_setting(
+ common.PLUGIN.set_setting(
channel_swaped_id + '.order',
channel_order)
common.sp.xbmc.executebuiltin('XBMC.Container.Refresh()')
return None
-@common.plugin.action()
+@common.PLUGIN.action()
def hide(params):
- if common.plugin.get_setting('show_hidden_items_information'):
+ if common.PLUGIN.get_setting('show_hidden_items_information'):
common.sp.xbmcgui.Dialog().ok(
_('Information'),
_('To re-enable hidden items go to the plugin settings'))
- common.plugin.set_setting('show_hidden_items_information', False)
+ common.PLUGIN.set_setting('show_hidden_items_information', False)
- common.plugin.set_setting(params.item_id, False)
+ common.PLUGIN.set_setting(params.item_id, False)
common.sp.xbmc.executebuiltin('XBMC.Container.Refresh()')
return None
+@common.PLUGIN.action()
+def download_video(params):
+ # Ici on a seulement le lien de la page web où se trouve la video
+ # Il faut appeller la fonction get_video_url de la chaine concernée pour avoir l'URL finale de la vidéo
+ channel = get_channel_module(params)
+ params.next = 'download_video'
+ url_video = channel.get_video_url(params)
+
+ # Maintenant on peut télécharger la vidéo
+
+ print 'URL_VIDEO to download ' + url_video
+
+ vid = YDStreamExtractor.getVideoInfo(url_video, quality=3)
+ path = common.PLUGIN.get_setting('dlFolder')
+
+ with YDStreamUtils.DownloadProgress() as prog: # This gives a progress dialog interface ready to use
+ try:
+ YDStreamExtractor.setOutputCallback(prog)
+ result = YDStreamExtractor.downloadVideo(vid, path)
+ if result:
+ # success
+ full_path_to_file = result.filepath
+ elif result.status != 'canceled':
+ # download failed
+ error_message = result.message
+ finally:
+ YDStreamExtractor.setOutputCallback(None)
+
+ return None
+
+
if __name__ == '__main__':
window_title = common.get_window_title()
- common.plugin.run(window_title)
+ common.PLUGIN.run(window_title)
diff --git a/plugin.video.catchuptvandmore/addon.xml b/plugin.video.catchuptvandmore/addon.xml
index 902f222..5e7bda0 100644..100755
--- a/plugin.video.catchuptvandmore/addon.xml
+++ b/plugin.video.catchuptvandmore/addon.xml
@@ -1,12 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.catchuptvandmore"
name="Catch-up TV &amp; More"
- version="0.1.2"
+ version="0.1.3"
provider-name="SylvainCecchetto">
<requires>
+ <!-- TODO before official repo submission: xbmc.python version="2.25.0"/> -->
<import addon="xbmc.python" version="2.25.0"/>
<import addon="script.module.beautifulsoup4" version="4.3.1"/>
<import addon="script.module.requests" version="2.9.1"/>
+ <import addon="script.module.youtube.dl" version="17.518.2"/>
</requires>
<extension point="xbmc.python.pluginsource" library="addon.py">
<provides>video</provides>
@@ -26,18 +28,38 @@
<email>catch.up.tv.and.more [AT] gmail [DOT] com</email>
<source>https://github.com/SylvainCecchetto/plugin.video.catchuptvandmore</source>
<news>
-[Add channel] RTL-TVI
-[Add channel] 6ter
-[Bug] NRJ 12: No video
-[Improvement] NRJ 12: Add listing for categories and seasons
-[Improvement] France Télévision (pluzz): Add search feature and "last videos" categories
-[Bug] TF1: Video URL failed
-[Bug] Gulli: Doesn't work
-[Add channel] Numéro 23
-[Add channel] Chérie 25
-[Bug] Arte: Doesn't work
-[Bug] Canal+: Bug with subcategories
- </news>
+[Improvement] Choose video quality with DIALOG setting for compatible channels (wwark)
+[Add live TV] TF1 group (wwark)
+[Bug] TF1 group: Fix wrong Video URL format
+[Improvement] TF1 group: Add missing date and duration for videos
+[Add channel] Tfou — MyTF1 (wwark)
+[Add channel] Xtra — MyTF1 (wwark)
+[Add channel] LCI (wwark)
+[Add Live TV] Pluzz — France Télévision (wwark)
+[Add channel] La 1ère — Outre-Mer (wwark)
+[Add channel] France Info (wwark)
+[Add Live TV] Canal + group (wwark)
+[Add channel] Stories — 6play (wwark)
+[Add channel] Bruce — 6play (wwark)
+[Add channel] Crazy Kitchen — 6play (wwark)
+[Add channel] Home Time — 6play (wwark)
+[Add channel] Sixième Style — 6play (wwark)
+[Add channel] Comic — 6play (wwark)
+[Add Live TV] Arte (wwark)
+[Add Live TV] BFM TV (wwark)
+[Add channel — Live TV] BFM Business (wwark)
+[Add channel — Live TV] RMC (wwark)
+[Add channel] 01Net TV (wwark)
+[Add channel — Live TV] RMC Découverte (wwark)
+[Add Live TV] Gulli (wwark)
+[Add Live TV] L'Équipe (wwark)
+[Add Live TV] Numéro 23 (wwark)
+[Add channel — Live TV] LCP Assemblée Nationale (wwark)
+[Add channel — Live TV] France 24 (wwark)
+[Add channel — Live TV] Public Sénat (wwark)
+[Add Live TV] Euronews (wwark)
+[Improvement] Add download mode on multiple channels (wwark)
+ </news>
<assets>
<icon>icon.png</icon>
<fanart>fanart.jpg</fanart>
diff --git a/plugin.video.catchuptvandmore/fanart.jpg b/plugin.video.catchuptvandmore/fanart.jpg
index 2d2fc2f..2d2fc2f 100644..100755
--- a/plugin.video.catchuptvandmore/fanart.jpg
+++ b/plugin.video.catchuptvandmore/fanart.jpg
Binary files differ
diff --git a/plugin.video.catchuptvandmore/icon.png b/plugin.video.catchuptvandmore/icon.png
index 53c1e7e..53c1e7e 100644..100755
--- a/plugin.video.catchuptvandmore/icon.png
+++ b/plugin.video.catchuptvandmore/icon.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/__init__.py b/plugin.video.catchuptvandmore/resources/__init__.py
index e69de29..e69de29 100644..100755
--- a/plugin.video.catchuptvandmore/resources/__init__.py
+++ b/plugin.video.catchuptvandmore/resources/__init__.py
diff --git a/plugin.video.catchuptvandmore/resources/language/resource.language.en_gb/strings.po b/plugin.video.catchuptvandmore/resources/language/resource.language.en_gb/strings.po
index 0b6f701..0fb703f 100644..100755
--- a/plugin.video.catchuptvandmore/resources/language/resource.language.en_gb/strings.po
+++ b/plugin.video.catchuptvandmore/resources/language/resource.language.en_gb/strings.po
@@ -26,9 +26,16 @@ msgid "Channels"
msgstr ""
msgctxt "#30002"
-msgid "Quality and content"
+msgid "Quality and Content"
msgstr ""
+msgctxt "#30003"
+msgid "Download"
+msgstr ""
+
+msgctxt "#30004"
+msgid "Accounts"
+msgstr ""
# Settings line separators (from 30010 to 30019)
msgctxt "#30010"
@@ -39,6 +46,9 @@ msgctxt "#30011"
msgid "Hide channels from categories"
msgstr ""
+msgctxt "#30012"
+msgid "To configure YTDL go settings of script.module.youtube.dl"
+msgstr ""
# Main categories (from 30020 to 30039)
msgctxt "#30020"
@@ -49,6 +59,21 @@ msgctxt "#30021"
msgid "Belgian channels"
msgstr ""
+msgctxt "#30022"
+msgid "Japanese channels"
+msgstr ""
+
+msgctxt "#30023"
+msgid "European channels"
+msgstr ""
+
+msgctxt "#30024"
+msgid "United Kingdom channels"
+msgstr ""
+
+msgctxt "#30025"
+msgid "United States channels"
+msgstr ""
# Context menu (from 30040 to 30049)
msgctxt "#30040"
@@ -63,6 +88,9 @@ msgctxt "#30042"
msgid "Hide"
msgstr ""
+msgctxt "#30043"
+msgid "Download"
+msgstr ""
# Dialog boxes (from 30050 to 30069)
msgctxt "#30050"
@@ -76,80 +104,29 @@ msgstr ""
# Settings quality and content (from 30070 to 30099)
msgctxt "#30070"
-msgid "TF1: Show bonus videos"
+msgid "Video quality"
msgstr ""
msgctxt "#30071"
-msgid "France 2: Video quality"
-msgstr ""
-
-msgctxt "#30072"
-msgid "France 3: Video quality"
-msgstr ""
-
-msgctxt "#30073"
-msgid "France 4: Video quality"
-msgstr ""
-
-msgctxt "#30074"
-msgid "France 5: Video quality"
-msgstr ""
-
-msgctxt "#30075"
-msgid "France Ô: Video quality"
-msgstr ""
-
-msgctxt "#30076"
-msgid "M6: Video quality"
-msgstr ""
-
-msgctxt "#30077"
-msgid "W9: Video quality"
-msgstr ""
-
-msgctxt "#30078"
-msgid "6ter: Video quality"
-msgstr ""
-
-msgctxt "#30079"
-msgid "Arte: Video quality"
+msgid "Contents"
msgstr ""
msgctxt "#30080"
-msgid "Arte: Language"
+msgid "Arte: Choose Channel"
msgstr ""
msgctxt "#30081"
-msgid "BFM TV: Video quality"
+msgid "France24: Choose Channel"
msgstr ""
msgctxt "#30082"
-msgid "TMC: Show bonus videos"
-msgstr ""
-
-msgctxt "#30083"
-msgid "NT1: Show bonus videos"
-msgstr ""
-
-msgctxt "#30084"
-msgid "HD1: Show bonus videos"
-msgstr ""
-
-msgctxt "#30085"
-msgid "NRJ 12: Video quality"
-msgstr ""
-
-msgctxt "#30086"
-msgid "L'Équipe: Video quality"
+msgid "Euronews: Choose Channel"
msgstr ""
msgctxt "#30087"
-msgid "TF1: Video quality"
+msgid "Video quality (BEST|DEFAULT|DIALOG)"
msgstr ""
-msgctxt "#30088"
-msgid "Numéro 23: Video quality"
-msgstr ""
# Others (from 30100 to 30140)
msgctxt "#30100"
@@ -186,4 +163,18 @@ msgstr ""
msgctxt "#30108"
msgid "More programs..."
-msgstr "" \ No newline at end of file
+msgstr ""
+
+msgctxt "#30109"
+msgid "Live TV"
+msgstr ""
+
+msgctxt "#30110"
+msgid "Choose video quality"
+msgstr ""
+
+# Download (from 30200 to 30240)
+
+msgctxt "#30200"
+msgid "Folder to Download"
+msgstr ""
diff --git a/plugin.video.catchuptvandmore/resources/language/resource.language.fr_fr/strings.po b/plugin.video.catchuptvandmore/resources/language/resource.language.fr_fr/strings.po
index 35ee599..ee2e81c 100644..100755
--- a/plugin.video.catchuptvandmore/resources/language/resource.language.fr_fr/strings.po
+++ b/plugin.video.catchuptvandmore/resources/language/resource.language.fr_fr/strings.po
@@ -26,9 +26,16 @@ msgid "Channels"
msgstr "Chaînes"
msgctxt "#30002"
-msgid "Quality and content"
-msgstr "Qualité et contenu"
+msgid "Quality and Content"
+msgstr "Qualité et Contenu"
+msgctxt "#30003"
+msgid "Download"
+msgstr "Téléchargement"
+
+msgctxt "#30004"
+msgid "Accounts"
+msgstr "Comptes"
# Settings line separators (from 30010 to 30019)
msgctxt "#30010"
@@ -39,6 +46,9 @@ msgctxt "#30011"
msgid "Hide channels from categories"
msgstr "Masquer des chaînes des catégories"
+msgctxt "#30012"
+msgid "To configure YTDL go settings of script.module.youtube.dl"
+msgstr "Pour configurer YTDL aller dans la configuration de script.module.youtube.dl"
# Main categories (from 30020 to 30039)
msgctxt "#30020"
@@ -49,6 +59,21 @@ msgctxt "#30021"
msgid "Belgian channels"
msgstr "Chaînes belges"
+msgctxt "#30022"
+msgid "Japanese channels"
+msgstr "Chaînes japonaises"
+
+msgctxt "#30023"
+msgid "European channels"
+msgstr "Chaînes européennes"
+
+msgctxt "#30024"
+msgid "United Kingdom channels"
+msgstr "Chaînes anglaises"
+
+msgctxt "#30025"
+msgid "United States channels"
+msgstr "Chaînes américaines"
# Context menu (from 30040 to 30049)
msgctxt "#30040"
@@ -63,6 +88,10 @@ msgctxt "#30042"
msgid "Hide"
msgstr "Masquer"
+msgctxt "#30043"
+msgid "Download"
+msgstr "Télécharger"
+
# Dialog boxes (from 30050 to 30069)
msgctxt "#30050"
@@ -76,81 +105,28 @@ msgstr "Pour réactiver les éléments masqués rendez-vous dans les réglages d
# Settings quality and content (from 30070 to 30099)
msgctxt "#30070"
-msgid "TF1: Show bonus videos"
-msgstr "TF1 : Afficher les vidéos bonus"
+msgid "Video quality"
+msgstr "Qualité vidéo"
msgctxt "#30071"
-msgid "France 2: Video quality"
-msgstr "France 2 : Qualité vidéo"
-
-msgctxt "#30072"
-msgid "France 3: Video quality"
-msgstr "France 3 : Qualité vidéo"
-
-msgctxt "#30073"
-msgid "France 4: Video quality"
-msgstr "France 4 : Qualité vidéo"
-
-msgctxt "#30074"
-msgid "France 5: Video quality"
-msgstr "France 5 : Qualité vidéo"
-
-msgctxt "#30075"
-msgid "France Ô: Video quality"
-msgstr "France Ô : Qualité vidéo"
-
-msgctxt "#30076"
-msgid "M6: Video quality"
-msgstr "M6 : Qualité vidéo"
-
-msgctxt "#30077"
-msgid "W9: Video quality"
-msgstr "W9 : Qualité vidéo"
-
-msgctxt "#30078"
-msgid "6ter: Video quality"
-msgstr "6ter : Qualité vidéo"
-
-msgctxt "#30079"
-msgid "Arte: Video quality"
-msgstr "Arte : Qualité vidéo"
+msgid "Contents"
+msgstr "Contenus"
msgctxt "#30080"
-msgid "Arte: Language"
-msgstr "Arte : Langue"
+msgid "Arte: Choose Channel"
+msgstr "Arte : Choix de la chaîne"
msgctxt "#30081"
-msgid "BFM TV: Video quality"
-msgstr "BFM TV : Qualité vidéo"
+msgid "France24: Choose Channel"
+msgstr "France24 : Choix de la chaîne"
msgctxt "#30082"
-msgid "TMC: Show bonus videos"
-msgstr "TMC : Afficher les vidéos bonus"
-
-msgctxt "#30083"
-msgid "NT1: Show bonus videos"
-msgstr "NT1 : Afficher les vidéos bonus"
-
-msgctxt "#30084"
-msgid "HD1: Show bonus videos"
-msgstr "HD1 : Afficher les vidéos bonus"
-
-msgctxt "#30085"
-msgid "NRJ 12: Video quality"
-msgstr "NRJ 12 : Qualité vidéo"
-
-msgctxt "#30086"
-msgid "L'Équipe: Video quality"
-msgstr "L'Équipe : Qualité vidéo"
+msgid "Euronews: Choose Channel"
+msgstr "Euronews : Choix de la chaîne"
msgctxt "#30087"
-msgid "TF1: Video quality"
-msgstr "TF1 : Qualité vidéo"
-
-msgctxt "#30088"
-msgid "Numéro 23: Video quality"
-msgstr "Numéro 23 : Qualité vidéo"
-
+msgid "Video quality (BEST|DEFAULT|DIALOG)"
+msgstr "Qualité Vidéo (BEST|DEFAULT|DIALOG)"
# Others (from 30100 to 30140)
msgctxt "#30100"
@@ -187,6 +163,20 @@ msgstr "Descendant"
msgctxt "#30108"
msgid "More programs..."
-msgstr "Plus de programes..."
+msgstr "Plus de programmes..."
+
+msgctxt "#30109"
+msgid "Live TV"
+msgstr "TV en direct"
+
+msgctxt "#30110"
+msgid "Choose video quality"
+msgstr "Choisir la qualité vidéo"
+
+# Download (from 30200 to 30240)
+
+msgctxt "#30200"
+msgid "Folder to Download"
+msgstr "Répertoire de téléchargement"
diff --git a/plugin.video.catchuptvandmore/resources/language/resource.language.he.il/strings.po b/plugin.video.catchuptvandmore/resources/language/resource.language.he.il/strings.po
new file mode 100755
index 0000000..4133130
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/language/resource.language.he.il/strings.po
@@ -0,0 +1,179 @@
+# Kodi Media Center language file
+# Addon Name: Catch-up TV & More
+# Addon id: plugin.video.catchuptvandmore
+# Addon Provider: SylvainCecchetto
+msgid ""
+msgstr ""
+"Project-Id-Version: plugin.video.catchuptvandmore\n"
+"Report-Msgid-Bugs-To: alanwww1@kodi.org\n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: 2017-09-20 09:11+0300\n"
+"Last-Translator: A. Dambledore\n"
+"Language-Team: Eng2Heb\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: he_IL\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+# Settings categories (from 30000 to 30009)
+msgctxt "#30000"
+msgid "Main menu"
+msgstr "תפריט ראשי"
+
+msgctxt "#30001"
+msgid "Channels"
+msgstr "ערוצים"
+
+msgctxt "#30002"
+msgid "Quality and Content"
+msgstr "איכות ותוכן"
+
+msgctxt "#30003"
+msgid "Download"
+msgstr "הורד"
+
+msgctxt "#30004"
+msgid "Accounts"
+msgstr "חשבונות"
+
+# Settings line separators (from 30010 to 30019)
+msgctxt "#30010"
+msgid "Hide main menu categories"
+msgstr "הסתר קטגוריות בתפריט הראשי"
+
+msgctxt "#30011"
+msgid "Hide channels from categories"
+msgstr "הסתר ערוצים מכל הקטגוריות"
+
+msgctxt "#30012"
+msgid "To configure YTDL go settings of script.module.youtube.dl"
+msgstr "כדי לקבוע את התצורה של YTDL עבור אל ההגדרות של script.module.youtube.dl"
+
+# Main categories (from 30020 to 30039)
+msgctxt "#30020"
+msgid "French channels"
+msgstr "ערוצים צרפתיים"
+
+msgctxt "#30021"
+msgid "Belgian channels"
+msgstr "ערוצים בלגיים"
+
+msgctxt "#30022"
+msgid "Japanese channels"
+msgstr "ערוצים יפניים"
+
+msgctxt "#30023"
+msgid "European channels"
+msgstr "ערוצים אירופיים"
+
+msgctxt "#30024"
+msgid "United Kingdom channels"
+msgstr "ערוצים אנגליים"
+
+msgctxt "#30025"
+msgid "United States channels"
+msgstr "ערוצים אמריקאיים"
+
+# Context menu (from 30040 to 30049)
+msgctxt "#30040"
+msgid "Move down"
+msgstr "רד למטה"
+
+msgctxt "#30041"
+msgid "Move up"
+msgstr "עבור למעלה"
+
+msgctxt "#30042"
+msgid "Hide"
+msgstr "הסתר"
+
+msgctxt "#30043"
+msgid "Download"
+msgstr "הורד"
+
+# Dialog boxes (from 30050 to 30069)
+msgctxt "#30050"
+msgid "Information"
+msgstr "מידע"
+
+msgctxt "#30051"
+msgid "To re-enable hidden items go to the plugin settings"
+msgstr "כדי להפעיל מחדש את הפריטים המוסתרים, עבור אל ההגדרות של תוסף"
+
+
+# Settings quality and content (from 30070 to 30099)
+msgctxt "#30070"
+msgid "Video quality"
+msgstr "איכות וידאו מיו-טיוב"
+
+msgctxt "#30071"
+msgid "Contents"
+msgstr "תוכן העניינים"
+
+msgctxt "#30080"
+msgid "Arte: Choose Channel"
+msgstr "Arte: בחר ערוץ"
+
+msgctxt "#30081"
+msgid "France24: Choose Channel"
+msgstr "France24: בחר ערוץ"
+
+msgctxt "#30082"
+msgid "Euronews: Choose Channel"
+msgstr "Euronews: בחר ערוץ"
+
+msgctxt "#30087"
+msgid "Video quality (BEST|DEFAULT|DIALOG)"
+msgstr "איכות וידאו (הטוב ביותר|ברירת מחדל|תיבת דו-שיח)"
+
+
+# Others (from 30100 to 30140)
+msgctxt "#30100"
+msgid "More videos..."
+msgstr "קטעי וידאו נוספים..."
+
+msgctxt "#30101"
+msgid "All videos"
+msgstr "נגן את כל הסרטונים"
+
+msgctxt "#30102"
+msgid "DRM protected video"
+msgstr "וידאו מוגן DRM"
+
+msgctxt "#30103"
+msgid "Search"
+msgstr "חיפוש"
+
+msgctxt "#30104"
+msgid "Last videos"
+msgstr "קטעי וידאו אחרונים"
+
+msgctxt "#30105"
+msgid "From A to Z"
+msgstr "מ-א עד ת"
+
+msgctxt "#30106"
+msgid "Ascending"
+msgstr "בסדר עולה"
+
+msgctxt "#30107"
+msgid "Descending"
+msgstr "בסדר יורד"
+
+msgctxt "#30108"
+msgid "More programs..."
+msgstr "עוד תוכניות..."
+
+msgctxt "#30109"
+msgid "Live TV"
+msgstr "טלוויזיה חיה"
+
+msgctxt "#30110"
+msgid "Choose video quality"
+msgstr "בחר איכות וידאו"
+
+# Download (from 30200 to 30240)
+msgctxt "#30200"
+msgid "Folder to Download"
+msgstr "תיקיה להורדה"
diff --git a/plugin.video.catchuptvandmore/resources/lib/__init__.py b/plugin.video.catchuptvandmore/resources/lib/__init__.py
index e69de29..e69de29 100644..100755
--- a/plugin.video.catchuptvandmore/resources/lib/__init__.py
+++ b/plugin.video.catchuptvandmore/resources/lib/__init__.py
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/__init__.py b/plugin.video.catchuptvandmore/resources/lib/channels/__init__.py
index e69de29..e69de29 100644..100755
--- a/plugin.video.catchuptvandmore/resources/lib/channels/__init__.py
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/__init__.py
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/eu/__init__.py b/plugin.video.catchuptvandmore/resources/lib/channels/eu/__init__.py
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/eu/__init__.py
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/fr/arte.py b/plugin.video.catchuptvandmore/resources/lib/channels/eu/arte.py
index 02aa6c4..9fe6d0b 100644..100755
--- a/plugin.video.catchuptvandmore/resources/lib/channels/fr/arte.py
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/eu/arte.py
@@ -24,48 +24,88 @@ import json
from resources.lib import utils
from resources.lib import common
-# TODO
+# Initialize GNU gettext emulation in addon
+# This allows to use UI strings from addon’s English
+# strings.po file instead of numeric codes
+_ = common.ADDON.initialize_gettext()
+
+# TO DO
# List emissions
# Most recent
# Most viewed
-url_replay = 'https://www.arte.tv/papi/tvguide/videos/' \
+URL_REPLAY = 'https://www.arte.tv/papi/tvguide/videos/' \
'ARTE_PLUS_SEVEN/%s.json?includeLongRights=true'
-# Valid languages: F or D
+# Langue, ...
+URL_LIVE_ARTE = 'https://api.arte.tv/api/player/v1/livestream/%s'
+# Langue, ...
def channel_entry(params):
- if 'list_shows' in params.next:
+ """Entry function of the module"""
+ if 'root' in params.next:
+ return root(params)
+ elif 'list_shows' in params.next:
return list_shows(params)
elif 'list_videos' in params.next:
return list_videos(params)
+ elif 'live' in params.next:
+ return list_live(params)
elif 'play' in params.next:
return get_video_url(params)
+ return None
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def root(params):
+ """Add Replay and Live in the listing"""
+ modes = []
+
+ # Add Replay
+ modes.append({
+ 'label' : 'Replay',
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_shows_1',
+ category='%s Replay' % params.channel_name.upper(),
+ window_title='%s Replay' % params.channel_name.upper()
+ ),
+ })
+
+ modes.append({
+ 'label' : 'Live TV',
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='live_cat',
+ category='%s Live TV' % params.channel_name.upper(),
+ window_title='%s Live TV' % params.channel_name.upper()
+ ),
+ })
+
+ return common.PLUGIN.create_listing(
+ modes,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ ),
+ )
-
-@common.plugin.cached(common.cache_time)
+@common.PLUGIN.cached(common.CACHE_TIME)
def list_shows(params):
+ """Build categories listing"""
shows = []
emissions_list = []
categories = {}
- desired_language = common.plugin.get_setting(
+ desired_language = common.PLUGIN.get_setting(
params.channel_id + '.language')
- if desired_language == 'Auto':
- if params.channel_country == 'fr':
- desired_language = 'F'
- elif params.channel_country == 'de':
- desired_language = 'D'
- elif desired_language == 'fr':
- desired_language = 'F'
- elif desired_language == 'de':
+ if desired_language == 'DE':
desired_language = 'D'
else:
desired_language = 'F'
file_path = utils.download_catalog(
- url_replay % desired_language,
+ URL_REPLAY % desired_language,
'%s_%s.json' % (params.channel_name, desired_language)
)
file_replay = open(file_path).read()
@@ -103,14 +143,14 @@ def list_shows(params):
emissions_list.append(emission_dict)
- with common.plugin.get_storage() as storage:
+ with common.PLUGIN.get_storage() as storage:
storage['emissions_list'] = emissions_list
for category in categories.keys():
shows.append({
'label': category,
- 'url': common.plugin.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
next='list_videos_cat',
category=category,
@@ -118,7 +158,7 @@ def list_shows(params):
),
})
- return common.plugin.create_listing(
+ return common.PLUGIN.create_listing(
shows,
sort_methods=(
common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
@@ -127,10 +167,11 @@ def list_shows(params):
)
-@common.plugin.cached(common.cache_time)
+@common.PLUGIN.cached(common.CACHE_TIME)
def list_videos(params):
+ """Build videos listing"""
videos = []
- with common.plugin.get_storage() as storage:
+ with common.PLUGIN.get_storage() as storage:
emissions_list = storage['emissions_list']
if params.next == 'list_videos_cat':
@@ -165,19 +206,31 @@ def list_videos(params):
}
}
+ # Nouveau pour ajouter le menu pour télécharger la vidéo
+ context_menu = []
+ download_video = (
+ _('Download'),
+ 'XBMC.RunPlugin(' + common.PLUGIN.get_url(
+ action='download_video',
+ url=emission['video_url']) + ')'
+ )
+ context_menu.append(download_video)
+ # Fin
+
videos.append({
'label': title,
'thumb': emission['image'],
- 'url': common.plugin.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
- next='play',
+ next='play_r',
url=emission['video_url'],
),
'is_playable': True,
- 'info': info
+ 'info': info,
+ 'context_menu': context_menu # A ne pas oublier pour ajouter le bouton "Download" à chaque vidéo
})
- return common.plugin.create_listing(
+ return common.PLUGIN.create_listing(
videos,
sort_methods=(
common.sp.xbmcplugin.SORT_METHOD_DATE,
@@ -189,59 +242,102 @@ def list_videos(params):
),
content='tvshows')
+@common.PLUGIN.cached(common.CACHE_TIME)
+def list_live(params):
+ """Build live listing"""
+ lives = []
-@common.plugin.cached(common.cache_time)
-def get_video_url(params):
- file_medias = utils.get_webcontent(
- params.url)
- json_parser = json.loads(file_medias)
+ desired_language = common.PLUGIN.get_setting(
+ params.channel_id + '.language')
- url_auto = ''
- url_hd_plus = ''
- url_hd = ''
- url_sd = ''
- url_sd_minus = ''
- video_streams = json_parser['videoJsonPlayer']['VSR']
+ if desired_language == 'DE':
+ desired_language = 'de'
+ else:
+ desired_language = 'fr'
- if 'HLS_SQ_1' in video_streams:
- url_auto = video_streams['HLS_SQ_1']['url'].encode('utf-8')
+ url_live = ''
- if 'HTTP_MP4_SQ_1' in video_streams:
- url_hd_plus = video_streams['HTTP_MP4_SQ_1']['url'].encode('utf-8')
+ file_path = utils.download_catalog(
+ URL_LIVE_ARTE % desired_language,
+ '%s_%s_live.json' % (params.channel_name, desired_language)
+ )
+ file_live = open(file_path).read()
+ json_parser = json.loads(file_live)
+
+ title = json_parser["videoJsonPlayer"]["VTI"].encode('utf-8')
+ img = json_parser["videoJsonPlayer"]["VTU"]["IUR"].encode('utf-8')
+ plot = ''
+ if 'V7T' in json_parser["videoJsonPlayer"]:
+ plot = json_parser["videoJsonPlayer"]["V7T"].encode('utf-8')
+ elif 'VDE' in json_parser["videoJsonPlayer"]:
+ plot = json_parser["videoJsonPlayer"]["VDE"].encode('utf-8')
+ duration = 0
+ duration = json_parser["videoJsonPlayer"]["videoDurationSeconds"]
+ url_live = json_parser["videoJsonPlayer"]["VSR"]["HLS_SQ_1"]["url"]
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'plot': plot,
+ 'duration': duration
+ }
+ }
+
+ lives.append({
+ 'label': title,
+ 'fanart': img,
+ 'thumb': img,
+ 'url' : common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_l',
+ url=url_live,
+ ),
+ 'is_playable': True,
+ 'info': info
+ })
+
+ return common.PLUGIN.create_listing(
+ lives,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ )
+ )
- if 'HTTP_MP4_EQ_1' in video_streams:
- url_hd = video_streams['HTTP_MP4_EQ_1']['url'].encode('utf-8')
+@common.PLUGIN.cached(common.CACHE_TIME)
+def get_video_url(params):
+ """Get video URL and start video player"""
+ if params.next == 'play_r' or params.next == 'download_video':
+ file_medias = utils.get_webcontent(
+ params.url)
+ json_parser = json.loads(file_medias)
- if 'HTTP_MP4_HQ_1' in video_streams:
- url_sd = video_streams['HTTP_MP4_HQ_1']['url'].encode('utf-8')
+ url_selected = ''
+ video_streams = json_parser['videoJsonPlayer']['VSR']
- if 'HTTP_MP4_MQ_1' in video_streams:
- url_sd_minus = video_streams['HTTP_MP4_MQ_1']['url'].encode('utf-8')
+ desired_quality = common.PLUGIN.get_setting('quality')
- desired_quality = common.plugin.get_setting(
- params.channel_id + '.quality')
+ if desired_quality == "DIALOG":
+ all_datas_videos = []
- if desired_quality == 'Auto' and url_auto:
- return url_auto
+ for video in video_streams:
+ if not video.find("HLS"):
+ datas = json_parser['videoJsonPlayer']['VSR'][video]
+ new_list_item = common.sp.xbmcgui.ListItem()
+ new_list_item.setLabel(datas['mediaType'] + " (" + datas['versionLibelle'] + ")")
+ new_list_item.setPath(datas['url'])
+ all_datas_videos.append(new_list_item)
- if desired_quality == 'HD+' and url_hd_plus:
- return url_hd_plus
- elif url_hd:
- return url_hd
+ seleted_item = common.sp.xbmcgui.Dialog().select("Choose Stream", all_datas_videos)
- if desired_quality == 'HD' and url_hd:
- return url_hd
- elif url_hd_plus:
- return url_hd_plus
+ url_selected = all_datas_videos[seleted_item].getPath().encode('utf-8')
- if desired_quality == 'SD' and url_sd:
- return url_sd
- elif url_sd_minus:
- return url_sd_minus
+ elif desired_quality == "BEST":
+ url_selected = video_streams['HTTP_MP4_SQ_1']['url'].encode('utf-8')
+ else:
+ url_selected = video_streams['HLS_SQ_1']['url'].encode('utf-8')
- if desired_quality == 'SD-' and url_sd_minus:
- return url_sd_minus
- elif url_sd:
- return url_sd
+ return url_selected
+ elif params.next == 'play_l':
+ return params.url
- return url_auto
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/eu/euronews.py b/plugin.video.catchuptvandmore/resources/lib/channels/eu/euronews.py
new file mode 100755
index 0000000..be0edad
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/eu/euronews.py
@@ -0,0 +1,193 @@
+# -*- coding: utf-8 -*-
+"""
+ Catch-up TV & More
+ Original work (C) JUL1EN094, SPM, SylvainCecchetto
+ Copyright (C) 2016 SylvainCecchetto
+
+ This file is part of Catch-up TV & More.
+
+ Catch-up TV & More is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Catch-up TV & More is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 Catch-up TV & More; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+import json
+from resources.lib import utils
+from resources.lib import common
+
+# TO DO
+# Replay add emissions
+# Add info LIVE TV
+
+# Initialize GNU gettext emulation in addon
+# This allows to use UI strings from addon’s English
+# strings.po file instead of numeric codes
+_ = common.ADDON.initialize_gettext()
+
+URL_LIVE_API = 'http://%s.euronews.com/api/watchlive.json'
+# Language
+
+def channel_entry(params):
+ """Entry function of the module"""
+ if 'root' in params.next:
+ return root(params)
+ elif 'list_shows' in params.next:
+ return list_shows(params)
+ elif 'list_videos' in params.next:
+ return list_videos(params)
+ elif 'live' in params.next:
+ return list_live(params)
+ elif 'play' in params.next:
+ return get_video_url(params)
+ return None
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def root(params):
+ modes = []
+
+ # Add Replay Desactiver
+ if params.channel_name != 'euronews':
+ modes.append({
+ 'label' : 'Replay',
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_shows_1',
+ category='%s Replay' % params.channel_name.upper(),
+ window_title='%s Replay' % params.channel_name.upper()
+ ),
+ })
+
+ # Add Live
+ modes.append({
+ 'label' : 'Live TV',
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='live_cat',
+ category='%s Live TV' % params.channel_name.upper(),
+ window_title='%s Live TV' % params.channel_name.upper()
+ ),
+ })
+
+ return common.PLUGIN.create_listing(
+ modes,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ ),
+ )
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def list_shows(params):
+ return None
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def list_videos(params):
+ return None
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def list_live(params):
+
+ lives = []
+
+ title = ''
+ plot = ''
+ duration = 0
+ img = ''
+ url_live = ''
+
+ desired_language = common.PLUGIN.get_setting(
+ params.channel_id + '.language')
+
+ if desired_language == 'FR':
+ title = '%s Français Live' % (params.channel_name.upper())
+ elif desired_language == 'EN':
+ title = '%s English Live' % (params.channel_name.upper())
+ elif desired_language == 'AR':
+ title = '%s عربية Live' % (params.channel_name.upper())
+ elif desired_language == 'DE':
+ title = '%s Deutsch Live' % (params.channel_name.upper())
+ elif desired_language == 'IT':
+ title = '%s Italiano Live' % (params.channel_name.upper())
+ elif desired_language == 'ES':
+ title = '%s Español Live' % (params.channel_name.upper())
+ elif desired_language == 'PT':
+ title = '%s Português Live' % (params.channel_name.upper())
+ elif desired_language == 'RU':
+ title = '%s Русский Live' % (params.channel_name.upper())
+ elif desired_language == 'TR':
+ title = '%s Türkçe Live' % (params.channel_name.upper())
+ elif desired_language == 'FA':
+ title = '%s فارسی Live' % (params.channel_name.upper())
+ elif desired_language == 'GR':
+ title = '%s Ελληνικά Live' % (params.channel_name.upper())
+ elif desired_language == 'HU':
+ title = '%s Magyar Nyelv Live' % (params.channel_name.upper())
+
+ if desired_language == 'EN':
+ url_live_json = URL_LIVE_API % 'www'
+ elif desired_language == 'AR':
+ url_live_json = URL_LIVE_API % 'arabic'
+ else:
+ url_live_json = URL_LIVE_API % desired_language.lower()
+
+ file_path = utils.download_catalog(
+ url_live_json,
+ '%s_%s_live.json' % (params.channel_name,desired_language.lower())
+ )
+ json_live = open(file_path).read()
+ json_parser = json.loads(json_live)
+ url_2nd_json = json_parser["url"]
+
+ file_path_2 = utils.download_catalog(
+ url_2nd_json,
+ '%s_%s_live_2.json' % (params.channel_name,desired_language.lower())
+ )
+ json_live_2 = open(file_path_2).read()
+ json_parser_2 = json.loads(json_live_2)
+
+ url_live = json_parser_2["primary"]
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'plot': plot,
+ 'duration': duration
+ }
+ }
+
+ lives.append({
+ 'label': title,
+ 'fanart': img,
+ 'thumb': img,
+ 'url' : common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_l',
+ url=url_live,
+ ),
+ 'is_playable': True,
+ 'info': info
+ })
+
+ return common.PLUGIN.create_listing(
+ lives,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ )
+ )
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def get_video_url(params):
+
+ if params.next == 'play_l':
+ return params.url
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/fr/6play.py b/plugin.video.catchuptvandmore/resources/lib/channels/fr/6play.py
index 4a62a9d..b779d94 100644..100755
--- a/plugin.video.catchuptvandmore/resources/lib/channels/fr/6play.py
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/fr/6play.py
@@ -26,64 +26,112 @@ import json
from resources.lib import utils
from resources.lib import common
+# TO DO
+# LIVE TV protected by #EXT-X-FAXS-CM
+# https://helpx.adobe.com/adobe-media-server/dev/configuring-content-protection-hls.html
+
+# Initialize GNU gettext emulation in addon
+# This allows to use UI strings from addon’s English
+# strings.po file instead of numeric codes
+_ = common.ADDON.initialize_gettext()
# Url to get channel's categories
# e.g. Info, Divertissement, Séries, ...
# We get an id by category
-url_root = 'http://pc.middleware.6play.fr/6play/v2/platforms/' \
- 'm6group_web/services/%sreplay/folders?limit=999&offset=0'
+URL_ROOT = 'http://pc.middleware.6play.fr/6play/v2/platforms/' \
+ 'm6group_web/services/%s/folders?limit=999&offset=0'
# Url to get catgory's programs
# e.g. Le meilleur patissier, La france à un incroyable talent, ...
# We get an id by program
-url_category = 'http://pc.middleware.6play.fr/6play/v2/platforms/' \
+URL_CATEGORY = 'http://pc.middleware.6play.fr/6play/v2/platforms/' \
'm6group_web/services/6play/folders/%s/programs' \
'?limit=999&offset=0&csa=9&with=parentcontext'
# Url to get program's subfolders
# e.g. Saison 5, Les meilleurs moments, les recettes pas à pas, ...
# We get an id by subfolder
-url_subcategory = 'http://pc.middleware.6play.fr/6play/v2/platforms/' \
+URL_SUBCATEGORY = 'http://pc.middleware.6play.fr/6play/v2/platforms/' \
'm6group_web/services/6play/programs/%s' \
'?with=links,subcats,rights'
# Url to get shows list
# e.g. Episode 1, Episode 2, ...
-url_videos = 'http://pc.middleware.6play.fr/6play/v2/platforms/' \
+URL_VIDEOS = 'http://pc.middleware.6play.fr/6play/v2/platforms/' \
'm6group_web/services/6play/programs/%s/videos?' \
'csa=6&with=clips,freemiumpacks&type=vi,vc,playlist&limit=999'\
'&offset=0&subcat=%s&sort=subcat'
-url_videos2 = 'https://pc.middleware.6play.fr/6play/v2/platforms/' \
+URL_VIDEOS2 = 'https://pc.middleware.6play.fr/6play/v2/platforms/' \
'm6group_web/services/6play/programs/%s/videos?' \
'csa=6&with=clips,freemiumpacks&type=vi&limit=999&offset=0'
-url_json_video = 'https://pc.middleware.6play.fr/6play/v2/platforms/' \
+URL_JSON_VIDEO = 'https://pc.middleware.6play.fr/6play/v2/platforms/' \
'm6group_web/services/6play/videos/%s'\
'?csa=9&with=clips,freemiumpacks'
-url_img = 'https://images.6play.fr/v1/images/%s/raw'
+URL_IMG = 'https://images.6play.fr/v1/images/%s/raw'
def channel_entry(params):
- if 'list_shows' in params.next:
+ """Entry function of the module"""
+ if 'root' in params.next:
+ return root(params)
+ elif 'list_shows' in params.next:
return list_shows(params)
elif 'list_videos' in params.next:
return list_videos(params)
+ elif 'live' in params.next:
+ return list_live(params)
elif 'play' in params.next:
- return get_video_URL(params)
+ return get_video_url(params)
+ return None
+
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def root(params):
+ """Add Replay and Live in the listing"""
+ modes = []
+
+ # Add Replay
+ modes.append({
+ 'label' : 'Replay',
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_shows_1',
+ category='%s Replay' % params.channel_name.upper(),
+ window_title='%s Replay' % params.channel_name.upper()
+ ),
+ })
+ return common.PLUGIN.create_listing(
+ modes,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ ),
+ )
-@common.plugin.cached(common.cache_time)
+@common.PLUGIN.cached(common.CACHE_TIME)
def list_shows(params):
+ """Build categories listing"""
shows = []
if params.next == 'list_shows_1':
+
+ url_root_site = ''
+ if params.channel_name == 'stories' or params.channel_name == 'bruce' \
+ or params.channel_name == 'crazy_kitchen' or params.channel_name == 'home' \
+ or params.channel_name == 'styles' or params.channel_name == 'comedy':
+ url_root_site = URL_ROOT % params.channel_name
+ else:
+ url_root_site = URL_ROOT % (params.channel_name + 'replay')
+
file_path = utils.download_catalog(
- url_root % (params.channel_name),
+ url_root_site,
'%s.json' % (params.channel_name),
random_ua=True)
file_prgm = open(file_path).read()
@@ -102,7 +150,7 @@ def list_shows(params):
category_name = array['name'].encode('utf-8')
shows.append({
'label': category_name,
- 'url': common.plugin.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
category_id=category_id,
next='list_shows_2',
@@ -111,7 +159,7 @@ def list_shows(params):
)
})
- shows = common.plugin.create_listing(
+ shows = common.PLUGIN.create_listing(
shows,
sort_methods=(
common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
@@ -121,7 +169,7 @@ def list_shows(params):
elif params.next == 'list_shows_2':
file_prgm = utils.get_webcontent(
- url_category % (params.category_id),
+ URL_CATEGORY % (params.category_id),
random_ua=True)
json_parser = json.loads(file_prgm)
@@ -131,13 +179,14 @@ def list_shows(params):
program_desc = array['description'].encode('utf-8')
program_imgs = array['images']
program_img = ''
+ program_fanart = ''
for img in program_imgs:
if img['role'].encode('utf-8') == 'vignette':
external_key = img['external_key'].encode('utf-8')
- program_img = url_img % (external_key)
+ program_img = URL_IMG % (external_key)
elif img['role'].encode('utf-8') == 'carousel':
external_key = img['external_key'].encode('utf-8')
- program_fanart = url_img % (external_key)
+ program_fanart = URL_IMG % (external_key)
info = {
'video': {
@@ -149,7 +198,7 @@ def list_shows(params):
'label': program_title,
'thumb': program_img,
'fanart': program_fanart,
- 'url': common.plugin.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
next='list_shows_3',
program_id=program_id,
@@ -162,7 +211,7 @@ def list_shows(params):
'info': info
})
- shows = common.plugin.create_listing(
+ shows = common.PLUGIN.create_listing(
shows,
sort_methods=(
common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
@@ -172,10 +221,16 @@ def list_shows(params):
elif params.next == 'list_shows_3':
program_json = utils.get_webcontent(
- url_subcategory % (params.program_id),
+ URL_SUBCATEGORY % (params.program_id),
random_ua=True)
json_parser = json.loads(program_json)
+
+ try:
+ program_fanart = params.program_fanart
+ except:
+ program_fanart = ''
+
for sub_category in json_parser['program_subcats']:
sub_category_id = str(sub_category['id'])
sub_category_title = sub_category['title'].encode('utf-8')
@@ -190,8 +245,8 @@ def list_shows(params):
shows.append({
'label': sub_category_title,
'thumb': params.program_img,
- 'fanart': params.program_fanart,
- 'url': common.plugin.get_url(
+ 'fanart': program_fanart,
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
next='list_videos',
program_id=params.program_id,
@@ -203,15 +258,15 @@ def list_shows(params):
info = {
'video': {
- 'title': common.addon.get_localized_string(30101),
+ 'title': common.ADDON.get_localized_string(30101),
'plot': params.program_desc
}
}
shows.append({
- 'label': common.addon.get_localized_string(30101),
+ 'label': common.ADDON.get_localized_string(30101),
'thumb': params.program_img,
- 'fanart': params.program_fanart,
- 'url': common.plugin.get_url(
+ 'fanart': program_fanart,
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
next='list_videos',
program_id=params.program_id,
@@ -222,7 +277,7 @@ def list_shows(params):
'info': info
})
- shows = common.plugin.create_listing(
+ shows = common.PLUGIN.create_listing(
shows,
sort_methods=(
common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
@@ -233,14 +288,15 @@ def list_shows(params):
return shows
-@common.plugin.cached(common.cache_time)
+@common.PLUGIN.cached(common.CACHE_TIME)
def list_videos(params):
+ """Build videos listing"""
videos = []
if params.sub_category_id == 'null':
- url = url_videos2 % params.program_id
+ url = URL_VIDEOS2 % params.program_id
else:
- url = url_videos % (params.program_id, params.sub_category_id)
+ url = URL_VIDEOS % (params.program_id, params.sub_category_id)
program_json = utils.get_webcontent(
url,
random_ua=True)
@@ -275,7 +331,7 @@ def list_videos(params):
for img in program_imgs:
if img['role'].encode('utf-8') == 'vignette':
external_key = img['external_key'].encode('utf-8')
- program_img = url_img % (external_key)
+ program_img = URL_IMG % (external_key)
info = {
'video': {
@@ -289,19 +345,29 @@ def list_videos(params):
}
}
+ context_menu = []
+ download_video = (
+ _('Download'),
+ 'XBMC.RunPlugin(' + common.PLUGIN.get_url(
+ action='download_video',
+ video_id=video_id) + ')'
+ )
+ context_menu.append(download_video)
+
videos.append({
'label': title,
'thumb': program_img,
- 'url': common.plugin.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
next='play',
video_id=video_id,
),
'is_playable': True,
- 'info': info
+ 'info': info,
+ 'context_menu': context_menu
})
- return common.plugin.create_listing(
+ return common.PLUGIN.create_listing(
videos,
sort_methods=(
common.sp.xbmcplugin.SORT_METHOD_DATE,
@@ -312,10 +378,11 @@ def list_videos(params):
content='tvshows')
-@common.plugin.cached(common.cache_time)
-def get_video_URL(params):
+@common.PLUGIN.cached(common.CACHE_TIME)
+def get_video_url(params):
+ """Get video URL and start video player"""
video_json = utils.get_webcontent(
- url_json_video % (params.video_id),
+ URL_JSON_VIDEO % (params.video_id),
random_ua=True)
json_parser = json.loads(video_json)
@@ -343,10 +410,10 @@ def get_video_URL(params):
manifest_url,
random_ua=True)
if 'drm' in manifest:
- utils.send_notification(common.addon.get_localized_string(30102))
+ utils.send_notification(common.ADDON.get_localized_string(30102))
return ''
- desired_quality = common.plugin.get_setting(
+ desired_quality = common.PLUGIN.get_setting(
params.channel_id + '.quality')
if desired_quality == 'Auto':
@@ -370,16 +437,9 @@ def get_video_URL(params):
elif 'RESOLUTION=1080' in lines[k]:
url_ultra_hd = root + '/' + lines[k + 1]
- if desired_quality == 'Force HD':
- if url_ultra_hd:
- return url_ultra_hd
- elif url_hd:
- return url_hd
- return manifest_url
+ desired_quality = common.PLUGIN.get_setting('quality')
- elif desired_quality == 'Force SD':
- if url_ultra_sd:
- return url_ultra_sd
- elif url_sd:
- return url_sd
+ if (desired_quality == 'BEST' or desired_quality == 'DIALOG') and url_ultra_hd:
+ return url_ultra_hd
+ else:
return manifest_url
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/fr/__init__.py b/plugin.video.catchuptvandmore/resources/lib/channels/fr/__init__.py
index e69de29..e69de29 100644..100755
--- a/plugin.video.catchuptvandmore/resources/lib/channels/fr/__init__.py
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/fr/__init__.py
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/fr/bfmtv.py b/plugin.video.catchuptvandmore/resources/lib/channels/fr/bfmtv.py
index 7bd7a93..e52cbf4 100644..100755
--- a/plugin.video.catchuptvandmore/resources/lib/channels/fr/bfmtv.py
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/fr/bfmtv.py
@@ -21,214 +21,740 @@
'''
import json
+import ast
+import time
+import re
+from bs4 import BeautifulSoup as bs
from resources.lib import utils
from resources.lib import common
-import ast
-url_token = 'http://api.nextradiotv.com/bfmtv-applications/'
+# TO DO
+# Add Live TV (ONENET ???)
-url_menu = 'http://www.bfmtv.com/static/static-mobile/bfmtv/' \
+# BFMTV, RMC, ONENET, etc ...
+URL_TOKEN = 'http://api.nextradiotv.com/%s-applications/'
+#channel
+
+URL_MENU = 'http://www.bfmtv.com/static/static-mobile/bfmtv/' \
'ios-smartphone/v0/configuration.json'
-url_replay = 'http://api.nextradiotv.com/bfmtv-applications/%s/' \
+URL_REPLAY = 'http://api.nextradiotv.com/%s-applications/%s/' \
'getPage?pagename=replay'
-# token
+# channel, token
-url_show = 'http://api.nextradiotv.com/bfmtv-applications/%s/' \
+URL_SHOW = 'http://api.nextradiotv.com/%s-applications/%s/' \
'getVideosList?category=%s&count=100&page=%s'
-# token, category, page_number
+# channel, token, category, page_number
-url_video = 'http://api.nextradiotv.com/bfmtv-applications/%s/' \
+URL_VIDEO = 'http://api.nextradiotv.com/%s-applications/%s/' \
'getVideo?idVideo=%s'
-# token, video_id
+# channel, token, video_id
+
+# URL Live
+# Channel ONENET
+URL_LIVE_ONENET = 'http://www.01net.com/mediaplayer/live-video/'
+
+# Channel BFMTV
+URL_LIVE_BFMTV = 'http://www.bfmtv.com/mediaplayer/live-video/'
+
+URL_LIVE_BFM_PARIS = 'http://www.bfmtv.com/mediaplayer/live-bfm-paris/'
+
+# Channel BFM Business
+URL_LIVE_BFMBUSINESS = 'http://bfmbusiness.bfmtv.com/mediaplayer/live-video/'
+
+# Channel RMC
+URL_LIVE_BFM_SPORT = 'http://rmcsport.bfmtv.com/mediaplayer/live-bfm-sport/'
+
+# RMC Decouverte
+URL_REPLAY_RMCDECOUVERTE = 'http://rmcdecouverte.bfmtv.com/mediaplayer-replay/'
+
+URL_VIDEO_HTML_RMCDECOUVERTE = 'http://rmcdecouverte.bfmtv.com/mediaplayer-replay/?id=%s'
+# VideoId_html
+
+URL_LIVE_RMCDECOUVERTE = 'http://rmcdecouverte.bfmtv.com/mediaplayer-direct/'
+
+URL_JS_POLICY_KEY = 'http://players.brightcove.net/%s/%s_default/index.min.js'
+# AccountId, PlayerId
+
+URL_VIDEO_JSON_BRIGHTCOVE = 'https://edge.api.brightcove.com/playback/v1/accounts/%s/videos/%s'
+# AccountId, VideoId
+# Initialize GNU gettext emulation in addon
+# This allows to use UI strings from addon’s English
+# strings.po file instead of numeric codes
+_ = common.ADDON.initialize_gettext()
-@common.plugin.cached(common.cache_time)
-def get_token():
- file_token = utils.get_webcontent(url_token)
+@common.PLUGIN.cached(common.CACHE_TIME)
+def get_token(channel_name):
+ """Get session token"""
+ file_token = utils.get_webcontent(URL_TOKEN % (channel_name))
token_json = json.loads(file_token)
return token_json['session']['token'].encode('utf-8')
+@common.PLUGIN.cached(common.CACHE_TIME)
+def get_policy_key(data_account, data_player):
+ """Get policy key"""
+ file_js = utils.get_webcontent(URL_JS_POLICY_KEY % (data_account, data_player))
+ return re.compile('policyKey:"(.+?)"').findall(file_js)[0]
+
+
def channel_entry(params):
+ """Entry function of the module"""
+ if 'root' in params.next:
+ return root(params)
if 'list_shows' in params.next:
return list_shows(params)
elif 'list_videos' in params.next:
return list_videos(params)
+ elif 'live' in params.next:
+ return list_live(params)
elif 'play' in params.next:
- return get_video_URL(params)
+ return get_video_url(params)
+ return None
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def root(params):
+ """Add Replay and Live in the listing"""
+ modes = []
+
+ # Add Replay Desactiver
+ modes.append({
+ 'label' : 'Replay',
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_shows_1',
+ category='%s Replay' % params.channel_name.upper(),
+ window_title='%s Replay' % params.channel_name.upper()
+ ),
+ })
+
+ # Add Live
+ if params.channel_name != '01net':
+ modes.append({
+ 'label' : 'Live TV',
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='live_cat',
+ category='%s Live TV' % params.channel_name.upper(),
+ window_title='%s Live TV' % params.channel_name.upper()
+ ),
+ })
+ return common.PLUGIN.create_listing(
+ modes,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ ),
+ )
-@common.plugin.cached(common.cache_time)
+@common.PLUGIN.cached(common.CACHE_TIME)
def list_shows(params):
- # Create categories list
+ """Build categories listing"""
shows = []
- if params.next == 'list_shows_1':
+ if params.channel_name == 'rmcdecouverte':
+
file_path = utils.download_catalog(
- url_replay % get_token(),
- '%s.json' % (params.channel_name))
- file_categories = open(file_path).read()
- json_categories = json.loads(file_categories)
- json_categories = json_categories['page']['contents'][0]
- json_categories = json_categories['elements'][0]['items']
-
- for categories in json_categories:
- title = categories['title'].encode('utf-8')
- image_url = categories['image_url'].encode('utf-8')
- category = categories['categories'].encode('utf-8')
+ URL_REPLAY_RMCDECOUVERTE,
+ '%s_replay.html' % (params.channel_name))
+ program_html = open(file_path).read()
+
+ program_soup = bs(program_html, 'html.parser')
+ videos_soup = program_soup.find_all(
+ 'article',
+ class_='art-c modulx2-5 bg-color-rub0-1 box-shadow relative')
+ for video in videos_soup:
+ video_id = video.find('figure').find('a')['href'].split('&', 1)[0].rsplit('=', 1)[1]
+ video_img = video.find('figure').find('a').find('img')['data-original']
+ video_titles = video.find(
+ 'div', class_="art-body"
+ ).find('a').find('h2').get_text().encode(
+ 'utf-8'
+ ).replace('\n', ' ').replace('\r', ' ').split(' ')
+ video_title = ''
+ for i in video_titles:
+ video_title = video_title + ' ' + i.strip()
shows.append({
- 'label': title,
- 'thumb': image_url,
- 'url': common.plugin.get_url(
+ 'label': video_title,
+ 'thumb': video_img,
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
- category=category,
next='list_videos_1',
- title=title,
+ video_id=video_id,
+ title=video_title,
page='1',
- window_title=title
+ window_title=video_title
)
})
- return common.plugin.create_listing(
- shows,
- sort_methods=(
- common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
- common.sp.xbmcplugin.SORT_METHOD_LABEL
- )
+ else:
+ if params.next == 'list_shows_1':
+ file_path = utils.download_catalog(
+ URL_REPLAY % (params.channel_name, get_token(params.channel_name)),
+ '%s.json' % (params.channel_name))
+ file_categories = open(file_path).read()
+ json_categories = json.loads(file_categories)
+ json_categories = json_categories['page']['contents'][0]
+ json_categories = json_categories['elements'][0]['items']
+
+ for categories in json_categories:
+ title = categories['title'].encode('utf-8')
+ image_url = categories['image_url'].encode('utf-8')
+ category = categories['categories'].encode('utf-8')
+
+ shows.append({
+ 'label': title,
+ 'thumb': image_url,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ category=category,
+ next='list_videos_1',
+ title=title,
+ page='1',
+ window_title=title
+ )
+ })
+
+ return common.PLUGIN.create_listing(
+ shows,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
)
+ )
-@common.plugin.cached(common.cache_time)
+@common.PLUGIN.cached(common.CACHE_TIME)
def list_videos(params):
+ """Build videos listing"""
videos = []
- if 'previous_listing' in params:
- videos = ast.literal_eval(params['previous_listing'])
- if params.next == 'list_videos_1':
+ if params.channel_name == 'rmcdecouverte':
file_path = utils.download_catalog(
- url_show % (
- get_token(),
- params.category,
- params.page),
- '%s_%s_%s.json' % (
- params.channel_name,
- params.category,
- params.page))
- file_show = open(file_path).read()
- json_show = json.loads(file_show)
-
- for video in json_show['videos']:
- video_id = video['video'].encode('utf-8')
- video_id_ext = video['id_ext'].encode('utf-8')
- category = video['category'].encode('utf-8')
- title = video['title'].encode('utf-8')
- description = video['description'].encode('utf-8')
- begin_date = video['begin_date'] # 1486725600,
- image = video['image'].encode('utf-8')
- duration = video['video_duration_ms'] / 1000
+ URL_VIDEO_HTML_RMCDECOUVERTE % (params.video_id),
+ '%s_%s_replay.html' % (params.channel_name, params.video_id))
+ video_html = open(file_path).read()
+
+ video_soup = bs(video_html, 'html.parser')
+ data_video_soup = video_soup.find('div', class_='next-player')
+
+ data_account = data_video_soup['data-account']
+ data_video_id = data_video_soup['data-video-id']
+ data_player = data_video_soup['data-player']
+
+ # Method to get JSON from 'edge.api.brightcove.com'
+ file_json = utils.download_catalog(
+ URL_VIDEO_JSON_BRIGHTCOVE % (data_account, data_video_id),
+ '%s_%s_replay.json' % (data_account, data_video_id),
+ force_dl=False,
+ request_type='get',
+ post_dic={},
+ random_ua=False,
+ specific_headers={'Accept': 'application/json;pk=%s' % (
+ get_policy_key(data_account, data_player))},
+ params={})
+ video_json = open(file_json).read()
+ json_parser = json.loads(video_json)
+
+
+ video_title = ''
+ program_title = ''
+ for program in json_parser["tags"]:
+ program_title = program.upper() + ' - '
+ video_title = program_title + json_parser["name"].encode('utf-8').lower()
+ video_img = ''
+ for poster in json_parser["poster_sources"]:
+ video_img = poster["src"]
+ video_plot = json_parser["long_description"].encode('utf-8')
+ video_duration = 0
+ video_duration = json_parser["duration"] / 1000
+ video_url = ''
+ for url in json_parser["sources"]:
+ if 'type' in url:
+ video_url = url["src"].encode('utf-8')
+
+ date_value_list = json_parser["published_at"].split('T')[0].split('-')
+
+ day = date_value_list[2]
+ mounth = date_value_list[1]
+ year = date_value_list[0]
+
+ date = '.'.join((day, mounth, year))
+ aired = '-'.join((year, mounth, day))
+
+ info = {
+ 'video': {
+ 'title': video_title,
+ 'aired': aired,
+ 'date': date,
+ 'duration': video_duration,
+ 'plot': video_plot,
+ 'year': year,
+ 'mediatype': 'tvshow'
+ }
+ }
+
+ context_menu = []
+ download_video = (
+ _('Download'),
+ 'XBMC.RunPlugin(' + common.PLUGIN.get_url(
+ action='download_video',
+ video_id=params.video_id) + ')'
+ )
+ context_menu.append(download_video)
+
+ videos.append({
+ 'label': video_title,
+ 'thumb': video_img,
+ 'fanart': video_img,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_r',
+ video_url=video_url
+ ),
+ 'is_playable': True,
+ 'info': info,
+ 'context_menu': context_menu
+ })
+
+ else:
+ if 'previous_listing' in params:
+ videos = ast.literal_eval(params['previous_listing'])
+
+ if params.next == 'list_videos_1':
+ file_path = utils.download_catalog(
+ URL_SHOW % (
+ params.channel_name,
+ get_token(params.channel_name),
+ params.category,
+ params.page),
+ '%s_%s_%s.json' % (
+ params.channel_name,
+ params.category,
+ params.page))
+ file_show = open(file_path).read()
+ json_show = json.loads(file_show)
+
+ for video in json_show['videos']:
+ video_id = video['video'].encode('utf-8')
+ video_id_ext = video['id_ext'].encode('utf-8')
+ category = video['category'].encode('utf-8')
+ title = video['title'].encode('utf-8')
+ description = video['description'].encode('utf-8')
+ begin_date = video['begin_date'] # 1486725600,
+ image = video['image'].encode('utf-8')
+ duration = video['video_duration_ms'] / 1000
+
+ value_date = time.strftime('%d %m %Y', time.localtime(video["begin_date"]))
+ date = str(value_date).split(' ')
+ day = date[0]
+ mounth = date[1]
+ year = date[2]
+
+ date = '.'.join((day, mounth, year))
+ aired = '-'.join((year, mounth, day))
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'plot': description,
+ 'aired': aired,
+ 'date': date,
+ 'duration': duration,
+ 'year': year,
+ 'genre': category,
+ 'mediatype': 'tvshow'
+ }
+ }
+
+ context_menu = []
+ download_video = (
+ _('Download'),
+ 'XBMC.RunPlugin(' + common.PLUGIN.get_url(
+ action='download_video',
+ video_id=video_id) + ')'
+ )
+ context_menu.append(download_video)
+
+ videos.append({
+ 'label': title,
+ 'thumb': image,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_r',
+ video_id=video_id,
+ video_id_ext=video_id_ext
+ ),
+ 'is_playable': True,
+ 'info': info,
+ 'context_menu': context_menu
+ })
+
+ # More videos...
+ videos.append({
+ 'label': common.ADDON.get_localized_string(30100),
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ category=params.category,
+ next='list_videos_1',
+ title=title,
+ page=str(int(params.page) + 1),
+ window_title=params.window_title,
+ update_listing=True,
+ previous_listing=str(videos)
+ )
+
+ })
+
+ return common.PLUGIN.create_listing(
+ videos,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_DURATION,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE,
+ common.sp.xbmcplugin.SORT_METHOD_GENRE,
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED
+ ),
+ content='tvshows',
+ update_listing='update_listing' in params,
+ )
+
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def list_live(params):
+ """Build live listing"""
+ lives = []
+
+ title = ''
+ plot = ''
+ duration = 0
+ img = ''
+ url_live = ''
+
+ if params.channel_name == 'rmcdecouverte':
+
+ file_path = utils.download_catalog(
+ URL_LIVE_RMCDECOUVERTE,
+ '%s_live.html' % (params.channel_name))
+ live_html = open(file_path).read()
+
+ live_soup = bs(live_html, 'html.parser')
+ data_live_soup = live_soup.find('div', class_='next-player')
+
+ data_account = data_live_soup['data-account']
+ data_video_id = data_live_soup['data-video-id']
+ data_player = data_live_soup['data-player']
+
+ # Method to get JSON from 'edge.api.brightcove.com'
+ file_json = utils.download_catalog(
+ URL_VIDEO_JSON_BRIGHTCOVE % (data_account, data_video_id),
+ '%s_%s_live.json' % (data_account, data_video_id),
+ force_dl=False,
+ request_type='get',
+ post_dic={},
+ random_ua=False,
+ specific_headers={'Accept': 'application/json;pk=%s' % (
+ get_policy_key(data_account, data_player))},
+ params={})
+ video_json = open(file_json).read()
+ json_parser = json.loads(video_json)
+
+ title = json_parser["name"]
+ plot = json_parser["long_description"].encode('utf-8')
+
+ for url in json_parser["sources"]:
+ url_live = url["src"].encode('utf-8')
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'plot': plot,
+ 'duration': duration
+ }
+ }
+
+ lives.append({
+ 'label': title,
+ 'fanart': img,
+ 'thumb': img,
+ 'url' : common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_l',
+ url_live=url_live,
+ ),
+ 'is_playable': True,
+ 'info': info
+ })
+
+ else:
+
+ if params.channel_name == 'bfmtv':
+
+ # BFMTV
+ file_path = utils.download_catalog(
+ URL_LIVE_BFMTV,
+ '%s_live.html' % (params.channel_name))
+ live_html = open(file_path).read()
+
+ url_live = re.compile(r'file: \'(.*?)\'').findall(live_html)[0]
+
+ title = '%s Live' % params.channel_name.upper()
info = {
'video': {
'title': title,
- 'plot': description,
- #'aired': aired,
- #'date': date,
- 'duration': duration,
- #'year': year,
- 'genre': category,
- 'mediatype': 'tvshow'
+ 'plot': plot,
+ 'duration': duration
}
}
- videos.append({
+ lives.append({
'label': title,
- 'thumb': image,
- 'url': common.plugin.get_url(
+ 'fanart': img,
+ 'thumb': img,
+ 'url' : common.PLUGIN.get_url(
action='channel_entry',
- next='play',
- video_id=video_id,
- video_id_ext=video_id_ext
+ next='play_l',
+ url_live=url_live,
),
'is_playable': True,
'info': info
})
- # More videos...
- videos.append({
- 'label': common.addon.get_localized_string(30100),
- 'url': common.plugin.get_url(
- action='channel_entry',
- category=params.category,
- next='list_videos_1',
- title=title,
- page=str(int(params.page) + 1),
- window_title=params.window_title,
- update_listing=True,
- previous_listing=str(videos)
- )
+ #BFM PARIS
+ file_paris_path = utils.download_catalog(
+ URL_LIVE_BFM_PARIS,
+ 'bfm_paris_live.html')
+ live_paris_html = open(file_paris_path).read()
+
+ live_paris_soup = bs(live_paris_html, 'html.parser')
+ data_live_paris_soup = live_paris_soup.find('div', class_='BCLvideoWrapper')
+
+ data_account_paris = data_live_paris_soup.find('script')['data-account']
+ data_video_id_paris = data_live_paris_soup.find('script')['data-video-id']
+ data_player_paris = data_live_paris_soup.find('script')['data-player']
+
+ # Method to get JSON from 'edge.api.brightcove.com'
+ file_json_paris = utils.download_catalog(
+ URL_VIDEO_JSON_BRIGHTCOVE % (data_account_paris, data_video_id_paris),
+ '%s_%s_live.json' % (data_account_paris, data_video_id_paris),
+ force_dl=False,
+ request_type='get',
+ post_dic={},
+ random_ua=False,
+ specific_headers={'Accept': 'application/json;pk=%s' % (
+ get_policy_key(data_account_paris, data_player_paris))},
+ params={})
+ video_json_paris = open(file_json_paris).read()
+ json_parser_paris = json.loads(video_json_paris)
+
+ title_paris = json_parser_paris["name"]
+ plot_paris = ''
+ if json_parser_paris["long_description"]:
+ plot_paris = json_parser_paris["long_description"].encode('utf-8')
+
+ for url_paris in json_parser_paris["sources"]:
+ url_live_paris = url_paris["src"].encode('utf-8')
+
+ info_paris = {
+ 'video': {
+ 'title': title_paris,
+ 'plot': plot_paris,
+ 'duration': duration
+ }
+ }
- })
+ lives.append({
+ 'label': title_paris,
+ 'fanart': img,
+ 'thumb': img,
+ 'url' : common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_l',
+ url_live=url_live_paris,
+ ),
+ 'is_playable': True,
+ 'info': info_paris
+ })
- return common.plugin.create_listing(
- videos,
- sort_methods=(
- common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
- common.sp.xbmcplugin.SORT_METHOD_DURATION,
- common.sp.xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE,
- common.sp.xbmcplugin.SORT_METHOD_GENRE,
- common.sp.xbmcplugin.SORT_METHOD_UNSORTED
- ),
- content='tvshows',
- update_listing='update_listing' in params,
- )
+ elif params.channel_name == 'bfmbusiness':
+
+ #BFM BUSINESS
+ file_path = utils.download_catalog(
+ URL_LIVE_BFMBUSINESS,
+ '%s_live.html' % (params.channel_name))
+ live_html = open(file_path).read()
+
+ live_soup = bs(live_html, 'html.parser')
+ data_live_soup = live_soup.find('div', class_='BCLvideoWrapper')
+
+ data_account = data_live_soup.find('script')['data-account']
+ data_video_id = data_live_soup.find('script')['data-video-id']
+ data_player = data_live_soup.find('script')['data-player']
+
+ # Method to get JSON from 'edge.api.brightcove.com'
+ file_json = utils.download_catalog(
+ URL_VIDEO_JSON_BRIGHTCOVE % (data_account, data_video_id),
+ '%s_%s_live.json' % (data_account, data_video_id),
+ force_dl=False,
+ request_type='get',
+ post_dic={},
+ random_ua=False,
+ specific_headers={'Accept': 'application/json;pk=%s' % (
+ get_policy_key(data_account, data_player))},
+ params={})
+ video_json = open(file_json).read()
+ json_parser = json.loads(video_json)
+
+ title = json_parser["name"]
+ plot = ''
+ if json_parser["long_description"]:
+ plot = json_parser["long_description"].encode('utf-8')
+
+ for url in json_parser["sources"]:
+ url_live = url["src"].encode('utf-8')
+ img = json_parser["poster"].encode('utf-8')
+ info = {
+ 'video': {
+ 'title': title,
+ 'plot': plot,
+ 'duration': duration
+ }
+ }
-@common.plugin.cached(common.cache_time)
-def get_video_URL(params):
- file_medias = utils.get_webcontent(
- url_video % (get_token(), params.video_id))
- json_parser = json.loads(file_medias)
-
- url_hd_plus = ''
- url_hd = ''
- url_sd = ''
- url_sd_minus = ''
- url_default = ''
-
- for media in json_parser['video']['medias']:
- if media['frame_height'] == 270:
- url_sd_minus = media['video_url'].encode('utf-8')
- elif media['frame_height'] == 360:
- url_sd = media['video_url'].encode('utf-8')
- elif media['frame_height'] == 720:
- url_hd = media['video_url'].encode('utf-8')
- elif media['frame_height'] == 1080:
- url_hd_plus = media['video_url'].encode('utf-8')
- url_default = media['video_url'].encode('utf-8')
-
- desired_quality = common.plugin.get_setting(
- params.channel_id + '.quality')
-
- if desired_quality == 'HD+' and url_hd_plus:
- return url_hd_plus
- elif url_hd:
- return url_hd
-
- if desired_quality == 'HD' and url_hd:
- return url_hd
- elif url_hd_plus:
- return url_hd_plus
-
- if desired_quality == 'SD' and url_sd:
- return url_sd
- elif url_sd_minus:
- return url_sd_minus
-
- if desired_quality == 'SD-' and url_sd_minus:
- return url_sd_minus
- elif url_sd:
- return url_sd
-
- return url_default
+ lives.append({
+ 'label': title,
+ 'fanart': img,
+ 'thumb': img,
+ 'url' : common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_l',
+ url_live=url_live,
+ ),
+ 'is_playable': True,
+ 'info': info
+ })
+
+ elif params.channel_name == 'rmc':
+
+ #BFM SPORT
+ file_path = utils.download_catalog(
+ URL_LIVE_BFM_SPORT,
+ 'bfm_sport_live.html')
+ live_html = open(file_path).read()
+
+ live_soup = bs(live_html, 'html.parser')
+
+ data_live_soup = live_soup.find('div', class_='BCLvideoWrapper')
+
+ data_account = data_live_soup.find('script')['data-account']
+ data_video_id = data_live_soup.find('script')['data-video-id']
+ data_player = data_live_soup.find('script')['data-player']
+
+ # Method to get JSON from 'edge.api.brightcove.com'
+ file_json = utils.download_catalog(
+ URL_VIDEO_JSON_BRIGHTCOVE % (data_account, data_video_id),
+ '%s_%s_live.json' % (data_account, data_video_id),
+ force_dl=False,
+ request_type='get',
+ post_dic={},
+ random_ua=False,
+ specific_headers={'Accept': 'application/json;pk=%s' % (
+ get_policy_key(data_account, data_player))},
+ params={})
+ video_json = open(file_json).read()
+ json_parser = json.loads(video_json)
+
+ title = json_parser["name"]
+ plot = ''
+ if json_parser["long_description"]:
+ plot = json_parser["long_description"].encode('utf-8')
+
+ for url in json_parser["sources"]:
+ url_live = url["src"].encode('utf-8')
+ break
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'plot': plot,
+ 'duration': duration
+ }
+ }
+
+ lives.append({
+ 'label': title,
+ 'fanart': img,
+ 'thumb': img,
+ 'url' : common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_l',
+ url_live=url_live,
+ ),
+ 'is_playable': True,
+ 'info': info
+ })
+
+ elif params.channel_name == '01net':
+
+ # TO DO
+
+ return None
+
+ return common.PLUGIN.create_listing(
+ lives,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ )
+ )
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def get_video_url(params):
+ """Get video URL and start video player"""
+ if params.next == 'play_l':
+ return params.url_live
+ elif params.channel_name == 'rmcdecouverte' and params.next == 'play_r':
+ return params.video_url
+ elif params.channel_name == 'rmcdecouverte' and params.next == 'download_video':
+ return URL_VIDEO_HTML_RMCDECOUVERTE % (params.video_id)
+ elif params.channel_name != 'rmcdecouverte' and (params.next == 'play_r' or params.next == 'download_video'):
+ file_medias = utils.get_webcontent(
+ URL_VIDEO % (params.channel_name, get_token(params.channel_name), params.video_id))
+ json_parser = json.loads(file_medias)
+
+ if params.next == 'download_video':
+ return json_parser['video']['long_url'].encode('utf-8')
+
+ video_streams = json_parser['video']['medias']
+
+ desired_quality = common.PLUGIN.get_setting('quality')
+
+ if desired_quality == "DIALOG":
+ all_datas_videos = []
+ for datas in video_streams:
+ new_list_item = common.sp.xbmcgui.ListItem()
+ new_list_item.setLabel(
+ "Video Height : " + str(datas['frame_height']) + \
+ " (Encoding : " + str(datas['encoding_rate']) + ")"
+ )
+ new_list_item.setPath(datas['video_url'])
+ all_datas_videos.append(new_list_item)
+
+ seleted_item = common.sp.xbmcgui.Dialog().select("Choose Stream", all_datas_videos)
+
+ return all_datas_videos[seleted_item].getPath().encode('utf-8')
+
+ elif desired_quality == 'BEST':
+ #GET LAST NODE (VIDEO BEST QUALITY)
+ url_best_quality = ''
+ for datas in video_streams:
+ url_best_quality = datas['video_url'].encode('utf-8')
+ return url_best_quality
+ else:
+ #DEFAULT VIDEO
+ return json_parser['video']['video_url'].encode('utf-8')
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/fr/c.py b/plugin.video.catchuptvandmore/resources/lib/channels/fr/c.py
deleted file mode 100644
index 07bd241..0000000
--- a/plugin.video.catchuptvandmore/resources/lib/channels/fr/c.py
+++ /dev/null
@@ -1,210 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Catch-up TV & More
- Copyright (C) 2017 SylvainCecchetto
-
- This file is part of Catch-up TV & More.
-
- Catch-up TV & More is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- Catch-up TV & More is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY 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 Catch-up TV & More; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-"""
-
-import json
-from resources.lib import utils
-from resources.lib import common
-
-
-url_root = 'http://lab.canal-plus.pro/web/app_prod.php/api/replay/%s'
-# Channel id :
-# c8 : 1
-# cstar : 2
-
-url_shows = 'http://lab.canal-plus.pro/web/app_prod.php/api/pfv/list/%s/%s'
-# channel_id/show_id
-
-url_video = 'http://lab.canal-plus.pro/web/app_prod.php/api/pfv/video/%s/%s'
-# channel_id/video_id
-
-
-def get_channel_id(params):
- if params.channel_name == 'c8':
- return '1'
- elif params.channel_name == 'cstar':
- return '2'
- else:
- return '1'
-
-
-def channel_entry(params):
- if 'list_shows' in params.next:
- return list_shows(params)
- elif 'list_videos' in params.next:
- return list_videos(params)
- elif 'play' in params.next:
- return get_video_URL(params)
-
-
-@common.plugin.cached(common.cache_time)
-def list_shows(params):
- # Create categories list
- shows = []
-
- if params.next == 'list_shows_1':
- file_path = utils.download_catalog(
- url_root % get_channel_id(params),
- '%s.json' % (params.channel_name))
- file_categories = open(file_path).read()
- json_categories = json.loads(file_categories)
-
- for categories in json_categories:
- title = categories['title'].encode('utf-8')
- slug = categories['slug'].encode('utf-8')
-
- shows.append({
- 'label': title,
- 'url': common.plugin.get_url(
- action='channel_entry',
- slug=slug,
- next='list_shows_2',
- title=title,
- window_title=title
- )
- })
-
- return common.plugin.create_listing(
- shows,
- sort_methods=(
- common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
- common.sp.xbmcplugin.SORT_METHOD_LABEL
- )
- )
-
- elif params.next == 'list_shows_2':
- # Create category's programs list
- file_path = utils.download_catalog(
- url_root % get_channel_id(params),
- '%s_%s.json' % (params.channel_name, params.slug))
- file_categories = open(file_path).read()
- json_categories = json.loads(file_categories)
-
- for categories in json_categories:
- if categories['slug'].encode('utf-8') == params.slug:
- for programs in categories['programs']:
- id = str(programs['id'])
- title = programs['title'].encode('utf-8')
- slug = programs['slug'].encode('utf-8')
- videos_recent = str(programs['videos_recent'])
-
- shows.append({
- 'label': title,
- 'url': common.plugin.get_url(
- action='channel_entry',
- next='list_videos',
- id=id,
- videos_recent=videos_recent,
- slug=slug,
- title=title,
- window_title=title
- )
- })
-
- return common.plugin.create_listing(
- shows,
- sort_methods=(
- common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
- common.sp.xbmcplugin.SORT_METHOD_LABEL
- )
- )
-
-
-@common.plugin.cached(common.cache_time)
-def list_videos(params):
- videos = []
- file_path = utils.download_catalog(
- url_shows % (get_channel_id(params), params.videos_recent),
- '%s_%s.json' % (params.channel_name, params.videos_recent))
- file_videos = open(file_path).read()
- videos_json = json.loads(file_videos)
-
- for video in videos_json:
- id = video['ID'].encode('utf-8')
- try:
- duration = int(video['DURATION'].encode('utf-8'))
- except:
- duration = 0
- description = video['INFOS']['DESCRIPTION'].encode('utf-8')
- views = int(video['INFOS']['NB_VUES'].encode('utf-8'))
- try:
- date_video = video['INFOS']['DIFFUSION']['DATE'].encode('utf-8') # 31/12/2017
- except:
- date_video = "00/00/0000"
- day = date_video.split('/')[0]
- mounth = date_video.split('/')[1]
- year = date_video.split('/')[2]
- aired = '-'.join((day, mounth, year))
- date = date_video.replace('/', '.')
- title = video['INFOS']['TITRAGE']['TITRE'].encode('utf-8')
- subtitle = video['INFOS']['TITRAGE']['SOUS_TITRE'].encode('utf-8')
- thumb = video['MEDIA']['IMAGES']['GRAND'].encode('utf-8')
- category = video['RUBRIQUAGE']['CATEGORIE'].encode('utf-8')
-
- if subtitle:
- title = title + ' - [I]' + subtitle + '[/I]'
-
- info = {
- 'video': {
- 'title': title,
- 'plot': description,
- 'aired': aired,
- 'date': date,
- 'duration': duration,
- 'year': year,
- 'genre': category,
- 'playcount': views,
- 'mediatype': 'tvshow'
- }
- }
-
- videos.append({
- 'label': title,
- 'thumb': thumb,
- 'url': common.plugin.get_url(
- action='channel_entry',
- next='play',
- id=id,
- ),
- 'is_playable': True,
- 'info': info
- })
-
- return common.plugin.create_listing(
- videos,
- sort_methods=(
- common.sp.xbmcplugin.SORT_METHOD_DATE,
- common.sp.xbmcplugin.SORT_METHOD_DURATION,
- common.sp.xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE,
- common.sp.xbmcplugin.SORT_METHOD_GENRE,
- common.sp.xbmcplugin.SORT_METHOD_PLAYCOUNT,
- common.sp.xbmcplugin.SORT_METHOD_UNSORTED
- ),
- content='tvshows')
-
-
-@common.plugin.cached(common.cache_time)
-def get_video_URL(params):
- file_video = utils.get_webcontent(
- url_video % (get_channel_id(params), params.id)
- )
- video_json = json.loads(file_video)
- return video_json['main']['MEDIA']['VIDEOS']['HLS'].encode('utf-8')
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/fr/canalplus.py b/plugin.video.catchuptvandmore/resources/lib/channels/fr/canalplus.py
deleted file mode 100644
index d0e7dff..0000000
--- a/plugin.video.catchuptvandmore/resources/lib/channels/fr/canalplus.py
+++ /dev/null
@@ -1,407 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Catch-up TV & More
- Original work (C) JUL1EN094, SPM, SylvainCecchetto
- Copyright (C) 2016 SylvainCecchetto
-
- This file is part of Catch-up TV & More.
-
- Catch-up TV & More is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- Catch-up TV & More is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY 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 Catch-up TV & More; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-"""
-
-import json
-from resources.lib import utils
-from resources.lib import common
-import ast
-
-
-url_auth = 'http://service.mycanal.fr/authenticate.json/iphone/' \
- '1.6?highResolution=1&isActivated=0&isAuthenticated=0&paired=0'
-
-url_categories = 'http://service.mycanal.fr/page/%s/4578.json?' \
- 'cache=60000&nbContent=96'
-
-
-def channel_entry(params):
- if 'list_shows' in params.next:
- return list_shows(params)
- elif 'list_videos' in params.next:
- return list_videos(params)
- elif 'play' in params.next:
- return get_video_URL(params)
-
-
-def get_token():
- token_json = utils.get_webcontent(url_auth)
- token_json = json.loads(token_json)
- token = token_json['token']
- return token
-
-
-@common.plugin.cached(common.cache_time)
-def list_shows(params):
- shows = []
- if params.next == 'list_shows_1':
- if 'url_page' not in params:
- params.url_page = url_categories % get_token()
- if 'title' not in params:
- params.title = 'root'
- if 'fanart' in params:
- fanart = params.fanart
- else:
- fanart = ''
-
- file_path = utils.download_catalog(
- params.url_page,
- '%s_%s_%s.json' % (
- params.channel_name,
- params.title,
- common.sp.md5(params.url_page).hexdigest()))
- file_shows = open(file_path).read()
- shows_json = json.loads(file_shows)
- if 'strates' in shows_json:
- strates = shows_json['strates']
- if len(strates) == 1 and 'textList_like' not in params:
- params['title'] = strates[0]['title'].encode('utf-8')
- params['next'] = 'list_shows_2'
- return list_shows(params)
- elif len(strates) == 2 and 'textList_like' not in params:
- for strate in strates:
- if strate['type'].encode('utf-8') != 'carrousel':
- params['title'] = strate['title'].encode('utf-8')
- params['next'] = 'list_shows_2'
- return list_shows(params)
-
- for strate in strates:
- if strate['type'] == 'carrousel':
- for content in strate['contents']:
- fanart = content['URLImage'].encode('utf-8')
- # Main categories e.g. Séries, Humour, Sport
- if 'textList_like' in params and params.textList_like is True:
- if 'title' in strate and \
- strate['title'].encode('utf-8') == params.title:
- for content in strate['contents']:
- title = content['title'].encode('utf-8')
- url_page = content[
- 'onClick']['URLPage'].encode('utf-8')
- try:
- subtitle = content['subtitle'].encode('utf-8')
- except:
- subtitle = ''
- try:
- img = content['URLImage'].encode('utf-8')
- except:
- img = ''
-
- info = {
- 'video': {
- 'title': title,
- 'plot': subtitle,
- }
- }
-
- shows.append({
- 'label': title,
- 'thumb': img,
- 'url': common.plugin.get_url(
- action='channel_entry',
- url_page=url_page,
- next='list_shows_1',
- title=title,
- window_title=title,
- fanart=fanart
- ),
- 'info': info
- })
- else:
- if strate['type'] == 'textList':
- for content in strate['contents']:
- title = content['title'].encode('utf-8')
- url_page = content[
- 'onClick']['URLPage'].encode('utf-8')
- try:
- subtitle = content['subtitle'].encode('utf-8')
- except:
- subtitle = ''
- try:
- img = content['URLImage'].encode('utf-8')
- except:
- img = ''
-
- info = {
- 'video': {
- 'title': title,
- 'plot': subtitle,
- }
- }
-
- shows.append({
- 'label': title,
- 'thumb': img,
- 'url': common.plugin.get_url(
- action='channel_entry',
- url_page=url_page,
- next='list_shows_1',
- title=title,
- window_title=title,
- fanart=fanart
- ),
- 'info': info
- })
- # Videos, e.g. "Ne manquez pas"
- elif strate['type'] == 'contentGrid':
- title = strate['title'].encode('utf-8')
- shows.append({
- 'label': title,
- 'url': common.plugin.get_url(
- action='channel_entry',
- url_page=params.url_page,
- next='list_shows_2',
- title=title,
- window_title=title,
- )
- })
- # Other levels (subcategories, ...) e.g. "Top emissions"
- elif strate['type'] == 'contentRow':
- title = strate['title'].encode('utf-8')
- shows.append({
- 'label': title,
- 'url': common.plugin.get_url(
- action='channel_entry',
- url_page=params.url_page,
- next='list_shows_2',
- title=title,
- window_title=title,
- )
- })
- elif 'textList_like' not in params:
- for content in shows_json['contents']:
- title = content['title'].encode('utf-8')
- params['title'] = title
- params['next'] = 'list_shows_2'
- return list_shows(params)
-
- else:
- for content in shows_json['contents']:
- title = content['title'].encode('utf-8')
- url_page = content[
- 'onClick']['URLPage'].encode('utf-8')
- try:
- subtitle = content['subtitle'].encode('utf-8')
- except:
- subtitle = ''
- try:
- img = content['URLImage'].encode('utf-8')
- except:
- img = ''
-
- info = {
- 'video': {
- 'title': title,
- 'plot': subtitle,
- }
- }
-
- shows.append({
- 'label': title,
- 'thumb': img,
- 'url': common.plugin.get_url(
- action='channel_entry',
- url_page=url_page,
- next='list_shows_1',
- title=title,
- window_title=title,
- fanart=fanart
- ),
- 'info': info
- })
-
- return common.plugin.create_listing(
- shows,
- sort_methods=(
- common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
- common.sp.xbmcplugin.SORT_METHOD_LABEL
- )
- )
-
- elif params.next == 'list_shows_2':
- file_path = utils.download_catalog(
- params.url_page,
- '%s_%s_%s.json' % (
- params.channel_name,
- params.title,
- common.sp.md5(params.url_page).hexdigest()))
- file_shows = open(file_path).read()
- shows_json = json.loads(file_shows)
-
- if 'strates' in shows_json:
- strates = shows_json['strates']
- for strate in strates:
- if 'title' in strate and \
- strate['title'].encode('utf-8') == params.title:
- contents = strate['contents']
- else:
- contents = shows_json['contents']
- for content in contents:
- if 'type' in content and \
- content['type'].encode('utf-8') == 'quicktime':
- return list_videos(params)
- else:
- params['textList_like'] = True
- params['title'] = params.title
- params['next'] = 'list_shows_1'
- return list_shows(params)
-
-
-@common.plugin.cached(common.cache_time)
-def list_videos(params):
- videos = []
- if 'previous_listing' in params:
- videos = ast.literal_eval(params['previous_listing'])
- file_path = utils.download_catalog(
- params.url_page,
- '%s_%s_%s.json' % (
- params.channel_name,
- params.title,
- common.sp.md5(params.url_page).hexdigest()))
- file_videos = open(file_path).read()
- videos_json = json.loads(file_videos)
- more_videos = True
- fanart = ''
-
- if 'strates' in videos_json:
- for strate in videos_json['strates']:
- if strate['type'] == 'carrousel':
- for content in strate['contents']:
- fanart = content['URLImage'].encode('utf-8')
-
- # Check if we are in the correct cotegory
- if 'title' in strate and \
- strate['title'].encode('utf-8') == params.title:
-
- # If we have lot of videos ...
- if 'URLPage' in strate['paging']:
- url = strate['paging']['URLPage'].encode('utf-8')
- url = url + '&indexPage=1'
- params['url_page'] = url
- params['fanart'] = fanart
- return list_videos(params)
-
- # Else show only this videos
- else:
- for content in strate['contents']:
- title = content['title'].encode('utf-8')
- try:
- subtitle = content['subtitle'].encode('utf-8')
- except:
- subtitle = ''
- img = content['URLImage'].encode('utf-8')
- url_media = content['onClick']['URLPage'].encode('utf-8')
-
- info = {
- 'video': {
- 'title': title,
- 'plot': subtitle,
- 'mediatype': 'tvshow'
-
- }
- }
-
- videos.append({
- 'label': title,
- 'thumb': img,
- 'fanart': fanart,
- 'url': common.plugin.get_url(
- action='channel_entry',
- next='play',
- url_media=url_media,
- url_page=params.url_page,
- title=title
- ),
- 'info': info,
- 'is_playable': True
- })
- else:
- if len(videos_json['contents']) == 0:
- more_videos = False
- for content in videos_json['contents']:
- title = content['title'].encode('utf-8')
- try:
- subtitle = content['subtitle'].encode('utf-8')
- except:
- subtitle = ''
- img = content['URLImage'].encode('utf-8')
- url_media = content['onClick']['URLPage'].encode('utf-8')
-
- info = {
- 'video': {
- 'title': title,
- 'plot': subtitle,
- 'mediatype': 'tvshow'
-
- }
- }
-
- videos.append({
- 'label': title,
- 'thumb': img,
- 'fanart': params.fanart,
- 'url': common.plugin.get_url(
- action='channel_entry',
- next='play',
- url_media=url_media,
- title=title,
- fanart=params.fanart
- ),
- 'info': info,
- 'is_playable': True
- })
-
- if more_videos is True:
- # More videos...
- current_index_page = int(params.url_page[-1])
- videos.append({
- 'fanart': params.fanart,
- 'label': common.addon.get_localized_string(30100),
- 'url': common.plugin.get_url(
- action='channel_entry',
- next='list_videos',
- title=params.title,
- url_page=params.url_page[:-1] + str(
- current_index_page + 1),
- update_listing=True,
- previous_listing=str(videos),
- fanart=params.fanart
- ),
-
- })
-
- return common.plugin.create_listing(
- videos,
- content='tvshows',
- sort_methods=(
- common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
- common.sp.xbmcplugin.SORT_METHOD_LABEL
- ),
- update_listing='update_listing' in params
- )
-
-
-@common.plugin.cached(common.cache_time)
-def get_video_URL(params):
- file_path = utils.get_webcontent(params.url_media)
- media_json = json.loads(file_path)
- url = media_json['detail']['informations']['VoD']['videoURL'].encode('utf-8')
- return url
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/fr/france24.py b/plugin.video.catchuptvandmore/resources/lib/channels/fr/france24.py
new file mode 100755
index 0000000..6d61ec9
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/fr/france24.py
@@ -0,0 +1,294 @@
+# -*- coding: utf-8 -*-
+"""
+ Catch-up TV & More
+ Original work (C) JUL1EN094, SPM, SylvainCecchetto
+ Copyright (C) 2016 SylvainCecchetto
+
+ This file is part of Catch-up TV & More.
+
+ Catch-up TV & More is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Catch-up TV & More is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 Catch-up TV & More; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+import time
+import re
+import json
+from bs4 import BeautifulSoup as bs
+from resources.lib import utils
+from resources.lib import common
+
+# TO DO
+# Replay (emission) | (just 5 first episodes) Add More Button (with api) to download just some part ? (More Work TO DO)
+# Add info LIVE TV (picture, plot)
+# Add Video, Last JT, Last ECO, Last Meteo
+# Select Language settings not show
+
+# Initialize GNU gettext emulation in addon
+# This allows to use UI strings from addon’s English
+# strings.po file instead of numeric codes
+_ = common.ADDON.initialize_gettext()
+
+URL_LIVE_SITE = 'http://www.france24.com/%s/'
+# Language
+
+URL_INFO_LIVE = 'http://www.france24.com/%s/_fragment/player/nowplaying/'
+# Language
+
+URL_API_VOD = 'http://api.france24.com/%s/services/json-rpc/emission_list?databases=f24%s&key=XXX' \
+ '&start=0&limit=50&edition_start=0&edition_limit=5'
+# language
+
+def channel_entry(params):
+ """Entry function of the module"""
+ if 'root' in params.next:
+ return root(params)
+ elif 'list_shows' in params.next:
+ return list_shows(params)
+ elif 'list_videos' in params.next:
+ return list_videos(params)
+ elif 'live' in params.next:
+ return list_live(params)
+ elif 'play' in params.next:
+ return get_video_url(params)
+ return None
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def root(params):
+ """Add Replay and Live in the listing"""
+ modes = []
+
+ # Add Replay
+ modes.append({
+ 'label' : 'Replay',
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_shows_1',
+ category='%s Replay' % params.channel_name.upper(),
+ window_title='%s Replay' % params.channel_name.upper()
+ ),
+ })
+
+ # Add Live
+ modes.append({
+ 'label' : 'Live TV',
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='live_cat',
+ category='%s Live TV' % params.channel_name.upper(),
+ window_title='%s Live TV' % params.channel_name.upper()
+ ),
+ })
+
+ return common.PLUGIN.create_listing(
+ modes,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ ),
+ )
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def list_shows(params):
+ """Build shows listing"""
+ shows = []
+
+ desired_language = common.PLUGIN.get_setting(
+ params.channel_id + '.language')
+
+ if params.next == 'list_shows_1':
+ file_path = utils.download_catalog(
+ URL_API_VOD % (desired_language.lower(),desired_language.lower()),
+ '%s_%s_vod.json' % (params.channel_name,desired_language.lower())
+ )
+ json_vod = open(file_path).read()
+ json_parser = json.loads(json_vod)
+
+ list_caterories = json_parser["result"]["f24%s" % desired_language.lower()]["list"]
+ for category in list_caterories:
+
+ category_name = category["title"].encode('utf-8')
+ img = category["image"][0]["original"].encode('utf-8')
+ nid = category["nid"]
+ url = category["url"].encode('utf-8')
+
+ shows.append({
+ 'label': category_name,
+ 'fanart': img,
+ 'thumb': img,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_videos_cat',
+ nid=nid,
+ url=url,
+ window_title=category_name,
+ category_name=category_name,
+ )
+ })
+
+ return common.PLUGIN.create_listing(
+ shows,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ ),
+ )
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def list_videos(params):
+ """Build videos listing"""
+ videos = []
+
+ desired_language = common.PLUGIN.get_setting(
+ params.channel_id + '.language')
+
+ file_path = utils.download_catalog(
+ URL_API_VOD % (desired_language.lower(), desired_language.lower()),
+ '%s_%s_vod.json' % (params.channel_name, desired_language.lower())
+ )
+ json_vod = open(file_path).read()
+ json_parser = json.loads(json_vod)
+
+ list_caterories = json_parser["result"]["f24%s" % desired_language.lower()]["list"]
+ for category in list_caterories:
+ if str(params.nid) == str(category["nid"]):
+ for video in category["editions"]["list"]:
+
+ title = video["title"].encode('utf-8')
+ plot = video["intro"].encode('utf-8')
+ img = video["image"][0]["original"].encode('utf-8')
+ url = video["video"][0]["mp4-mbr"].encode('utf-8')
+
+ value_date = time.strftime('%d %m %Y', time.localtime(int(video["created"])))
+ date = str(value_date).split(' ')
+ day = date[0]
+ mounth = date[1]
+ year = date[2]
+ date = '.'.join((day, mounth, year))
+ aired = '-'.join((year, mounth, day))
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'aired': aired,
+ 'date': date,
+ #'duration': video_duration,
+ 'year': year,
+ 'plot' : plot,
+ 'mediatype': 'tvshow'
+ }
+ }
+
+ context_menu = []
+ download_video = (
+ _('Download'),
+ 'XBMC.RunPlugin(' + common.PLUGIN.get_url(
+ action='download_video',
+ url=url) + ')'
+ )
+ context_menu.append(download_video)
+
+ videos.append({
+ 'label': title,
+ 'thumb': img,
+ 'fanart': img,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_r',
+ url=url
+ ),
+ 'is_playable': True,
+ 'info': info,
+ 'context_menu': context_menu
+ })
+
+
+ # TO DO add More button Video
+
+ return common.PLUGIN.create_listing(
+ videos,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE
+ ),
+ content='tvshows')
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def list_live(params):
+ """Build live listing"""
+ lives = []
+
+ title = ''
+ plot = ''
+ duration = 0
+ img = ''
+ url_live = ''
+
+ desired_language = common.PLUGIN.get_setting(
+ params.channel_id + '.language')
+
+ url_live = URL_LIVE_SITE % desired_language.lower()
+
+ file_path = utils.download_catalog(
+ url_live,
+ '%s_%s_live.html' % (params.channel_name, desired_language.lower())
+ )
+ html_live = open(file_path).read()
+ root_soup = bs(html_live, 'html.parser')
+
+ json_parser = json.loads(root_soup.select_one("script[type=application/json]").text)
+ media_datas_list = json_parser['medias']['media']['media_sources']['media_source']
+ for datas in media_datas_list:
+ if datas['source']:
+ url_live = datas['source']
+
+ live_info = utils.get_webcontent(URL_INFO_LIVE % (desired_language.lower()))
+ title = re.compile('id="main-player-playing-value">(.+?)<').findall(live_info)[0]
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'plot': plot,
+ 'duration': duration
+ }
+ }
+
+ lives.append({
+ 'label': title,
+ 'fanart': img,
+ 'thumb': img,
+ 'url' : common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_l',
+ url=url_live,
+ ),
+ 'is_playable': True,
+ 'info': info
+ })
+
+ return common.PLUGIN.create_listing(
+ lives,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ )
+ )
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def get_video_url(params):
+ """Get video URL and start video player"""
+ if params.next == 'play_l':
+ return params.url
+ elif params.next == 'play_r' or params.next == 'download_video':
+ return params.url
+
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/fr/groupecanal.py b/plugin.video.catchuptvandmore/resources/lib/channels/fr/groupecanal.py
new file mode 100755
index 0000000..f2e5f84
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/fr/groupecanal.py
@@ -0,0 +1,699 @@
+# -*- coding: utf-8 -*-
+"""
+ Catch-up TV & More
+ Original work (C) JUL1EN094, SPM, SylvainCecchetto
+ Copyright (C) 2016 SylvainCecchetto
+
+ This file is part of Catch-up TV & More.
+
+ Catch-up TV & More is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Catch-up TV & More is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 Catch-up TV & More; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+import re
+import json
+import ast
+from bs4 import BeautifulSoup as bs
+from resources.lib import utils
+from resources.lib import common
+
+
+# TO DO
+# Replay (More Refactoring todo) / Find API for all channel (JSON) get Replay/Live ?
+# Get URL Live FROM SITE
+# QUALITY
+# Add Button "More Videos"
+
+# URL :
+
+URL_ROOT_SITE = 'http://www.%s.fr'
+# Channel
+
+# Live :
+URL_LIVE_CPLUS = 'http://www.canalplus.fr/pid3580-live-tv-clair.html'
+URL_LIVE_C8 = 'http://www.c8.fr/pid5323-c8-live.html'
+URL_LIVE_CSTAR = 'http://www.cstar.fr/pid5322-cstar-live.html'
+URL_LIVE_CNEWS = 'http://www.cnews.fr/direct'
+
+# Replay Cplus :
+URL_ROOT_CPLUS = 'http://www.canalplus.fr'
+
+URL_LIST_EMISSIONS_CPLUS = 'http://www.canalplus.fr/pid8034-les-emissions-de-canal.html'
+
+# Replay C8 & CStar
+URL_REPLAY_C8__CSTAR_ROOT = 'http://lab.canal-plus.pro/web/app_prod.php/api/replay/%s'
+# Channel id :
+# c8 : 1
+# cstar : 2
+URL_REPLAY_C8__CSTAR_SHOWS = 'http://lab.canal-plus.pro/web/app_prod.php/api/pfv/list/%s/%s'
+# channel_id/show_id
+
+# Replay CNews
+URL_VIDEOS_CNEWS = URL_ROOT_SITE + '/videos/'
+
+URL_EMISSIONS_CNEWS = URL_ROOT_SITE + '/emissions'
+
+# Replay/Live => Parameters Channel, VideoId
+URL_INFO_CONTENT = 'http://service.canal-plus.com/video/rest/getvideos/%s/%s?format=json'
+
+CHANNEL_NAME_CATALOG = {
+ 'cplus': 'cplus',
+ 'c8': 'd8',
+ 'cstar': 'd17',
+ 'cnews': 'itele'
+}
+
+# Initialize GNU gettext emulation in addon
+# This allows to use UI strings from addon’s English
+# strings.po file instead of numeric codes
+_ = common.ADDON.initialize_gettext()
+
+def channel_entry(params):
+ """Entry function of the module"""
+ if 'root' in params.next:
+ return root(params)
+ elif 'list_shows' in params.next:
+ return list_shows(params)
+ elif 'list_videos' in params.next:
+ return list_videos(params)
+ elif 'live' in params.next:
+ return list_live(params)
+ elif 'play' in params.next:
+ return get_video_url(params)
+ return None
+
+def get_token():
+ """Get session token"""
+ token_json = utils.get_webcontent(URL_REPLAY_CPLUS_AUTH)
+ token_json = json.loads(token_json)
+ token = token_json['token']
+ return token
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def get_channel_id(params):
+ """Get channel id by name"""
+ if params.channel_name == 'c8':
+ return '1'
+ elif params.channel_name == 'cstar':
+ return '2'
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def root(params):
+ """Add Replay and Live in the listing"""
+ modes = []
+
+ # Add Replay
+ modes.append({
+ 'label' : 'Replay',
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_shows_1',
+ category='%s Replay' % params.channel_name.upper(),
+ window_title='%s Replay' % params.channel_name.upper()
+ ),
+ })
+
+ # Add Live
+ modes.append({
+ 'label' : _('Live TV'),
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='live_cat',
+ category='%s Live TV' % params.channel_name.upper(),
+ window_title='%s Live TV' % params.channel_name.upper()
+ ),
+ })
+
+ return common.PLUGIN.create_listing(
+ modes,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ ),
+ )
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def list_shows(params):
+ """Create categories list"""
+ shows = []
+
+ ################### BEGIN CNEWS ###########################
+ if params.next == 'list_shows_1' and params.channel_name == 'cnews':
+
+ file_path = utils.download_catalog(
+ URL_VIDEOS_CNEWS % params.channel_name,
+ '%s_categories.html' % (
+ params.channel_name))
+ root_html = open(file_path).read()
+ root_soup = bs(root_html, 'html.parser')
+
+ menu_soup = root_soup.find('div', class_="nav-tabs-inner")
+
+ categories_soup = menu_soup.find_all('a')
+
+ for category in categories_soup:
+
+ category_name = category.get_text().encode('utf-8')
+ category_url = (URL_ROOT_SITE % params.channel_name) + category.get('href')
+
+ if category_name != 'Les tops':
+ shows.append({
+ 'label': category_name,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ category_url=category_url,
+ category_name=category_name,
+ next='list_shows_2',
+ window_title=category_name
+ )
+ })
+
+ elif params.next == 'list_shows_2' and params.channel_name == 'cnews':
+
+ if params.category_name == 'Les sujets':
+
+ file_path = utils.download_catalog(
+ params.category_url,
+ '%s_%s.html' % (
+ params.channel_name,params.category_name))
+ root_html = open(file_path).read()
+ root_soup = bs(root_html, 'html.parser')
+ categories_soup = root_soup.find_all('a', class_="checkbox")
+
+ for category in categories_soup:
+
+ category_name = category.get_text().encode('utf-8')
+ category_url = (URL_ROOT_SITE % params.channel_name) + category.get('href')
+
+ shows.append({
+ 'label': category_name,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ category_url=category_url,
+ page="1",
+ category_name=category_name,
+ next='list_videos',
+ window_title=category_name
+ )
+ })
+ else:
+ # Find all emissions
+ file_path = utils.download_catalog(
+ (URL_EMISSIONS_CNEWS % params.channel_name),
+ '%s_ALL_EMISSION.html' % (
+ params.channel_name))
+ root_html = open(file_path).read()
+ root_soup = bs(root_html, 'html.parser')
+
+ categories_soup = root_soup.find_all('article', class_="item")
+
+ for category in categories_soup:
+
+ category_name = category.find('h3').get_text().encode('utf-8')
+ category_url = (URL_VIDEOS_CNEWS % params.channel_name) + '/emissions' + category.find('a').get('href').split('.fr')[1]
+ category_img = category.find('img').get('src').encode('utf-8')
+
+ shows.append({
+ 'label': category_name,
+ 'thumb': category_img,
+ 'fanart': category_img,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ category_url=category_url,
+ page="1",
+ category_name=category_name,
+ next='list_videos',
+ window_title=category_name
+ )
+ })
+
+
+ ################### END CNEWS ###########################
+
+ ################### BEGIN C8 and CStar ##################
+ elif params.next == 'list_shows_1' and (params.channel_name == 'c8' or \
+ params.channel_name == 'cstar'):
+ file_path = utils.download_catalog(
+ URL_REPLAY_C8__CSTAR_ROOT % get_channel_id(params),
+ '%s.json' % (params.channel_name))
+ file_categories = open(file_path).read()
+ json_categories = json.loads(file_categories)
+
+ for categories in json_categories:
+ title = categories['title'].encode('utf-8')
+ slug = categories['slug'].encode('utf-8')
+
+ shows.append({
+ 'label': title,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ slug=slug,
+ next='list_shows_2',
+ title=title,
+ window_title=title
+ )
+ })
+
+ elif params.next == 'list_shows_2' and (params.channel_name == 'c8' or \
+ params.channel_name == 'cstar'):
+ # Create category's programs list
+ file_path = utils.download_catalog(
+ URL_REPLAY_C8__CSTAR_ROOT % get_channel_id(params),
+ '%s_%s.json' % (params.channel_name, params.slug))
+ file_categories = open(file_path).read()
+ json_categories = json.loads(file_categories)
+
+ for categories in json_categories:
+ if categories['slug'].encode('utf-8') == params.slug:
+ for programs in categories['programs']:
+ id = str(programs['id'])
+ title = programs['title'].encode('utf-8')
+ slug = programs['slug'].encode('utf-8')
+ videos_recent = str(programs['videos_recent'])
+
+ shows.append({
+ 'label': title,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_videos_cat',
+ id=id,
+ videos_recent=videos_recent,
+ slug=slug,
+ title=title,
+ window_title=title
+ )
+ })
+ ################### END C8 and CStar ##################
+
+ ################### BEGIN CANAL + ##################
+ elif params.next == 'list_shows_1' and params.channel_name == 'cplus':
+
+ file_path = utils.download_catalog(
+ URL_LIST_EMISSIONS_CPLUS,
+ '%s_categories.html' % (
+ params.channel_name))
+ root_html = open(file_path).read()
+ root_soup = bs(root_html, 'html.parser')
+
+ categories_soup = root_soup.find_all('div', class_='cell')
+
+ for category in categories_soup:
+
+ category_name = category.find('h6').get_text().encode('utf-8')
+ category_url = URL_ROOT_CPLUS + category.find('a').get('href')
+ category_img = category.find('img').get('src').encode('utf-8')
+
+ if category_name != 'Les tops':
+ shows.append({
+ 'label': category_name,
+ 'thumb': category_img,
+ 'fanart': category_img,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ category_url=category_url,
+ category_name=category_name,
+ next='list_shows_2',
+ window_title=category_name
+ )
+ })
+
+ elif params.next == 'list_shows_2' and params.channel_name == 'cplus':
+
+ file_path = utils.download_catalog(
+ params.category_url,
+ '%s_%s.html' % (
+ params.channel_name,params.category_name))
+ root_html = open(file_path).read()
+ root_soup = bs(root_html, 'html.parser')
+
+ sections_soup = root_soup.find('div', class_="listeRegroupee")
+
+ list_section = sections_soup.find_all('h2')
+ for section in list_section:
+ section = section.get_text().encode('utf-8')
+
+ shows.append({
+ 'label': section,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ category_url=params.category_url,
+ category_name=params.category_name,
+ category_section=section,
+ next='list_videos',
+ window_title=section
+ )
+ })
+
+ ################### END CANAL + ##################
+
+ return common.PLUGIN.create_listing(
+ shows,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ )
+ )
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def list_videos(params):
+ """Build videos listing"""
+ videos = []
+ if 'previous_listing' in params:
+ videos = ast.literal_eval(params['previous_listing'])
+
+ ################### BEGIN CNEWS ###########################
+ if params.channel_name == 'cnews':
+
+ url_page = params.category_url + '/page/%s' % params.page
+
+ file_path = utils.download_catalog(
+ url_page,
+ '%s_%s_%s.html' % (params.channel_name, params.category_name, params.page))
+ root_html = open(file_path).read()
+ root_soup = bs(root_html, 'html.parser')
+
+ programs = root_soup.find_all('article', class_='item')
+
+ for program in programs:
+ title = program.find('h3').get_text().encode('utf-8')
+ thumb = program.find('img').get('src').encode('utf-8')
+ #Get Video_ID
+ video_html = utils.get_webcontent(program.find('a').get('href').encode('utf-8'))
+ id = re.compile(r'videoId=(.*?)"').findall(video_html)[0]
+ #Get Description
+ datas_video = bs(video_html, 'html.parser')
+ description = datas_video.find('article', class_='entry-body').get_text().encode('utf-8')
+ duration = 0
+
+ date = re.compile(r'property="video:release_date" content="(.*?)"').findall(video_html)[0].split('T')[0].split('-')
+ day = date[2]
+ mounth = date[1]
+ year = date[0]
+
+ date = '.'.join((day, mounth, year))
+ aired = '-'.join((year, mounth, day))
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'plot': description,
+ 'aired': aired,
+ 'date': date,
+ 'duration': duration,
+ 'year': year,
+ #'genre': category,
+ 'mediatype': 'tvshow'
+ }
+ }
+
+ context_menu = []
+ download_video = (
+ _('Download'),
+ 'XBMC.RunPlugin(' + common.PLUGIN.get_url(
+ action='download_video',
+ id=id) + ')'
+ )
+ context_menu.append(download_video)
+
+ videos.append({
+ 'label': title,
+ 'thumb': thumb,
+ 'fanart': thumb,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_r',
+ id=id
+ ),
+ 'is_playable': True,
+ 'info': info,
+ 'context_menu': context_menu
+ })
+
+ # More videos...
+ videos.append({
+ 'label': common.ADDON.get_localized_string(30100),
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ category_url=params.category_url,
+ category_name=params.category_name,
+ next='list_videos',
+ page=str(int(params.page) + 1),
+ update_listing=True,
+ previous_listing=str(videos)
+ ),
+ })
+ ################### END CNEWS ###########################
+
+ ################### BEGIN C8 and CStar ##################
+ elif params.channel_name == 'c8' or params.channel_name == 'cstar':
+ file_path = utils.download_catalog(
+ URL_REPLAY_C8__CSTAR_SHOWS % (get_channel_id(params), params.videos_recent),
+ '%s_%s.json' % (params.channel_name, params.videos_recent))
+ file_videos = open(file_path).read()
+ videos_json = json.loads(file_videos)
+
+ for video in videos_json:
+ id = video['ID'].encode('utf-8')
+ try:
+ duration = int(video['DURATION'].encode('utf-8'))
+ except:
+ duration = 0
+ description = video['INFOS']['DESCRIPTION'].encode('utf-8')
+ views = int(video['INFOS']['NB_VUES'].encode('utf-8'))
+ try:
+ date_video = video['INFOS']['DIFFUSION']['DATE'].encode('utf-8') # 31/12/2017
+ except:
+ date_video = "00/00/0000"
+ day = date_video.split('/')[0]
+ mounth = date_video.split('/')[1]
+ year = date_video.split('/')[2]
+ aired = '-'.join((day, mounth, year))
+ date = date_video.replace('/', '.')
+ title = video['INFOS']['TITRAGE']['TITRE'].encode('utf-8')
+ subtitle = video['INFOS']['TITRAGE']['SOUS_TITRE'].encode('utf-8')
+ thumb = video['MEDIA']['IMAGES']['GRAND'].encode('utf-8')
+ category = video['RUBRIQUAGE']['CATEGORIE'].encode('utf-8')
+
+ if subtitle:
+ title = title + ' - [I]' + subtitle + '[/I]'
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'plot': description,
+ 'aired': aired,
+ 'date': date,
+ 'duration': duration,
+ 'year': year,
+ 'genre': category,
+ 'playcount': views,
+ 'mediatype': 'tvshow'
+ }
+ }
+
+ context_menu = []
+ download_video = (
+ _('Download'),
+ 'XBMC.RunPlugin(' + common.PLUGIN.get_url(
+ action='download_video',
+ id=id) + ')'
+ )
+ context_menu.append(download_video)
+
+ videos.append({
+ 'label': title,
+ 'thumb': thumb,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_r',
+ id=id,
+ ),
+ 'is_playable': True,
+ 'info': info,
+ 'context_menu': context_menu
+ })
+ ################### END C8 and CStar ##################
+
+ ################### BEGIN Canal + ##################
+ elif params.channel_name == 'cplus':
+
+ file_path = utils.download_catalog(
+ params.category_url,
+ '%s_%s_%s.html' % (params.channel_name, params.category_name, params.category_section))
+ root_html = open(file_path).read()
+ root_soup = bs(root_html, 'html.parser')
+
+ sections_soup = root_soup.find('div', class_="listeRegroupee")
+
+ i = 0
+ j = 0
+ list_sections = sections_soup.find_all('h2')
+ for section in list_sections:
+ i = i + 1
+ if section.get_text().encode('utf-8') == params.category_section:
+ break
+
+ videos_sections_soup = sections_soup.find_all('ul', class_="features features-alt features-alt-videov3-4x3 features-alt-videov3-4x3-noMarge")
+ for videos_section in videos_sections_soup:
+ j = j + 1
+ if i == j:
+ data_videos = videos_section.find_all('li')
+
+ for data_video in data_videos:
+
+ title = data_video.find('h4').get('title').encode('utf-8')
+ description = data_video.find('p').find('a').get_text().strip().encode('utf-8')
+ duration = 0
+ thumb = data_video.find('img').get('src').encode('utf-8')
+ id = data_video.get('id').split('_')[1]
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'plot': description,
+ #'aired': aired,
+ #'date': date,
+ 'duration': duration,
+ #'year': year,
+ #'genre': category,
+ 'mediatype': 'tvshow'
+ }
+ }
+
+ context_menu = []
+ download_video = (
+ _('Download'),
+ 'XBMC.RunPlugin(' + common.PLUGIN.get_url(
+ action='download_video',
+ id=id) + ')'
+ )
+ context_menu.append(download_video)
+
+ videos.append({
+ 'label': title,
+ 'thumb': thumb,
+ 'fanart': thumb,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_r',
+ id=id
+ ),
+ 'is_playable': True,
+ 'info': info,
+ 'context_menu': context_menu
+ })
+
+ ################### END Canal + ##################
+
+ return common.PLUGIN.create_listing(
+ videos,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_DATE,
+ common.sp.xbmcplugin.SORT_METHOD_DURATION,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE,
+ common.sp.xbmcplugin.SORT_METHOD_GENRE,
+ common.sp.xbmcplugin.SORT_METHOD_PLAYCOUNT,
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED
+ ),
+ content='tvshows',
+ update_listing='update_listing' in params,
+ )
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def list_live(params):
+ """Build live listing"""
+ lives = []
+
+ title = ''
+ plot = ''
+ duration = 0
+ img = ''
+ url_live = ''
+
+ url_live_html = ''
+ if params.channel_name == 'cplus':
+ url_live_html = URL_LIVE_CPLUS
+ elif params.channel_name == 'c8':
+ url_live_html = URL_LIVE_C8
+ elif params.channel_name == 'cstar':
+ url_live_html = URL_LIVE_CSTAR
+ elif params.channel_name == 'cnews':
+ url_live_html = URL_LIVE_CNEWS
+
+ file_path_html = utils.download_catalog(
+ url_live_html,
+ '%s_live.html' % (params.channel_name)
+ )
+ html_live = open(file_path_html).read()
+
+ video_id_re = ''
+
+ if params.channel_name == 'cnews':
+ video_id_re = re.compile(r'content: \'(.*?)\'').findall(html_live)
+ else :
+ video_id_re = re.compile(r'\bdata-video="(?P<video_id>[0-9]+)"').findall(html_live)
+
+ file_path_json = utils.download_catalog(
+ URL_INFO_CONTENT % (CHANNEL_NAME_CATALOG[params.channel_name], video_id_re[0]),
+ '%s_%s_live.json' % (CHANNEL_NAME_CATALOG[params.channel_name], video_id_re[0])
+ )
+ file_live_json = open(file_path_json).read()
+ json_parser = json.loads(file_live_json)
+
+ title = json_parser["INFOS"]["TITRAGE"]["TITRE"].encode('utf-8')
+ plot = json_parser["INFOS"]["DESCRIPTION"].encode('utf-8')
+ img = json_parser["MEDIA"]["IMAGES"]["GRAND"].encode('utf-8')
+ url_live = json_parser["MEDIA"]["VIDEOS"]["IPAD"].encode('utf-8')
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'plot': plot,
+ 'duration': duration
+ }
+ }
+
+ lives.append({
+ 'label': title,
+ 'fanart': img,
+ 'thumb': img,
+ 'url' : common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_l',
+ url=url_live,
+ ),
+ 'is_playable': True,
+ 'info': info
+ })
+
+ return common.PLUGIN.create_listing(
+ lives,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ )
+ )
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def get_video_url(params):
+ """Get video URL and start video player"""
+ if params.next == 'play_r' or params.next == 'download_video':
+ file_video = utils.get_webcontent(
+ URL_INFO_CONTENT % (CHANNEL_NAME_CATALOG[params.channel_name],params.id)
+ )
+ media_json = json.loads(file_video)
+ return media_json['MEDIA']['VIDEOS']['HLS'].encode('utf-8')
+ # Live CPlus, C8, CStar and CNews
+ elif params.next == 'play_l':
+ return params.url
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/fr/gulli.py b/plugin.video.catchuptvandmore/resources/lib/channels/fr/gulli.py
index ac6986d..79dedad 100644..100755
--- a/plugin.video.catchuptvandmore/resources/lib/channels/fr/gulli.py
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/fr/gulli.py
@@ -20,72 +20,125 @@
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""
+import re
import json
+import time
+from bs4 import BeautifulSoup as bs
from resources.lib import utils
from resources.lib import common
-import time
+# TO DO
+# Improve Live TV (Title, picture, plot)
-def channel_entry(params):
- if 'list_shows' in params.next:
- return list_shows(params)
- elif 'list_videos' in params.next:
- return list_videos(params)
- elif 'play' in params.next:
- return get_video_URL(params)
+# Initialize GNU gettext emulation in addon
+# This allows to use UI strings from addon’s English
+# strings.po file instead of numeric codes
+_ = common.ADDON.initialize_gettext()
+SECRET_KEY = '19nBVBxv791Xs'
-secret_key = '19nBVBxv791Xs'
-
-
-def get_api_key():
- date = time.strftime("%Y%m%d")
- key = secret_key + date
- key = common.sp.md5(key).hexdigest()
- return 'iphoner_' + key
+CATEGORIES = {}
-
-categories = {}
-
-categories['Dessins animés'] = 'http://sslreplay.gulli.fr/replay/api?' \
+CATEGORIES['Dessins animés'] = 'http://sslreplay.gulli.fr/replay/api?' \
'call=%%7B%%22api_key%%22:%%22%s%%22,%%22method' \
'%%22:%%22programme.getLatestEpisodes%%22,%%' \
'22params%%22:%%7B%%22program_image_thumb%%' \
'22:%%5B310,230%%5D,%%22category_id%%22:%%22' \
'dessins-animes%%22%%7D%%7D'
-categories['Émissions'] = 'https://sslreplay.gulli.fr/replay/api?' \
+CATEGORIES['Émissions'] = 'https://sslreplay.gulli.fr/replay/api?' \
'call=%%7B%%22api_key%%22:%%22%s%%22,%%22method' \
'%%22:%%22programme.getLatestEpisodes%%22,%%' \
'22params%%22:%%7B%%22program_image_thumb%%' \
'22:%%5B310,230%%5D,%%22category_id%%22:%%22' \
'emissions%%22%%7D%%7D'
-categories['Séries & films'] = 'https://sslreplay.gulli.fr/replay/api?' \
+CATEGORIES['Séries & films'] = 'https://sslreplay.gulli.fr/replay/api?' \
'call=%%7B%%22api_key%%22:%%22%s%%22,%%22method' \
'%%22:%%22programme.getLatestEpisodes%%22,%%' \
'22params%%22:%%7B%%22program_image_thumb%%' \
'22:%%5B310,230%%5D,%%22category_id%%22:%%22' \
'series%%22%%7D%%7D'
-url_list_show = 'https://sslreplay.gulli.fr/replay/api?call=%%7B%%22api_key' \
+URL_LIST_SHOW = 'https://sslreplay.gulli.fr/replay/api?call=%%7B%%22api_key' \
'%%22:%%22%s%%22,%%22' \
'method%%22:%%22programme.getEpisodesByProgramIds%%22,%%22' \
'params%%22:%%7B%%22program_id_list%%22:%%5B%%22%s%%22%%5D' \
'%%7D%%7D'
+
+URL_LIVE_TV = 'http://replay.gulli.fr/Direct'
+
# program_id
+def channel_entry(params):
+ """Entry function of the module"""
+ if 'root' in params.next:
+ return root(params)
+ elif 'list_shows' in params.next:
+ return list_shows(params)
+ elif 'list_videos' in params.next:
+ return list_videos(params)
+ elif 'live' in params.next:
+ return list_live(params)
+ elif 'play' in params.next:
+ return get_video_url(params)
+ return None
+
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def get_api_key():
+ """Compute the API key"""
+ date = time.strftime("%Y%m%d")
+ key = SECRET_KEY + date
+ key = common.sp.md5(key).hexdigest()
+ return 'iphoner_' + key
+
-@common.plugin.cached(common.cache_time)
+@common.PLUGIN.cached(common.CACHE_TIME)
+def root(params):
+ """Add Replay and Live in the listing"""
+ modes = []
+
+ # Add Replay
+ modes.append({
+ 'label' : 'Replay',
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_shows_1',
+ category='%s Replay' % params.channel_name.upper(),
+ window_title='%s Replay' % params.channel_name.upper()
+ ),
+ })
+
+ # Add Live
+ modes.append({
+ 'label' : 'Live TV',
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='live_cat',
+ category='%s Live TV' % params.channel_name.upper(),
+ window_title='%s Live TV' % params.channel_name.upper()
+ ),
+ })
+
+ return common.PLUGIN.create_listing(
+ modes,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ ),
+ )
+
+@common.PLUGIN.cached(common.CACHE_TIME)
def list_shows(params):
- # Create categories list
+ """Build categories listing"""
shows = []
if params.next == 'list_shows_1':
- for category_title, category_url in categories.iteritems():
+ for category_title, category_url in CATEGORIES.iteritems():
shows.append({
'label': category_title,
- 'url': common.plugin.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
category_url=category_url % get_api_key(),
next='list_shows_cat',
@@ -94,7 +147,7 @@ def list_shows(params):
)
})
- return common.plugin.create_listing(
+ return common.PLUGIN.create_listing(
shows,
sort_methods=(
common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
@@ -119,7 +172,7 @@ def list_shows(params):
'label': program_title,
'thumb': fanart,
'fanart': fanart,
- 'url': common.plugin.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
program_id=program_id,
next='list_videos',
@@ -128,7 +181,7 @@ def list_shows(params):
)
})
- return common.plugin.create_listing(
+ return common.PLUGIN.create_listing(
shows,
sort_methods=(
common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
@@ -137,12 +190,13 @@ def list_shows(params):
)
-@common.plugin.cached(common.cache_time)
+@common.PLUGIN.cached(common.CACHE_TIME)
def list_videos(params):
+ """Build videos listing"""
videos = []
file_path = utils.download_catalog(
- url_list_show % (get_api_key(), params.program_id),
+ URL_LIST_SHOW % (get_api_key(), params.program_id),
'%s_%s.json' % (params.channel_name, params.program_id))
file = open(file_path).read()
json_show = json.loads(file)
@@ -185,20 +239,30 @@ def list_videos(params):
}
}
+ context_menu = []
+ download_video = (
+ _('Download'),
+ 'XBMC.RunPlugin(' + common.PLUGIN.get_url(
+ action='download_video',
+ url_streaming=url_streaming) + ')'
+ )
+ context_menu.append(download_video)
+
videos.append({
'label': episode_title,
'thumb': thumb,
'fanart': fanart,
- 'url': common.plugin.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
- next='play',
+ next='play_r',
url_streaming=url_streaming
),
'is_playable': True,
- 'info': info
+ 'info': info,
+ 'context_menu': context_menu
})
- return common.plugin.create_listing(
+ return common.PLUGIN.create_listing(
videos,
sort_methods=(
common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
@@ -208,14 +272,87 @@ def list_videos(params):
content='tvshows')
-@common.plugin.cached(common.cache_time)
-def get_video_URL(params):
- url_root = params.url_streaming.replace('playlist.m3u8', '')
- m3u8_content = utils.get_webcontent(params.url_streaming)
- last_url = ''
+@common.PLUGIN.cached(common.CACHE_TIME)
+def list_live(params):
+ """Build live listing"""
+ lives = []
+
+ title = ''
+ plot = ''
+ duration = 0
+ img = ''
+ url_live = ''
+
+ file_path = utils.download_catalog(
+ URL_LIVE_TV,
+ params.channel_name + '_live.html')
+ root_live_html = open(file_path).read()
+ root_live_soup = bs(root_live_html, 'html.parser')
+
+ live_soup = root_live_soup.find(
+ 'div',
+ class_='wrapperVideo'
+ )
+
+ url_live_embeded = ''
+ for live in live_soup.find_all('iframe'):
+ url_live_embeded = live.get('src').encode('utf-8')
+
+ file_path_2 = utils.download_catalog(
+ url_live_embeded,
+ params.channel_name + '_live_embeded.html')
+ root_live_embeded_html = open(file_path_2).read()
+
+ all_url_video = re.compile(r'file: \'(.*?)\'').findall(root_live_embeded_html)
+
+ for url_video in all_url_video:
+ if url_video.count('m3u8') > 0:
+ url_live = url_video
+
+ title = '%s Live' % params.channel_name.upper()
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'plot': plot,
+ 'duration': duration
+ }
+ }
+
+ lives.append({
+ 'label': title,
+ 'fanart': img,
+ 'thumb': img,
+ 'url' : common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_l',
+ url_live=url_live,
+ ),
+ 'is_playable': True,
+ 'info': info
+ })
+
+ return common.PLUGIN.create_listing(
+ lives,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ )
+ )
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def get_video_url(params):
+ """Get video URL and start video player"""
+ if params.next == 'play_r' or params.next == 'download_video':
+ url_root = params.url_streaming.replace('playlist.m3u8', '')
+ m3u8_content = utils.get_webcontent(params.url_streaming)
+ last_url = ''
+
+ for line in m3u8_content.splitlines():
+ if 'm3u8' in line and 'video' in line:
+ last_url = line
- for line in m3u8_content.splitlines():
- if 'm3u8' in line and 'video' in line:
- last_url = line
+ return url_root + last_url
- return url_root + last_url
+ elif params.next == 'play_l':
+ return params.url_live
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/fr/itele.py b/plugin.video.catchuptvandmore/resources/lib/channels/fr/itele.py
deleted file mode 100644
index 3b32c65..0000000
--- a/plugin.video.catchuptvandmore/resources/lib/channels/fr/itele.py
+++ /dev/null
@@ -1,208 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- Catch-up TV & More
- Copyright (C) 2017 SylvainCecchetto
-
- This file is part of Catch-up TV & More.
-
- Catch-up TV & More is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- Catch-up TV & More is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY 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 Catch-up TV & More; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-"""
-
-import json
-from resources.lib import utils
-from resources.lib import common
-
-
-def channel_entry(params):
- if 'list_shows' in params.next:
- return list_shows(params)
- elif 'list_videos' in params.next:
- return list_videos(params)
- elif 'play' in params.next:
- return get_video_URL(params)
-
-
-url_category_query = 'http://service.itele.fr/iphone/categorie_news?query='
-
-
-categories = {
- 'http://service.itele.fr/iphone/topnews': 'La Une',
- url_category_query + 'FRANCE': 'France',
- url_category_query + 'MONDE': 'Monde',
- url_category_query + 'POLITIQUE': 'Politique',
- url_category_query + 'JUSTICE': 'Justice',
- url_category_query + 'ECONOMIE': 'Économie',
- url_category_query + 'SPORT': 'Sport',
- url_category_query + 'CULTURE': 'Culture',
- url_category_query + 'INSOLITE': 'Insolite'
-}
-
-
-@common.plugin.cached(common.cache_time)
-def list_shows(params):
- # Create categories list
- shows = []
-
- if params.next == 'list_shows_1':
- for category_url, category_title in categories.iteritems():
- shows.append({
- 'label': category_title,
- 'url': common.plugin.get_url(
- action='channel_entry',
- category_url=category_url,
- next='list_videos_cat',
- title=category_title,
- window_title=category_title
- )
- })
-
- shows.append({
- 'label': 'Les Émissions',
- 'url': common.plugin.get_url(
- action='channel_entry',
- category_url='emissions',
- next='list_shows_emissions',
- title='Les Émissions',
- window_title='Les Émissions'
- )
- })
-
- return common.plugin.create_listing(
- shows,
- sort_methods=(
- common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
- common.sp.xbmcplugin.SORT_METHOD_LABEL
- )
- )
-
- elif params.next == 'list_shows_emissions':
- shows.append({
- 'label': 'À la Une',
- 'url': common.plugin.get_url(
- action='channel_entry',
- category_url='http://service.itele.fr/iphone/dernieres_emissions?query=',
- next='list_videos_cat',
- title='À la Une',
- window_title='À la Une'
- )
- })
-
- shows.append({
- 'label': 'Magazines',
- 'url': common.plugin.get_url(
- action='channel_entry',
- category_url='http://service.itele.fr/iphone/emissions?query=magazines',
- next='list_videos_cat',
- title='Magazines',
- window_title='Magazines'
- )
- })
-
- shows.append({
- 'label': 'Chroniques',
- 'url': common.plugin.get_url(
- action='channel_entry',
- category_url='http://service.itele.fr/iphone/emissions?query=chroniques',
- next='list_videos_cat',
- title='Chroniques',
- window_title='Chroniques'
- )
- })
-
- return common.plugin.create_listing(
- shows,
- sort_methods=(
- common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
- common.sp.xbmcplugin.SORT_METHOD_LABEL
- )
- )
-
-
-@common.plugin.cached(common.cache_time)
-def list_videos(params):
- videos = []
- if params.next == 'list_videos_cat':
- file_path = utils.download_catalog(
- params.category_url,
- '%s_%s.json' % (params.channel_name, params.title))
- file = open(file_path).read()
- json_category = json.loads(file)
-
- if 'news' in json_category:
- json_category = json_category['news']
- elif 'videos' in json_category:
- json_category = json_category['videos']
- elif 'topnews' in json_category:
- json_category = json_category['topnews']
- for video in json_category:
- video_id = video['id_pfv'].encode('utf-8')
- category = video['category'].encode('utf-8')
- date_time = video['date'].encode('utf-8')
- # 2017-02-10 22:05:02
- date_time = date_time.split(' ')[0]
- date_splited = date_time.split('-')
- year = date_splited[0]
- mounth = date_splited[1]
- day = date_splited[2]
- aired = '-'.join((year, mounth, day))
- date = '.'.join((day, mounth, year))
- # date : string (%d.%m.%Y / 01.01.2009)
- # aired : string (2008-12-07)
- title = video['title'].encode('utf-8')
- description = video['description'].encode('utf-8')
- thumb = video['preview169'].encode('utf-8')
- video_url = video['video_urlhd'].encode('utf-8')
- if not video_url:
- video_url = 'no_video'
-
- info = {
- 'video': {
- 'title': title,
- 'plot': description,
- 'aired': aired,
- 'date': date,
- #'duration': duration,
- 'year': year,
- 'genre': category,
- 'mediatype': 'tvshow'
- }
- }
-
- videos.append({
- 'label': title,
- 'thumb': thumb,
- 'url': common.plugin.get_url(
- action='channel_entry',
- next='play',
- video_id=video_id,
- video_urlhd=video_url
- ),
- 'is_playable': True,
- 'info': info
- })
-
- return common.plugin.create_listing(
- videos,
- sort_methods=(
- common.sp.xbmcplugin.SORT_METHOD_DATE,
- common.sp.xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE,
- common.sp.xbmcplugin.SORT_METHOD_GENRE,
- common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
- ),
- content='tvshows')
-
-
-def get_video_URL(params):
- return params.video_urlhd
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/fr/lcp.py b/plugin.video.catchuptvandmore/resources/lib/channels/fr/lcp.py
new file mode 100755
index 0000000..e1065d9
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/fr/lcp.py
@@ -0,0 +1,594 @@
+# -*- coding: utf-8 -*-
+"""
+ Catch-up TV & More
+ Original work (C) JUL1EN094, SPM, SylvainCecchetto
+ Copyright (C) 2016 SylvainCecchetto
+
+ This file is part of Catch-up TV & More.
+
+ Catch-up TV & More is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Catch-up TV & More is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 Catch-up TV & More; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+import re
+import ast
+import json
+from bs4 import BeautifulSoup as bs
+from resources.lib import utils
+from resources.lib import common
+
+# TO DO
+# Use some API to simplify
+# Add info LIVE TV
+
+# LCP contient deux sources de video pour les replays
+# New : play1.qbrick.com
+# Old : www.dailymotion.com
+
+# Initialize GNU gettext emulation in addon
+# This allows to use UI strings from addon’s English
+# strings.po file instead of numeric codes
+_ = common.ADDON.initialize_gettext()
+
+URL_ROOT = 'http://www.lcp.fr'
+
+URL_LIVE_SITE = 'http://www.lcp.fr/le-direct'
+
+URL_DAILYMOTION_EMBED = 'http://www.dailymotion.com/embed/video/%s'
+
+URL_VIDEO_REPLAY = 'http://play1.qbrick.com/config/avp/v1/player/media/%s/darkmatter/%s/'
+#VideoID, AccountId
+
+def channel_entry(params):
+ """Entry function of the module"""
+ if 'root' in params.next:
+ return root(params)
+ elif 'list_shows' in params.next:
+ return list_shows(params)
+ elif 'list_videos' in params.next:
+ return list_videos(params)
+ elif 'live' in params.next:
+ return list_live(params)
+ elif 'play' in params.next:
+ return get_video_url(params)
+
+CATEGORIES = {
+ 'http://www.lcp.fr/actualites' : 'Actualités',
+ 'http://www.lcp.fr/emissions' : 'Émissions',
+ 'http://www.lcp.fr/documentaires' : 'Documentaires'
+}
+
+CORRECT_MOUNTH = {
+ 'janvier' : '01',
+ 'février' : '02',
+ 'mars' : '03',
+ 'avril' : '04',
+ 'mai' : '05',
+ 'juin' : '06',
+ 'juillet' : '07',
+ 'août' : '08',
+ 'septembre' : '09',
+ 'octobre' : '10',
+ 'novembre' : '11',
+ 'décembre' : '12'
+}
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def root(params):
+ """Add Replay and Live in the listing"""
+ modes = []
+
+ # Add Replay Desactiver
+ modes.append({
+ 'label' : 'Replay',
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_shows_1',
+ category='%s Replay' % params.channel_name.upper(),
+ window_title='%s Replay' % params.channel_name.upper()
+ ),
+ })
+
+ # Add Live
+ modes.append({
+ 'label' : 'Live TV',
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='live_cat',
+ category='%s Live TV' % params.channel_name.upper(),
+ window_title='%s Live TV' % params.channel_name.upper()
+ ),
+ })
+
+ return common.PLUGIN.create_listing(
+ modes,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ ),
+ )
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def list_shows(params):
+ """Build shows listing"""
+ shows = []
+
+ if params.next == 'list_shows_1':
+
+ for category_url, category_name in CATEGORIES.iteritems():
+
+ if category_name == 'Émissions':
+ shows.append({
+ 'label': category_name,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ category_url=category_url,
+ category_name=category_name,
+ next='list_shows_2',
+ window_title=category_name
+ )
+ })
+ elif category_name == 'Actualités':
+ shows.append({
+ 'label': category_name,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ actualites_url=category_url,
+ actualites_name=category_name,
+ page='0',
+ next='list_videos_actualites',
+ window_title=category_name
+ )
+ })
+ elif category_name == 'Documentaires':
+ shows.append({
+ 'label': category_name,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ documentaires_url=category_url,
+ documentaires_name=category_name,
+ page='0',
+ next='list_videos_documentaires',
+ window_title=category_name
+ )
+ })
+
+ elif params.next == 'list_shows_2':
+
+ file_path = utils.download_catalog(
+ params.category_url,
+ '%s_%s.html' % (
+ params.channel_name,
+ params.category_name))
+ root_html = open(file_path).read()
+ root_soup = bs(root_html, 'html.parser')
+
+ emissions_soup = root_soup.find_all('div',class_='content')
+
+ for emission in emissions_soup:
+
+ emission_name = emission.find('h2').get_text().encode('utf-8')
+ emission_img = emission.find('img')['src'].encode('utf-8')
+ emission_url = URL_ROOT + emission.find('a')['href'].encode('utf-8')
+
+ shows.append({
+ 'label': emission_name,
+ 'thumb': emission_img,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ emission_url=emission_url,
+ emission_name=emission_name,
+ page='0',
+ next='list_videos_emissions',
+ window_title=emission_name
+ )
+ })
+
+ return common.PLUGIN.create_listing(
+ shows,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ )
+ )
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def list_videos(params):
+ """Build videos listing"""
+ videos = []
+
+ if 'previous_listing' in params:
+ videos = ast.literal_eval(params['previous_listing'])
+
+ if params.next == 'list_videos_documentaires':
+
+ if params.page == 0:
+ url = params.documentaires_url
+ else:
+ url = params.documentaires_url + '?page=' + str(params.page)
+
+ file_path = utils.download_catalog(
+ url,
+ '%s_%s_%s.html' % (
+ params.channel_name,
+ params.documentaires_name,
+ params.page))
+ root_html = open(file_path).read()
+ root_soup = bs(root_html, 'html.parser')
+
+ video_soup = root_soup.find_all('div', class_="node node-lcp-tv-episode node-teaser clearfix")
+
+ for video in video_soup:
+
+ title = video.find('h2').find('a').get_text().encode('utf-8')
+ value_date = video.find('div', class_="content").find('span', class_="date").get_text().encode('utf-8')
+ date = value_date.split(' ')
+ day = date[0]
+ try:
+ mounth = CORRECT_MOUNTH[date[1]]
+ except:
+ mounth = '00'
+ year = date[2]
+
+ date = '.'.join((day, mounth, year))
+ aired = '-'.join((year, mounth, day))
+ duration = 0
+ duration = int(video.find('div', class_="content").find('div', class_="duration").find('div').find('span').get_text()) * 60
+ img = video.find('a').find('img')['src'].encode('utf-8')
+ url_video = URL_ROOT + video['about'].encode('utf-8')
+
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'aired': aired,
+ 'date': date,
+ 'duration': duration,
+ 'year': year,
+ 'mediatype': 'tvshow'
+ }
+ }
+
+ # Nouveau pour ajouter le menu pour télécharger la vidéo
+ context_menu = []
+ download_video = (
+ _('Download'),
+ 'XBMC.RunPlugin(' + common.PLUGIN.get_url(
+ action='download_video',
+ url_video=url_video) + ')'
+ )
+ context_menu.append(download_video)
+ # Fin
+
+ videos.append({
+ 'label': title,
+ 'thumb': img,
+ 'fanart': img,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_r',
+ url_video=url_video
+ ),
+ 'is_playable': True,
+ 'info': info,
+ 'context_menu': context_menu # A ne pas oublier pour ajouter le bouton "Download" à chaque vidéo
+ })
+
+ # More videos...
+ videos.append({
+ 'label': common.ADDON.get_localized_string(30100),
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ documentaires_url=params.documentaires_url,
+ documentaires_name=params.documentaires_name,
+ next='list_videos_documentaires',
+ page=str(int(params.page) + 1),
+ update_listing=True,
+ previous_listing=str(videos)
+ ),
+ })
+
+ elif params.next == 'list_videos_actualites':
+
+ if params.page == 0:
+ url = params.actualites_url
+ else:
+ url = params.actualites_url + '?page=' + str(params.page)
+
+ file_path = utils.download_catalog(
+ url,
+ '%s_%s_%s.html' % (
+ params.channel_name,
+ params.actualites_name,
+ params.page))
+ root_html = open(file_path).read()
+ root_soup = bs(root_html, 'html.parser')
+
+ video_soup = root_soup.find_all('div', class_="node node-lcp-reportage node-promoted node-teaser actu-teaser clearfix")
+
+ for video in video_soup:
+
+ title = video.find('h2').find('a').get_text().encode('utf-8')
+ aired = video.find('div', class_="content").find('div', class_="field field_submitted").get_text()
+ date = ''
+ duration = 0
+ year = int(aired.split('/',-1)[2])
+ img = video.find('a').find('img')['src'].encode('utf-8')
+
+ url_video = URL_ROOT + video['about'].encode('utf-8')
+
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'aired': aired,
+ 'date': date,
+ 'duration': duration,
+ 'year': year,
+ 'mediatype': 'tvshow'
+ }
+ }
+
+ # Nouveau pour ajouter le menu pour télécharger la vidéo
+ context_menu = []
+ download_video = (
+ _('Download'),
+ 'XBMC.RunPlugin(' + common.PLUGIN.get_url(
+ action='download_video',
+ url_video=url_video) + ')'
+ )
+ context_menu.append(download_video)
+ # Fin
+
+ videos.append({
+ 'label': title,
+ 'thumb': img,
+ 'fanart': img,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_r',
+ url_video=url_video
+ ),
+ 'is_playable': True,
+ 'info': info,
+ 'context_menu': context_menu # A ne pas oublier pour ajouter le bouton "Download" à chaque vidéo
+ })
+
+ # More videos...
+ videos.append({
+ 'label': common.ADDON.get_localized_string(30100),
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ actualites_url=params.actualites_url,
+ actualites_name=params.actualites_name,
+ next='list_videos_actualites',
+ page=str(int(params.page) + 1),
+ update_listing=True,
+ previous_listing=str(videos)
+ ),
+ })
+
+ elif params.next == 'list_videos_emissions':
+
+ # Cas emission (2 cas) (-0) ou (sans -0)
+ # 1ère page http://www.lcp.fr/emissions/evenements/replay-0 (url départ => http://www.lcp.fr/emissions/evenements-0)
+ # 1ère page http://www.lcp.fr/emissions/evenements/replay-0?page=1
+ # ainsi de suite
+ # 1ère page : http://www.lcp.fr/emissions/en-voiture-citoyens/replay (url départ => http://www.lcp.fr/emissions/en-voiture-citoyens)
+ # 2ème page : http://www.lcp.fr/emissions/en-voiture-citoyens/replay?page=1
+ # ainsi de suite
+
+ if params.page == 0 and '-0' not in params.emission_url:
+ url = params.emission_url + '/replay'
+ elif params.page > 0 and '-0' not in params.emission_url:
+ url = params.emission_url + '/replay?page=' + str(params.page)
+ elif params.page == 0 and '-0' in params.emission_url:
+ url = params.emission_url[:-2] + '/replay-0'
+ elif params.page > 0 and '-0' in params.emission_url:
+ url = params.emission_url[:-2] + '/replay-0?page=' + str(params.page)
+
+ file_path = utils.download_catalog(
+ url,
+ '%s_%s_%s.html' % (
+ params.channel_name,
+ params.emission_name,
+ params.page))
+ root_html = open(file_path).read()
+ root_soup = bs(root_html, 'html.parser')
+
+ video_soup = root_soup.find_all('div', class_="node node-lcp-tv-episode node-teaser clearfix")
+
+ for video in video_soup:
+
+ title = video.find('h2').find('a').get_text().encode('utf-8') + ' - ' + video.find('h4').find('a').get_text().encode('utf-8')
+ value_date = video.find('div', class_="content").find('span', class_="date").get_text().encode('utf-8')
+ date = value_date.split(' ')
+ day = date[0]
+ try:
+ mounth = CORRECT_MOUNTH[date[1]]
+ except:
+ mounth = '00'
+ year = date[2]
+
+ date = '.'.join((day, mounth, year))
+ aired = '-'.join((year, mounth, day))
+ duration = 0
+ duration = int(video.find('div', class_="content").find('div', class_="duration").find('div').find('span').get_text()) * 60
+ img = video.find('a').find('img')['src'].encode('utf-8')
+
+ url_video = URL_ROOT + video['about'].encode('utf-8')
+
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'aired': aired,
+ 'date': date,
+ 'duration': duration,
+ 'year': year,
+ 'mediatype': 'tvshow'
+ }
+ }
+
+ # Nouveau pour ajouter le menu pour télécharger la vidéo
+ context_menu = []
+ download_video = (
+ _('Download'),
+ 'XBMC.RunPlugin(' + common.PLUGIN.get_url(
+ action='download_video',
+ url_video=url_video) + ')'
+ )
+ context_menu.append(download_video)
+ # Fin
+
+ videos.append({
+ 'label': title,
+ 'thumb': img,
+ 'fanart': img,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_r',
+ url_video=url_video
+ ),
+ 'is_playable': True,
+ 'info': info,
+ 'context_menu': context_menu # A ne pas oublier pour ajouter le bouton "Download" à chaque vidéo
+ })
+
+ # More videos...
+ videos.append({
+ 'label': common.ADDON.get_localized_string(30100),
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ emission_url=params.emission_url,
+ emission_name=params.emission_name,
+ next='list_videos_emissions',
+ page=str(int(params.page) + 1),
+ update_listing=True,
+ previous_listing=str(videos)
+ ),
+ })
+
+ return common.PLUGIN.create_listing(
+ videos,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_PLAYCOUNT,
+ common.sp.xbmcplugin.SORT_METHOD_DATE,
+ common.sp.xbmcplugin.SORT_METHOD_DURATION,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE
+ ),
+ content='tvshows',
+ update_listing='update_listing' in params,
+ )
+
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def list_live(params):
+ """Build live listing"""
+ lives = []
+
+ title = ''
+ plot = ''
+ duration = 0
+ img = ''
+ url_live = ''
+
+ html_live = utils.get_webcontent(URL_LIVE_SITE)
+ root_soup = bs(html_live, 'html.parser')
+ live_soup = root_soup.find(
+ 'iframe',
+ class_='embed-responsive-item')
+
+ url_live_embeded = live_soup.get('src')
+ url_live = 'http:%s' % url_live_embeded
+
+ title = '%s Live' % params.channel_name.upper()
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'plot': plot,
+ 'duration': duration
+ }
+ }
+
+ lives.append({
+ 'label': title,
+ 'fanart': img,
+ 'thumb': img,
+ 'url' : common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_l',
+ url=url_live,
+ ),
+ 'is_playable': True,
+ 'info': info
+ })
+
+ return common.PLUGIN.create_listing(
+ lives,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ )
+ )
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def get_video_url(params):
+ """Get video URL and start video player"""
+ if params.next == 'play_r' or params.next == 'download_video':
+
+ url = ''
+
+ html_video = utils.get_webcontent(params.url_video)
+ url_video_embed = re.compile(r'<iframe src="(.*?)"').findall(html_video)[0]
+
+ if 'dailymotion' in url_video_embed:
+
+ url_video_embed_http = 'http:%s' % url_video_embed
+ if params.next == 'download_video':
+ return url_video_embed_http
+ html_video = utils.get_webcontent(url_video_embed_http)
+ html_video = html_video.replace('\\', '')
+
+ all_url_video = re.compile(r'"type":"video/mp4","url":"(.*?)"').findall(html_video)
+ for datas in all_url_video:
+ url = datas
+ else:
+ # get videoId and accountId
+ videoId, accountId = re.compile(r'embed/(.*?)/(.*?)/').findall(url_video_embed)[0]
+
+ html_json = utils.get_webcontent(URL_VIDEO_REPLAY % (videoId, accountId))
+
+ html_json_2 = re.compile(r'\((.*?)\);').findall(html_json)[0]
+ json_parser = json.loads(html_json_2)
+
+ for playlist in json_parser['Playlist']:
+ datas_video = playlist['MediaFiles']['M3u8']
+ for data in datas_video:
+ url = data['Url']
+
+ return url
+
+ elif params.next == 'play_l':
+
+ html_live = utils.get_webcontent(params.url)
+ html_live = html_live.replace('\\', '')
+
+ url_live = re.compile(r'{"type":"application/x-mpegURL","url":"(.*?)"}]}').findall(html_live)
+
+ # Just one flux no quality to choose
+ return url_live[0]
+
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/fr/lequipe.py b/plugin.video.catchuptvandmore/resources/lib/channels/fr/lequipe.py
index 01ea101..3201586 100644..100755
--- a/plugin.video.catchuptvandmore/resources/lib/channels/fr/lequipe.py
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/fr/lequipe.py
@@ -20,62 +20,105 @@
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""
+import re
+import ast
from bs4 import BeautifulSoup as bs
from resources.lib import utils
from resources.lib import common
-import re
-import ast
-auth = '?auth=1487366549-2688-mbe66p57-9b64a7bdc99718f9fc20facf756f8be9'
+# TO DO
+# Lot Code DailyMotion are present in some channel
+# (create function to pass video_id from each channel using DailyMotion)
+# Get Info Live
-dailymotion_url = 'https://www.dailymotion.com/cdn/manifest/video/'
+# Initialize GNU gettext emulation in addon
+# This allows to use UI strings from addon’s English
+# strings.po file instead of numeric codes
+_ = common.ADDON.initialize_gettext()
-url_root = 'https://www.lequipe.fr'
+URL_ROOT = 'https://www.lequipe.fr'
-categories = {
- 'https://www.lequipe.fr/lachainelequipe/morevideos/0/': 'Tout',
- 'https://www.lequipe.fr/lachainelequipe/morevideos/1/': 'L\'Équipe du soir',
- 'https://www.lequipe.fr/lachainelequipe/morevideos/62/': 'L\'Équipe Type',
- 'https://www.lequipe.fr/lachainelequipe/morevideos/88/': 'L\'Équipe Enquête',
- 'https://www.lequipe.fr/lachainelequipe/morevideos/46/': 'Esprit Bleu'
-}
+URL_ROOT_VIDEO_LEQUIPE = 'https://www.lequipe.fr/lachainelequipe/'
-correct_mounth = {
- 'JANV.': '01',
- 'FÉVR.': '02',
- 'MARS.': '03',
- 'AVRI': '04',
- 'MAI': '05',
- 'JUIN': '06',
- 'JUIL.': '07',
- 'AOÛT': '08',
- 'SEPT.': '09',
- 'OCTO.': '10',
- 'NOVE.': '11',
- 'DECE.': '12'
-}
+URL_REPLAY_VIDEO_LEQUIPE = 'https://www.lequipe.fr/lachainelequipe/morevideos/%s'
+# Category_id
+URL_DAILYMOTION_EMBED = 'http://www.dailymotion.com/embed/video/%s'
+# Video_id
def channel_entry(params):
- if 'list_shows' in params.next:
+ """Entry function of the module"""
+ if 'root' in params.next:
+ return root(params)
+ elif 'list_shows' in params.next:
return list_shows(params)
elif 'list_videos' in params.next:
return list_videos(params)
+ elif 'live' in params.next:
+ return list_live(params)
elif 'play' in params.next:
return get_video_url(params)
else:
return None
+@common.PLUGIN.cached(common.CACHE_TIME)
+def root(params):
+ """Add Replay and Live in the listing"""
+ modes = []
+
+ # Add Replay
+ modes.append({
+ 'label' : 'Replay',
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_shows_1',
+ category='%s Replay' % params.channel_name.upper(),
+ window_title='%s Replay' % params.channel_name.upper()
+ ),
+ })
+
+ # Add Live
+ modes.append({
+ 'label' : 'Live TV',
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='live_cat',
+ category='%s Live TV' % params.channel_name.upper(),
+ window_title='%s Live TV' % params.channel_name.upper()
+ ),
+ })
+
+ return common.PLUGIN.create_listing(
+ modes,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ ),
+ )
-@common.plugin.cached(common.cache_time)
+@common.PLUGIN.cached(common.CACHE_TIME)
def list_shows(params):
+ """Build shows listing"""
shows = []
- for category_url, category_name in categories.iteritems():
+ # Get categories :
+ file_path = utils.download_catalog(
+ URL_ROOT_VIDEO_LEQUIPE,
+ '%s_video.html' % (
+ params.channel_name))
+ root_html = open(file_path).read()
+ root_soup = bs(root_html, 'html.parser')
+
+ categories_soup = root_soup.find_all('a', class_="navtab__item js-tabs-item")
+
+ for category in categories_soup:
+
+ category_name = category.get_text().encode('utf-8')
+ category_url = URL_REPLAY_VIDEO_LEQUIPE % category.get('data-program-id')
shows.append({
'label': category_name,
- 'url': common.plugin.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
category_url=category_url,
page='1',
@@ -85,21 +128,22 @@ def list_shows(params):
)
})
- return common.plugin.create_listing(
+ return common.PLUGIN.create_listing(
shows,
sort_methods=(
common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
common.sp.xbmcplugin.SORT_METHOD_LABEL))
-@common.plugin.cached(common.cache_time)
+@common.PLUGIN.cached(common.CACHE_TIME)
def list_videos(params):
+ """Build videos listing"""
videos = []
if 'previous_listing' in params:
videos = ast.literal_eval(params['previous_listing'])
- url = params.category_url + params.page
+ url = params.category_url + '/' + params.page
file_path = utils.download_catalog(
url,
'%s_%s_%s.html' % (
@@ -114,7 +158,12 @@ def list_videos(params):
class_='colead')
for program in category_soup:
- url = program['href'].encode('utf-8')
+
+ # Get Video_ID
+ url = URL_ROOT + program['href'].encode('utf-8')
+ html_video_equipe = utils.get_webcontent(url)
+ video_id = re.compile(
+ r'<iframe src="//www.dailymotion.com/embed/video/(.*?)\?', re.DOTALL).findall(html_video_equipe)[0]
title = program.find(
'h2').get_text().encode('utf-8')
@@ -124,42 +173,28 @@ def list_videos(params):
img = colead__image.find(
'img')['data-src'].encode('utf-8')
- views = colead__image.find(
- 'span',
- class_='colead__layerText--topright'
- ).get_text().encode('utf-8')
-
- views = [int(s) for s in views.split() if s.isdigit()]
- views = views[0]
-
date = colead__image.find(
'span',
- class_='colead__layerText--bottomleft'
- ).get_text().encode('utf-8') # 10 FÉVR. 2017 | 08:20
- date = date.split(' ')
+ class_='colead__layerText colead__layerText--bottomleft'
+ ).get_text().strip().encode('utf-8') # 07/09/17 | 01 min
+ date = date.split('/')
day = date[0]
- try:
- mounth = correct_mounth[date[1]]
- except:
- mounth = '00'
- year = date[2]
+ mounth = date[1]
+ year = '20' + date[2].split(' ')[0]
date = '.'.join((day, mounth, year))
aired = '-'.join((year, mounth, day))
- # date : string (%d.%m.%Y / 01.01.2009)
- # aired : string (2008-12-07)
duration_string = colead__image.find(
'span',
- class_='colead__layerText--bottomright'
- ).get_text().encode('utf-8')
- duration_list = duration_string.split(':')
- duration = int(duration_list[0]) * 60 + int(duration_list[1])
+ class_='colead__layerText colead__layerText--bottomleft'
+ ).get_text().strip().encode('utf-8')
+ duration_list = duration_string.split(' ')
+ duration = int(duration_list[2]) * 60
info = {
'video': {
'title': title,
- 'playcount': views,
'aired': aired,
'date': date,
'duration': duration,
@@ -168,22 +203,33 @@ def list_videos(params):
}
}
+ context_menu = []
+ download_video = (
+ _('Download'),
+ 'XBMC.RunPlugin(' + common.PLUGIN.get_url(
+ action='download_video',
+ video_id=video_id) + ')'
+ )
+ context_menu.append(download_video)
+
videos.append({
'label': title,
'thumb': img,
- 'url': common.plugin.get_url(
+ 'fanart': img,
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
- next='play',
- url=url
+ next='play_r',
+ video_id=video_id
),
'is_playable': True,
- 'info': info
+ 'info': info,
+ 'context_menu': context_menu
})
# More videos...
videos.append({
- 'label': common.addon.get_localized_string(30100),
- 'url': common.plugin.get_url(
+ 'label': common.ADDON.get_localized_string(30100),
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
category_url=params.category_url,
category_name=params.category_name,
@@ -194,7 +240,7 @@ def list_videos(params):
),
})
- return common.plugin.create_listing(
+ return common.PLUGIN.create_listing(
videos,
sort_methods=(
common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
@@ -207,43 +253,91 @@ def list_videos(params):
update_listing='update_listing' in params,
)
+@common.PLUGIN.cached(common.CACHE_TIME)
+def list_live(params):
+ """Build live listing"""
+ lives = []
+
+ title = ''
+ plot = ''
+ duration = 0
+ img = ''
+ url_live = ''
+ video_id = ''
+ url_live = ''
+
+ html_live_equipe = utils.get_webcontent(URL_ROOT_VIDEO_LEQUIPE)
+ video_id = re.compile(
+ r'<iframe src="//www.dailymotion.com/embed/video/(.*?)\?', re.DOTALL).findall(html_live_equipe)[0]
+
+ title = '%s Live' % params.channel_name.upper()
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'plot': plot,
+ 'duration': duration
+ }
+ }
-@common.plugin.cached(common.cache_time)
-def get_video_url(params):
- url = url_root + params.url
- html_video_equipe = utils.get_webcontent(
- url)
-
- url_daily = re.compile(
- r'<iframe src="//(.*?)"', re.DOTALL).findall(html_video_equipe)[0]
-
- url_daily = 'http://' + url_daily
+ lives.append({
+ 'label': title,
+ 'fanart': img,
+ 'thumb': img,
+ 'url' : common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_l',
+ video_id=video_id,
+ ),
+ 'is_playable': True,
+ 'info': info
+ })
- html_daily = utils.get_webcontent(
- url_daily,)
+ return common.PLUGIN.create_listing(
+ lives,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ )
+ )
- html_daily = html_daily.replace('\\', '')
- urls_mp4 = re.compile(
- r'{"type":"video/mp4","url":"(.*?)"}],"(.*?)":').findall(html_daily)
- for url, quality in urls_mp4:
- if quality == '480':
- url_sd = url
- elif quality == '720':
- url_hd = url
- elif quality == '1080':
- url_hdplus = url
- url_default = url
+@common.PLUGIN.cached(common.CACHE_TIME)
+def get_video_url(params):
+ """Get video URL and start video player"""
+ url_video = URL_DAILYMOTION_EMBED % params.video_id
- desired_quality = common.plugin.get_setting(
- params.channel_id + '.quality')
+ desired_quality = common.PLUGIN.get_setting('quality')
- if desired_quality == 'HD+' and url_hdplus is not None:
- return url_hdplus
- elif desired_quality == 'HD' and url_hd is not None:
- return url_hd
- elif desired_quality == 'SD' and url_sd is not None:
- return url_sd
+ if params.next == 'download_video':
+ return url_video
else:
- return url_default
+ html_video = utils.get_webcontent(url_video)
+ html_video = html_video.replace('\\', '')
+
+ if params.next == 'play_l':
+ all_url_video = re.compile(r'{"type":"application/x-mpegURL","url":"(.*?)"').findall(html_video)
+ # Just One Quality
+ return all_url_video[0]
+ elif params.next == 'play_r':
+ all_url_video = re.compile(r'{"type":"video/mp4","url":"(.*?)"').findall(html_video)
+ if desired_quality == "DIALOG":
+ all_datas_videos = []
+ for datas in all_url_video:
+ new_list_item = common.sp.xbmcgui.ListItem()
+ datas_quality = re.search('H264-(.+?)/', datas).group(1)
+ new_list_item.setLabel('H264-' + datas_quality)
+ new_list_item.setPath(datas)
+ all_datas_videos.append(new_list_item)
+
+ seleted_item = common.sp.xbmcgui.Dialog().select("Choose Stream", all_datas_videos)
+
+ return all_datas_videos[seleted_item].getPath().encode('utf-8')
+ elif desired_quality == 'BEST':
+ # Last video in the Best
+ for datas in all_url_video:
+ url = datas
+ return url
+ else:
+ return all_url_video[0]
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/fr/nrj.py b/plugin.video.catchuptvandmore/resources/lib/channels/fr/nrj.py
index e038c21..a313210 100644..100755
--- a/plugin.video.catchuptvandmore/resources/lib/channels/fr/nrj.py
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/fr/nrj.py
@@ -20,263 +20,367 @@
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""
+import json
+import re
+import xml.etree.ElementTree as ET
+import requests
+from bs4 import BeautifulSoup as bs
from resources.lib import utils
from resources.lib import common
-from bs4 import BeautifulSoup as bs
-url_replay = 'http://www.nrj-play.fr/%s/replay'
+# TO DO
+# Get Info Live
+# Get CATEGORIES
+
+# Initialize GNU gettext emulation in addon
+# This allows to use UI strings from addon’s English
+# strings.po file instead of numeric codes
+_ = common.ADDON.initialize_gettext()
+
+URL_ROOT = 'http://www.nrj-play.fr'
+
+URL_REPLAY = 'http://www.nrj-play.fr/%s/replay'
# channel_name (nrj12, ...)
-url_root = 'http://www.nrj-play.fr'
+URL_COLLECTION_API = 'http://www.nrj-play.fr/%s/api/getreplaytvcollection'
+# channel_name (nrj12, ...)
+
+URL_REPLAY_API = 'http://www.nrj-play.fr/%s/api/getreplaytvlist'
+# channel_name (nrj12, ...) - HTTP 500 non stable
+
+URL_ALL_VIDEO = 'http://www.nrj-play.fr/sitemap-videos.xml'
+# Meilleur stabilité mais perte des collections
+
+URL_GET_API_LIVE = 'http://www.nrj-play.fr/sitemap.xml'
+# NOT_USED in this script (link api, live and more)
+URL_COMPTE_LOGIN = 'https://www.nrj-play.fr/compte/login'
+# TO DO add account for using Live Direct
+
+URL_LIVE_WITH_TOKEN = 'http://www.nrj-play.fr/compte/live?channel=%s'
+# channel (nrj12, ...) - call this url after get session (url live with token inside this page)
def channel_entry(params):
- if 'list_shows' in params.next:
+ """Entry function of the module"""
+ if 'root' in params.next:
+ return root(params)
+ elif 'list_shows' in params.next:
return list_shows(params)
elif 'list_videos' in params.next:
return list_videos(params)
+ elif 'live' in params.next:
+ return list_live(params)
elif 'play' in params.next:
return get_video_url(params)
else:
return None
-@common.plugin.cached(common.cache_time)
+@common.PLUGIN.cached(common.CACHE_TIME)
+def root(params):
+ """Add Replay and Live in the listing"""
+ modes = []
+
+ # Add Replay with Categories
+ modes.append({
+ 'label' : 'Replay',
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_shows_1',
+ category='%s Replay' % params.channel_name.upper(),
+ window_title='%s Replay' % params.channel_name.upper()
+ ),
+ })
+
+ # Add Replay
+ modes.append({
+ 'label' : 'Replay sans categorie',
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_shows_without_categories',
+ category='%s Replay' % params.channel_name.upper(),
+ window_title='%s Replay' % params.channel_name.upper()
+ ),
+ })
+
+ # Add Live
+ modes.append({
+ 'label' : 'Live TV',
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='live_cat',
+ category='%s Live TV' % params.channel_name.upper(),
+ window_title='%s Live TV' % params.channel_name.upper()
+ ),
+ })
+
+ return common.PLUGIN.create_listing(
+ modes,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ ),
+ )
+
+@common.PLUGIN.cached(common.CACHE_TIME)
def list_shows(params):
+ """Build shows listing"""
shows = []
- if 'list_shows_1' in params.next:
- # Build categories list (Tous les programmes, Séries, ...)
- file_path = utils.download_catalog(
- url_replay % params.channel_name,
- '%s_replay.html' % params.channel_name,
- )
- replay_html = open(file_path).read()
- replay_soup = bs(replay_html, 'html.parser')
+ if 'list_shows_without_categories' in params.next:
- categories_soup = replay_soup.find_all(
- 'li',
- class_='subNav-menu-item')
+ # Pour avoir toutes les videos
+ state_video = 'Toutes les videos (sans les categories)'
- for category in categories_soup:
- url_category = category.find('a')['href'].encode('utf-8')
- title_category = category.find('a').get_text().encode('utf-8')
+ shows.append({
+ 'label': state_video,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ state_video=state_video,
+ next='list_videos_1',
+ #title_category=category_name,
+ window_title=state_video
+ )
+ })
- shows.append({
- 'label': title_category,
- 'url': common.plugin.get_url(
- action='channel_entry',
- url_category=url_category,
- next='list_shows_programs',
- title_category=title_category,
- window_title=title_category
- )
- })
+ else:
+ unique_item = dict()
- elif 'list_shows_programs' in params.next:
- # Build category's programs list
- # (Crimes, tellement vrai, Le mad mag, ...)
file_path = utils.download_catalog(
- url_root + params.url_category,
- '%s_%s_category.html' % (
- params.channel_name,
- params.title_category),
+ URL_COLLECTION_API % params.channel_name,
+ '%s_collection.xml' % params.channel_name,
)
- category_html = open(file_path).read()
- category_soup = bs(category_html, 'html.parser')
-
- programs_soup = category_soup.find_all(
- 'div',
- class_='linkProgram')
+ collection_xml = open(file_path).read()
- for program in programs_soup:
- title = program.find(
- 'h2',
- class_='linkProgram-title').get_text().encode('utf-8')
+ xml_elements = ET.XML(collection_xml)
- title = ' '.join(title.split())
+ if 'list_shows_1' in params.next:
+ # Build categories list (Tous les programmes, Séries, ...)
+ collections = xml_elements.findall("collection")
- url = program.find('a')['href'].encode('utf-8')
- img = program.find('img')['src'].encode('utf-8')
+ # Pour avoir toutes les videos, certaines videos ont des
+ # categories non presentes dans cette URL 'url_collection_api'
+ state_video = 'Toutes les videos'
shows.append({
- 'label': title,
- 'thumb': img,
- 'url': common.plugin.get_url(
+ 'label': state_video,
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
- next='list_shows_seasons',
- url_program=url,
- title_program=title,
- window_title=title
- ),
+ state_video=state_video,
+ next='list_videos_1',
+ #title_category=category_name,
+ window_title=state_video
+ )
})
- elif 'list_shows_seasons' in params.next:
- file_path = utils.download_catalog(
- url_root + params.url_program,
- '%s_%s_program.html' % (
- params.channel_name,
- params.title_program),
- )
- program_html = open(file_path).read()
- program_soup = bs(program_html, 'html.parser')
- program_url = program_soup.find(
- 'a',
- class_='pushProgram-link')['href'].encode('utf-8')
+ for collection in collections:
+
+ category_name = collection.findtext("category").encode('utf-8')
+ if category_name not in unique_item:
+ if category_name == '':
+ category_name = 'NO_CATEGORY'
+ unique_item[category_name] = category_name
+ shows.append({
+ 'label': category_name,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ category_name=category_name,
+ next='list_shows_programs',
+ #title_category=category_name,
+ window_title=category_name
+ )
+ })
+
+ elif 'list_shows_programs' in params.next:
+ # Build programm list (Tous les programmes, Séries, ...)
+ collections = xml_elements.findall("collection")
+
+ state_video = 'VIDEOS_BY_CATEGORY'
+
+ for collection in collections:
+ if params.category_name == collection.findtext("category").encode('utf-8') \
+ or (params.category_name == 'NO_CATEGORY' and \
+ collection.findtext("category").encode('utf-8') == ''):
+ name_program = collection.findtext("name").encode('utf-8')
+ img_program = collection.findtext("picture")
+ id_program = collection.get("id")
+
+ shows.append({
+ 'label': name_program,
+ 'thumb': img_program,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_videos_1',
+ state_video=state_video,
+ id_program=id_program,
+ #title_program=name_program,
+ window_title=name_program
+ )
+ })
+
+ return common.PLUGIN.create_listing(
+ shows,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE
+ ),
+ )
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def list_videos(params):
+ """Build videos listing"""
+ videos = []
+
+ if params.state_video == 'Toutes les videos (sans les categories)':
file_path = utils.download_catalog(
- url_root + program_url,
- '%s_%s_program_fiche.html' % (
- params.channel_name,
- params.title_program),
+ URL_ALL_VIDEO,
+ '%s_all_video.xml' % params.channel_name,
)
- program_html = open(file_path).read()
- program_soup = bs(program_html, 'html.parser')
-
- seasons_soup = program_soup.find(
- 'ul',
- class_='seasonsBox-list')
-
- if seasons_soup is not None:
- for season in seasons_soup.find_all('li'):
- title_season = season.find(
- 'a').get_text().encode('utf-8')
- season_url = season.find('a')['href'].encode('utf-8')
-
- shows.append({
- 'label': title_season,
- 'url': common.plugin.get_url(
+ replay_xml = open(file_path).read()
+
+ xml_elements = ET.XML(replay_xml)
+
+ programs = xml_elements.findall("{http://www.sitemaps.org/schemas/sitemap/0.9}url")
+
+ for program in programs:
+
+ url_site = program.findtext(
+ "{http://www.sitemaps.org/schemas/sitemap/0.9}loc").encode('utf-8')
+ check_string = '%s/replay/' % params.channel_name
+ if url_site.count(check_string) > 0:
+
+ # Title
+ title = url_site.rsplit('/', 1)[1].replace("-", " ").upper()
+
+ video_node = program.findall(
+ "{http://www.google.com/schemas/sitemap-video/1.1}video")[0]
+
+ # Duration
+ duration = 0
+
+ # Image
+ img = ''
+ img_node = video_node.find(
+ "{http://www.google.com/schemas/sitemap-video/1.1}thumbnail_loc")
+ img = img_node.text.encode('utf-8')
+
+ # Url Video
+ url = ''
+ url_node = video_node.find(
+ "{http://www.google.com/schemas/sitemap-video/1.1}content_loc")
+ url = url_node.text.encode('utf-8')
+
+ # Plot
+ plot = ''
+ plot_node = video_node.find(
+ "{http://www.google.com/schemas/sitemap-video/1.1}description")
+ if plot_node.text:
+ plot = plot_node.text.encode('utf-8')
+
+ # Date
+ value_date = ''
+ value_date_node = video_node.find(
+ "{http://www.google.com/schemas/sitemap-video/1.1}publication_date")
+ value_date = value_date_node.text.encode('utf-8')
+ date = value_date.split('T')[0].split('-')
+ day = date[2]
+ mounth = date[1]
+ year = date[0]
+ date = '.'.join((day, mounth, year))
+ aired = '-'.join((year, mounth, day))
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'plot': plot,
+ 'duration': duration,
+ 'aired': aired,
+ 'date': date,
+ 'year': year,
+ 'mediatype': 'tvshow'
+ }
+ }
+
+ context_menu = []
+ download_video = (
+ _('Download'),
+ 'XBMC.RunPlugin(' + common.PLUGIN.get_url(
+ action='download_video',
+ url_video=url_site) + ')'
+ )
+ context_menu.append(download_video)
+
+ videos.append({
+ 'label': title,
+ 'fanart': img,
+ 'thumb': img,
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
- next='list_shows_season_categories',
- season_url=season_url,
- title_program=params.title_program,
- title_season=title_season,
- window_title=title_season
+ next='play_r',
+ url_video=url
),
+ 'is_playable': True,
+ 'info': info,
+ 'context_menu': context_menu
})
- else:
- params['next'] = 'list_shows_season_categories'
- params['season_url'] = program_url
- params['title_program'] = params.title_program
- params['title_season'] = 'no_season'
- params['window_title'] = params.window_title
- return list_shows(params)
-
- elif 'list_shows_season_categories':
- # Build program's categories
- # (Les vidéos, les actus, les bonus, ...)
+ else:
file_path = utils.download_catalog(
- url_root + params.season_url,
- '%s_%s_%s_program_season.html' % (
- params.channel_name,
- params.title_program,
- params.title_season),
+ URL_REPLAY_API % params.channel_name,
+ '%s_replay.xml' % params.channel_name,
)
- program_html = open(file_path).read()
- program_soup = bs(program_html, 'html.parser')
-
- # We have to find all 'flag-category' tag and all title h2
-
- season_categories = {}
- flag_categories_soup = program_soup.find_all(
- 'a',
- attrs={'class': 'flag-category'})
- for flag_category in flag_categories_soup:
- season_category_title = flag_category.get_text().encode('utf-8')
- if season_category_title == '':
- season_category_title = 'No name'
- season_categories[season_category_title] = 'flag_category'
-
- titles_h2 = program_soup.find_all(
- 'h2',
- attrs={'class': 'title-2'})
-
- for title_h2 in titles_h2:
- if 'itemprop' not in title_h2.attrs:
- separator = title_h2.parent.find(
- 'div',
- class_='separator-wrap')
- if separator:
- url = separator.find('a')['href'].encode('utf-8')
- season_categories[title_h2.get_text().encode(
- 'utf-8')] = url
-
- for season_category_title, \
- season_category_url in season_categories.iteritems():
- shows.append({
- 'label': season_category_title,
- 'url': common.plugin.get_url(
- action='channel_entry',
- next='list_videos',
- season_category_url=season_category_url,
- season_url=params.season_url,
- season_category_title=season_category_title,
- page='1',
- window_title=season_category_title
- ),
- })
+ replay_xml = open(file_path).read()
- return common.plugin.create_listing(
- shows,
- sort_methods=(
- common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
- common.sp.xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE
- ),
- )
+ xml_elements = ET.XML(replay_xml)
+ programs = xml_elements.findall("program")
-@common.plugin.cached(common.cache_time)
-def list_videos(params):
- videos = []
+ for program in programs:
+ if params.state_video == 'Toutes les videos':
+
+ # Title
+ title = program.findtext("title").encode('utf-8') + " - " + \
+ program.findtext("subtitle").encode('utf-8')
+
+ # Duration
+ duration = 0
+ if program.findtext("duration"):
+ try:
+ duration = int(program.findtext("duration")) * 60
+ except ValueError:
+ pass # or whatever
+
+ # Image
+ img = program.find("photos").findtext("photo")
+
+ # Url Video
+ url = '' #program.find("offres").find("offre").find("videos").findtext("video)
+ for i in program.find("offres").findall("offre"):
+
+ date_value = i.get("startdate")
+ date_value_list = date_value.split(' ')[0].split('-')
+ day = date_value_list[2]
+ mounth = date_value_list[1]
+ year = date_value_list[0]
- # flag_category case
- if 'flag_category' in params.season_category_url:
- program_html = utils.get_webcontent(
- url_root + params.season_url
- )
- program_soup = bs(program_html, 'html.parser')
-
- videos_soup = program_soup.find_all(
- 'div',
- attrs={'class': 'thumbnail', 'itemprop': 'video'})
- for video in videos_soup:
- current_flag_category = video.find(
- 'a',
- attrs={'class': 'flag-category'}).get_text().encode('utf-8')
- if current_flag_category == '':
- current_flag_category = 'No name'
- if current_flag_category and current_flag_category \
- == params.season_category_title:
-
- title_soup = video.find(
- 'h3',
- class_='thumbnail-title')
- url = title_soup.find('a')['href'].encode('utf-8')
-
- title = title_soup.get_text().encode('utf-8')
- title = ' '.join(title.split())
-
- img = video.find('img')['src'].encode('utf-8')
- try:
- date = video.find('time').get_text()
- date = date.encode('utf-8').split(' ')[1]
- date_splited = date.split('/')
- day = date_splited[0]
- mounth = date_splited[1]
- year = date_splited[2]
- # date : string (%d.%m.%Y / 01.01.2009)
- # aired : string (2008-12-07)
date = '.'.join((day, mounth, year))
aired = '-'.join((year, mounth, day))
- except:
- date = ''
- aired = ''
- year = ''
+
+ for j in i.find("videos").findall("video"):
+ url = j.text.encode('utf-8')
+
+ # Plot
+ plot = ''
+ for i in program.find("stories").findall("story"):
+ if int(i.get("maxlength")) == 680:
+ plot = i.text.encode('utf-8')
info = {
'video': {
'title': title,
+ 'plot': plot,
+ 'duration': duration,
'aired': aired,
'date': date,
'year': year,
@@ -284,109 +388,195 @@ def list_videos(params):
}
}
+ context_menu = []
+ download_video = (
+ _('Download'),
+ 'XBMC.RunPlugin(' + common.PLUGIN.get_url(
+ action='download_video',
+ url_video=url) + ')'
+ )
+ context_menu.append(download_video)
+
videos.append({
'label': title,
+ 'fanart': img,
'thumb': img,
- 'url': common.plugin.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
- next='play',
+ next='play_r',
url_video=url
),
'is_playable': True,
- 'info': info
+ 'info': info,
+ 'context_menu': context_menu
})
- # others url case
- else:
- program_html = utils.get_webcontent(
- url_root + params.season_category_url + '?page=' + params.page
- )
- program_soup = bs(program_html, 'html.parser')
-
- videos_soup = program_soup.find_all(
- 'div',
- attrs={'class': 'item col-xs-6 col-md-4'})
- for video in videos_soup:
-
- title_soup = video.find(
- 'h3',
- class_='thumbnail-title')
- url = title_soup.find('a')['href'].encode('utf-8')
-
- title = title_soup.get_text().encode('utf-8')
- title = ' '.join(title.split())
-
- img = video.find('img')['src'].encode('utf-8')
- try:
- date = video.find('time').get_text()
- date = date.encode('utf-8').split(' ')[1]
- except:
- date = video.find('time').get_text().encode('utf-8')
-
- date_splited = date.split('/')
- day = date_splited[0]
- mounth = date_splited[1]
- year = date_splited[2]
-
- date = '.'.join((day, mounth, year))
- aired = '-'.join((year, mounth, day))
- # date : string (%d.%m.%Y / 01.01.2009)
- # aired : string (2008-12-07)
- info = {
- 'video': {
- 'title': title,
- 'aired': aired,
- 'date': date,
- 'year': year,
- 'mediatype': 'tvshow'
- }
- }
- videos.append({
- 'label': title,
- 'thumb': img,
- 'url': common.plugin.get_url(
- action='channel_entry',
- next='play',
- url_video=url
- ),
- 'is_playable': True,
- 'info': info
- })
+ elif params.id_program == program.get("IDSERIE"):
- # More videos...
- videos.append({
- 'label': common.addon.get_localized_string(30100),
- 'url': common.plugin.get_url(
- action='channel_entry',
- next='list_videos',
- season_category_url=params.season_category_url,
- season_url=params.season_url,
- season_category_title=params.season_category_title,
- page=str(int(params.page) + 1),
- window_title=params.window_title
- )
+ # Title
+ title = program.findtext("title").encode('utf-8') + " - " + \
+ program.findtext("subtitle").encode('utf-8')
- })
+ # Duration
+ duration = 0
+ if program.findtext("duration"):
+ try:
+ duration = int(program.findtext("duration")) * 60
+ except ValueError:
+ pass # or whatever
+
+ # Image
+ img = program.find("photos").findtext("photo")
+
+ # Url Video
+ url = '' #program.find("offres").find("offre").find("videos").findtext("video)
+ for i in program.find("offres").findall("offre"):
+
+ date_value = i.get("startdate")
+ date_value_list = date_value.split(' ')[0].split('-')
+ day = date_value_list[2]
+ mounth = date_value_list[1]
+ year = date_value_list[0]
+
+ date = '.'.join((day, mounth, year))
+ aired = '-'.join((year, mounth, day))
- return common.plugin.create_listing(
+ for j in i.find("videos").findall("video"):
+ url = j.text.encode('utf-8')
+
+ # Plot
+ plot = ''
+ for i in program.find("stories").findall("story"):
+ if int(i.get("maxlength")) == 680:
+ plot = i.text.encode('utf-8')
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'plot': plot,
+ 'duration': duration,
+ 'aired': aired,
+ 'date': date,
+ 'year': year,
+ 'mediatype': 'tvshow'
+ }
+ }
+
+ context_menu = []
+ download_video = (
+ _('Download'),
+ 'XBMC.RunPlugin(' + common.PLUGIN.get_url(
+ action='download_video',
+ url_video=url) + ')'
+ )
+ context_menu.append(download_video)
+
+ videos.append({
+ 'label': title,
+ 'fanart': img,
+ 'thumb': img,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_r',
+ url_video=url
+ ),
+ 'is_playable': True,
+ 'info': info
+ # 'context_menu': context_menu
+ })
+
+ return common.PLUGIN.create_listing(
videos,
sort_methods=(
- common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
common.sp.xbmcplugin.SORT_METHOD_DATE,
- common.sp.xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE
+ common.sp.xbmcplugin.SORT_METHOD_DURATION,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE,
+ common.sp.xbmcplugin.SORT_METHOD_GENRE,
+ common.sp.xbmcplugin.SORT_METHOD_PLAYCOUNT,
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED
),
content='tvshows')
+@common.PLUGIN.cached(common.CACHE_TIME)
+def list_live(params):
+ """Build live listing"""
+ lives = []
+
+ title = ''
+ plot = ''
+ duration = 0
+ img = ''
+ url_live = ''
+
+ session_requests = requests.session()
+ result = session_requests.get(URL_COMPTE_LOGIN)
+
+ token_form_login = re.compile(
+ r'name=\"login_form\[_token\]\" value=\"(.*?)\"').findall(result.text)[0]
+
+ # Build PAYLOAD
+ payload = {
+ "login_form[email]": common.PLUGIN.get_setting(
+ params.channel_id.rsplit('.', 1)[0] + '.login'),
+ "login_form[password]": common.PLUGIN.get_setting(
+ params.channel_id.rsplit('.', 1)[0] + '.password'),
+ "login_form[_token]": token_form_login
+ }
+
+ # LOGIN
+ result_2 = session_requests.post(
+ URL_COMPTE_LOGIN, data = payload, headers = dict(referer = URL_COMPTE_LOGIN))
+
+ # GET page with url_live with the session logged
+ result_3 = session_requests.get(
+ URL_LIVE_WITH_TOKEN % (params.channel_name),
+ headers=dict(
+ referer=URL_LIVE_WITH_TOKEN % (params.channel_name)))
+
+ root_soup = bs(result_3.text, 'html.parser')
+ live_soup = root_soup.find('div', class_="player")
+
+ url_live_json = live_soup.get('data-options')
+ url_live_json_jsonparser = json.loads(url_live_json)
+
+ url_live = url_live_json_jsonparser["file"]
+
+ title = '%s Live' % params.channel_name.upper()
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'plot': plot,
+ 'duration': duration
+ }
+ }
+
+ lives.append({
+ 'label': title,
+ 'fanart': img,
+ 'thumb': img,
+ 'url' : common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_l',
+ url_live=url_live,
+ ),
+ 'is_playable': True,
+ 'info': info
+ })
+
+ return common.PLUGIN.create_listing(
+ lives,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ )
+ )
-@common.plugin.cached(common.cache_time)
+@common.PLUGIN.cached(common.CACHE_TIME)
def get_video_url(params):
- if url_root in params.url_video:
- url_video = params.url_video
- else:
- url_video = url_root + params.url_video
- video_html = utils.get_webcontent(
- url_video)
- video_soup = bs(video_html, 'html.parser')
- return video_soup.find(
- 'meta',
- attrs={'itemprop': 'contentUrl'})['content'].encode('utf-8')
+ """Get video URL and start video player"""
+ if params.next == 'play_r' or params.next == 'download_video':
+ # Just One format of each video (no need of QUALITY)
+ return params.url_video
+ elif params.next == 'play_l':
+ return params.url_live
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/fr/numero23.py b/plugin.video.catchuptvandmore/resources/lib/channels/fr/numero23.py
index 8f20db7..1beab9d 100644..100755
--- a/plugin.video.catchuptvandmore/resources/lib/channels/fr/numero23.py
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/fr/numero23.py
@@ -20,38 +20,101 @@
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""
+import re
+import json
from bs4 import BeautifulSoup as bs
from resources.lib import utils
from resources.lib import common
-import ast
-import re
-url_root = 'http://www.numero23.fr/replay/'
+# TO DO
+# Get more info Live TV (picture, plot)
+# Get year from Replay
+
+# Initialize GNU gettext emulation in addon
+# This allows to use UI strings from addon’s English
+# strings.po file instead of numeric codes
+_ = common.ADDON.initialize_gettext()
+
+URL_REPLAY = 'http://www.numero23.fr/replay/'
+URL_INFO_LIVE_JSON = 'http://www.numero23.fr/wp-content/cache/n23-direct.json'
+# Title, DailyMotion Id (Video)
+
+URL_DAILYMOTION_EMBED = 'http://www.dailymotion.com/embed/video/%s'
+# Video_id
def channel_entry(params):
- if 'list_shows' in params.next:
+ """Entry function of the module"""
+ if 'root' in params.next:
+ return root(params)
+ elif 'list_shows' in params.next:
return list_shows(params)
elif 'list_videos' in params.next:
return list_videos(params)
+ elif 'live' in params.next:
+ return list_live(params)
elif 'play' in params.next:
return get_video_url(params)
else:
return None
+CORRECT_MONTH = {
+ 'janvier' : '01',
+ 'février' : '02',
+ 'mars' : '03',
+ 'avril' : '04',
+ 'mai' : '05',
+ 'juin' : '06',
+ 'juillet' : '07',
+ 'août' : '08',
+ 'septembre' : '09',
+ 'octobre' : '10',
+ 'novembre' : '11',
+ 'décembre' : '12'
+}
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def root(params):
+ """Add Replay and Live in the listing"""
+ modes = []
+
+ # Add Replay
+ modes.append({
+ 'label' : 'Replay',
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_shows_1',
+ category='%s Replay' % params.channel_name.upper(),
+ window_title='%s Replay' % params.channel_name.upper()
+ ),
+ })
+
+ # Add Live
+ modes.append({
+ 'label' : 'Live TV',
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='live_cat',
+ category='%s Live TV' % params.channel_name.upper(),
+ window_title='%s Live TV' % params.channel_name.upper()
+ ),
+ })
+
+ return common.PLUGIN.create_listing(
+ modes,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ ),
+ )
-@common.plugin.cached(common.cache_time)
+@common.PLUGIN.cached(common.CACHE_TIME)
def list_shows(params):
+ """Build shows listing"""
shows = []
- if 'previous_listing' in params:
- shows = ast.literal_eval(params['previous_listing'])
- unique_item = {}
- if 'unique_item' in params:
- unique_item = ast.literal_eval(params['unique_item'])
-
if params.next == 'list_shows_1':
file_path = utils.download_catalog(
- url_root,
+ URL_REPLAY,
params.channel_name + '.html')
root_html = open(file_path).read()
root_soup = bs(root_html, 'html.parser')
@@ -62,127 +125,130 @@ def list_shows(params):
)
for category in categories_soup.find_all('a'):
- category_name = category.find('span').get_text().encode('utf-8')
- category_url = category['href'].encode('utf-8')
+ category_name = category.find('span').get_text().encode('utf-8').replace(
+ '\n', ' ').replace('\r', ' ').rstrip('\r\n')
+ category_hash = common.sp.md5(category_name).hexdigest()
+
+ url = category.get('href').encode('utf-8')
shows.append({
'label': category_name,
- 'url': common.plugin.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
- category_url=category_url,
- next='list_shows_cat',
+ category_hash=category_hash,
+ next='list_videos_cat',
+ url=url,
window_title=category_name,
category_name=category_name,
- page='1'
)
})
- elif params.next == 'list_shows_cat':
- url_splited = params.category_url.split('?')
- url_category = url_splited[0] + 'page/' + \
- params.page + '/?' + url_splited[1]
- file_path = utils.download_catalog(
- url_category,
- '%s_%s.html' % (params.channel_name, params.category_name)
- )
- category_html = open(file_path).read()
- category_soup = bs(category_html, 'html.parser')
-
- programs_soup = category_soup.find(
- 'div',
- class_='videos replay'
- )
- for program in programs_soup.find_all('div', class_='program'):
- program_name_url = program.find('h3').find('a')
- program_name = program_name_url.get_text().encode('utf-8')
- if program_name not in unique_item:
- unique_item[program_name] = program_name
- program_url = program_name_url['href'].encode('utf-8')
- program_img = program.find('img')['src'].encode('utf-8')
-
- shows.append({
- 'label': program_name,
- 'thumb': program_img,
- 'url': common.plugin.get_url(
- action='channel_entry',
- program_url=program_url,
- next='list_videos',
- window_title=program_name,
- program_name=program_name
- )
- })
-
- # More videos...
- shows.append({
- 'label': common.addon.get_localized_string(30108),
- 'url': common.plugin.get_url(
- action='channel_entry',
- next='list_shows_cat',
- page=str(int(params.page) + 1),
- window_title=params.window_title,
- update_listing=True,
- unique_item=str(unique_item),
- category_url=params.category_url,
- category_name=params.category_name,
- previous_listing=str(shows)
-
- )
- })
-
- return common.plugin.create_listing(
+ return common.PLUGIN.create_listing(
shows,
sort_methods=(
common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
common.sp.xbmcplugin.SORT_METHOD_LABEL
),
- update_listing='update_listing' in params,
)
-@common.plugin.cached(common.cache_time)
+@common.PLUGIN.cached(common.CACHE_TIME)
def list_videos(params):
+ """Build videos listing"""
videos = []
+ paged = 1
+ url_replay_paged = params.url + '&paged=' + str(paged)
+
file_path = utils.download_catalog(
- params.program_url,
- '%s_%s.html' % (params.channel_name, params.program_name)
+ url_replay_paged,
+ '%s_%s_%s.html' % (params.channel_name, params.category_name, str(paged))
)
program_html = open(file_path).read()
program_soup = bs(program_html, 'html.parser')
- videos_soup = program_soup.find_all('div', class_='box program')
+ videos_soup = program_soup.find_all('div', class_='program sticky video')
+
+ while len(videos_soup) != 0:
+ for video in videos_soup:
+
+ info_video = video.find_all('p')
+
+ video_title = video.find('h3').find('a').get_text().encode('utf-8').replace(
+ '\n', ' ').replace('\r', ' ').rstrip('\r\n') + ' - ' + video.find(
+ 'p', class_="red").get_text().encode(
+ 'utf-8').replace('\n', ' ').replace('\r', ' ').rstrip('\r\n')
+ video_img = video.find('img')['src'].encode('utf-8')
+ video_id = video.find('div', class_="player")['data-id-video'].encode('utf-8')
+ video_duration = 0
+ video_duration_list = str(info_video[3]).replace(
+ "<p><strong>", '').replace("</strong></p>", '').split(':')
+ if len(video_duration_list) > 2:
+ video_duration = int(video_duration_list[0]) * 3600 + int(video_duration_list[1]) \
+ * 60 + int(video_duration_list[2])
+ else:
+ video_duration = int(video_duration_list[0]) * 60 + int(video_duration_list[1])
+
+ # get month and day on the page
+ date_list = str(info_video[2]).replace("<p>", '').replace("</p>", '').split(' ')
+ day = date_list[2]
+ try:
+ mounth = CORRECT_MONTH[date_list[3]]
+ except:
+ mounth = '00'
+ # get year ?
+ year = '2017'
+
+ date = '.'.join((day, mounth, year))
+ aired = '-'.join((year, mounth, day))
+
+ info = {
+ 'video': {
+ 'title': video_title,
+ 'aired': aired,
+ 'date': date,
+ 'duration': video_duration,
+ 'year': year,
+ 'mediatype': 'tvshow'
+ }
+ }
- if len(videos_soup) == 0:
- videos_soup = program_soup.find_all(
- 'div', class_='program sticky video')
+ context_menu = []
+ download_video = (
+ _('Download'),
+ 'XBMC.RunPlugin(' + common.PLUGIN.get_url(
+ action='download_video',
+ video_id=video_id) + ')'
+ )
+ context_menu.append(download_video)
- for video in videos_soup:
- video_title = video.find(
- 'p').get_text().encode('utf-8').replace(
- '\n', ' ').replace('\r', ' ').rstrip('\r\n')
- video_img = video.find('img')['src'].encode('utf-8')
- video_url = video.find('a')['href'].encode('utf-8')
+ videos.append({
+ 'label': video_title,
+ 'thumb': video_img,
+ 'fanart': video_img,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_r',
+ video_id=video_id
+ ),
+ 'is_playable': True,
+ 'info': info,
+ 'context_menu': context_menu
+ })
+ paged = paged + 1
- info = {
- 'video': {
- 'title': video_title,
- 'mediatype': 'tvshow'
- }
- }
+ url_replay_paged = params.url + '&paged=' + str(paged)
+
+ file_path = utils.download_catalog(
+ url_replay_paged,
+ '%s_%s_%s.html' % (params.channel_name, params.category_name, str(paged))
+ )
+ program_html = open(file_path).read()
+ program_soup = bs(program_html, 'html.parser')
- videos.append({
- 'label': video_title,
- 'thumb': video_img,
- 'url': common.plugin.get_url(
- action='channel_entry',
- next='play',
- video_url=video_url
- ),
- 'is_playable': True,
- 'info': info
- })
-
- return common.plugin.create_listing(
+ videos_soup = program_soup.find_all('div', class_='program sticky video')
+
+ return common.PLUGIN.create_listing(
videos,
sort_methods=(
common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
@@ -190,45 +256,95 @@ def list_videos(params):
),
content='tvshows')
+@common.PLUGIN.cached(common.CACHE_TIME)
+def list_live(params):
+ """Build live listing"""
+ lives = []
-@common.plugin.cached(common.cache_time)
-def get_video_url(params):
- video_html = utils.get_webcontent(
- params.video_url
+ title = ''
+ plot = ''
+ duration = 0
+ img = ''
+ url_live = ''
+
+ file_path = utils.download_catalog(
+ URL_INFO_LIVE_JSON,
+ '%s_info_live.json' % (params.channel_name)
)
- video_soup = bs(video_html, 'html.parser')
- video_id = video_soup.find(
- 'div', class_='video')['data-video-id'].encode('utf-8')
-
- url_daily = 'http://www.dailymotion.com/embed/video/' + video_id
-
- html_daily = utils.get_webcontent(
- url_daily,)
-
- html_daily = html_daily.replace('\\', '')
-
- urls_mp4 = re.compile(
- r'{"type":"video/mp4","url":"(.*?)"}],"(.*?)"').findall(html_daily)
-
- for url, quality in urls_mp4:
- if quality == '480':
- url_sd = url
- elif quality == '720':
- url_hd = url
- elif quality == '1080':
- url_hdplus = url
- else:
- continue
- url_default = url
-
- desired_quality = common.plugin.get_setting(
- params.channel_id + '.quality')
-
- if desired_quality == 'HD+' and url_hdplus is not None:
- return url_hdplus
- elif desired_quality == 'HD' and url_hd is not None:
- return url_hd
- elif desired_quality == 'SD' and url_sd is not None:
- return url_sd
+ file_info_live = open(file_path).read()
+ json_parser = json.loads(file_info_live)
+
+ title = json_parser["titre"].encode('utf-8')
+
+ video_id = json_parser["video"].encode('utf-8')
+
+ #url_live = url_dailymotion_embed % video_id
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'plot': plot,
+ 'duration': duration
+ }
+ }
+
+ lives.append({
+ 'label': title,
+ 'fanart': img,
+ 'thumb': img,
+ 'url' : common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_l',
+ video_id=video_id,
+ ),
+ 'is_playable': True,
+ 'info': info
+ })
+
+ return common.PLUGIN.create_listing(
+ lives,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ )
+ )
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def get_video_url(params):
+ """Get video URL and start video player"""
+ url_video = URL_DAILYMOTION_EMBED % params.video_id
+
+ desired_quality = common.PLUGIN.get_setting('quality')
+
+ if params.next == 'download_video':
+ return url_video
else:
- return url_default
+ html_video = utils.get_webcontent(url_video)
+ html_video = html_video.replace('\\', '')
+
+ if params.next == 'play_l':
+ all_url_video = re.compile(
+ r'{"type":"application/x-mpegURL","url":"(.*?)"').findall(html_video)
+ # Just One Quality
+ return all_url_video[0]
+ elif params.next == 'play_r':
+ all_url_video = re.compile(r'{"type":"video/mp4","url":"(.*?)"').findall(html_video)
+ if desired_quality == "DIALOG":
+ all_datas_videos = []
+ for datas in all_url_video:
+ new_list_item = common.sp.xbmcgui.ListItem()
+ datas_quality = re.search('H264-(.+?)/', datas).group(1)
+ new_list_item.setLabel('H264-' + datas_quality)
+ new_list_item.setPath(datas)
+ all_datas_videos.append(new_list_item)
+
+ seleted_item = common.sp.xbmcgui.Dialog().select("Choose Stream", all_datas_videos)
+
+ return all_datas_videos[seleted_item].getPath().encode('utf-8')
+ elif desired_quality == 'BEST':
+ #Last video in the Best
+ for datas in all_url_video:
+ url = datas
+ return url
+ else:
+ return all_url_video[0]
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/fr/pluzz.py b/plugin.video.catchuptvandmore/resources/lib/channels/fr/pluzz.py
index a64d7d0..156edd2 100644..100755
--- a/plugin.video.catchuptvandmore/resources/lib/channels/fr/pluzz.py
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/fr/pluzz.py
@@ -21,36 +21,51 @@
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""
+# TO DO
# Liste A à Z
# Si FR3 ou FR1 : Régions
-
import json
+import ast
from resources.lib import utils
from resources.lib import common
-import ast
-channel_catalog = 'http://pluzz.webservices.francetelevisions.fr/' \
+
+# Initialize GNU gettext emulation in addon
+# This allows to use UI strings from addon’s English
+# strings.po file instead of numeric codes
+_ = common.ADDON.initialize_gettext()
+
+CHANNEL_CATALOG = 'http://pluzz.webservices.francetelevisions.fr/' \
'pluzz/liste/type/replay/nb/10000/chaine/%s'
-# channel_catalog = 'https://pluzz.webservices.francetelevisions.fr/' \
+
+CHANNEL_LIVE = 'http://pluzz.webservices.francetelevisions.fr/' \
+ 'pluzz/liste/type/live/nb/10000/chaine/%s'
+
+# CHANNEL_CATALOG = 'https://pluzz.webservices.francetelevisions.fr/' \
# 'mobile/liste/type/replay/chaine/%s/nb/20/debut/%s'
# page inc: 20
-show_info = 'http://webservices.francetelevisions.fr/tools/' \
+SHOW_INFO = 'http://webservices.francetelevisions.fr/tools/' \
'getInfosOeuvre/v2/?idDiffusion=%s&catalogue=Pluzz'
-url_img = 'http://refonte.webservices.francetelevisions.fr%s'
+LIVE_INFO = 'http://webservices.francetelevisions.fr/tools/' \
+ 'getInfosOeuvre/v2/?idDiffusion=SIM_%s'
+
+HDFAUTH_URL = 'http://hdfauth.francetv.fr/esi/TA?format=json&url=%s'
+
+URL_IMG = 'http://refonte.webservices.francetelevisions.fr%s'
-url_search = 'https://pluzz.webservices.francetelevisions.fr/' \
+URL_SEARCH = 'https://pluzz.webservices.francetelevisions.fr/' \
'mobile/recherche/nb/20/tri/date/requete/%s/debut/%s'
-url_alpha = 'https://pluzz.webservices.francetelevisions.fr/' \
+URL_ALPHA = 'https://pluzz.webservices.francetelevisions.fr/' \
'mobile/liste/type/replay/tri/alpha/sens/%s/nb/100/' \
'debut/%s/lastof/1'
# sens: asc or desc
# page inc: 100
-categories_display = {
+CATEGORIES_DISPLAY = {
"france2": "France 2",
"france3": "France 3",
"france4": "France 4",
@@ -76,58 +91,103 @@ categories_display = {
"culture": "Culture"
}
-categories = {
+CATEGORIES = {
'Toutes catégories': 'https://pluzz.webservices.francetelevisions.fr/'
- 'mobile/liste/type/replay/chaine/%s/nb/20/debut/%s',
+ 'mobile/liste/type/replay/chaine/%s/nb/20/debut/%s',
'Info': 'https://pluzz.webservices.francetelevisions.fr/'
- 'mobile/liste/type/replay/rubrique/info/nb/20/debut/%s',
+ 'mobile/liste/type/replay/rubrique/info/nb/20/debut/%s',
'Documentaire': 'https://pluzz.webservices.francetelevisions.fr/'
- 'mobile/liste/type/replay/rubrique/documentaire/nb/20/debut/%s',
+ 'mobile/liste/type/replay/rubrique/documentaire/nb/20/debut/%s',
'Série & Fiction': 'https://pluzz.webservices.francetelevisions.fr/'
- 'mobile/liste/type/replay/rubrique/seriefiction/nb/20/debut/%s',
+ 'mobile/liste/type/replay/rubrique/seriefiction/nb/20/debut/%s',
'Magazine': 'https://pluzz.webservices.francetelevisions.fr/'
- 'mobile/liste/type/replay/rubrique/magazine/nb/20/debut/%s',
+ 'mobile/liste/type/replay/rubrique/magazine/nb/20/debut/%s',
'Culture': 'https://pluzz.webservices.francetelevisions.fr/'
- 'mobile/liste/type/replay/rubrique/culture/nb/20/debut/%s',
+ 'mobile/liste/type/replay/rubrique/culture/nb/20/debut/%s',
'Jeunesse': 'https://pluzz.webservices.francetelevisions.fr/'
- 'mobile/liste/type/replay/rubrique/jeunesse/nb/20/debut/%s',
+ 'mobile/liste/type/replay/rubrique/jeunesse/nb/20/debut/%s',
'Divertissement': 'https://pluzz.webservices.francetelevisions.fr/'
- 'mobile/liste/type/replay/rubrique/divertissement/nb/20/debut/%s',
+ 'mobile/liste/type/replay/rubrique/divertissement/nb/20/debut/%s',
'Sport': 'https://pluzz.webservices.francetelevisions.fr/'
- 'mobile/liste/type/replay/rubrique/sport/nb/20/debut/%s',
+ 'mobile/liste/type/replay/rubrique/sport/nb/20/debut/%s',
'Jeu': 'https://pluzz.webservices.francetelevisions.fr/'
- 'mobile/liste/type/replay/rubrique/jeu/nb/20/debut/%s',
+ 'mobile/liste/type/replay/rubrique/jeu/nb/20/debut/%s',
'Version multilingue (VM)': 'https://pluzz.webservices.francetelevisions.fr/'
- 'mobile/liste/filtre/multilingue/type/replay/nb/20/debut/%s',
+ 'mobile/liste/filtre/multilingue/type/replay/nb/20/debut/%s',
'Sous-titrés': 'https://pluzz.webservices.francetelevisions.fr/'
- 'mobile/liste/filtre/soustitrage/type/replay/nb/20/debut/%s',
+ 'mobile/liste/filtre/soustitrage/type/replay/nb/20/debut/%s',
'Audiodescription (AD)': 'https://pluzz.webservices.francetelevisions.fr/'
- 'mobile/liste/filtre/audiodescription/type/replay/nb/20/debut/%s',
+ 'mobile/liste/filtre/audiodescription/type/replay/nb/20/debut/%s',
'Tous publics': 'https://pluzz.webservices.francetelevisions.fr/'
- 'mobile/liste/type/replay/filtre/touspublics/nb/20/debut/%s'
+ 'mobile/liste/type/replay/filtre/touspublics/nb/20/debut/%s'
}
def channel_entry(params):
- if 'list_shows' in params.next:
+ """Entry function of the module"""
+ if 'root' in params.next:
+ return root(params)
+ elif 'list_shows' in params.next:
return list_shows(params)
elif 'list_videos' in params.next:
return list_videos(params)
+ elif 'live' in params.next:
+ return list_live(params)
elif 'play' in params.next:
- return get_video_URL(params)
+ return get_video_url(params)
elif 'search' in params.next:
return search(params)
+ return None
-@common.plugin.cached(common.cache_time)
+@common.PLUGIN.cached(common.CACHE_TIME)
def change_to_nicer_name(original_name):
- if original_name in categories_display:
- return categories_display[original_name]
+ """Convert id name to label name"""
+ if original_name in CATEGORIES_DISPLAY:
+ return CATEGORIES_DISPLAY[original_name]
return original_name
-@common.plugin.cached(common.cache_time)
+@common.PLUGIN.cached(common.CACHE_TIME)
+def root(params):
+ """Add Replay and Live in the listing"""
+ modes = []
+
+ # Add Replay
+ if params.channel_name != 'franceinfo':
+ modes.append({
+ 'label' : 'Replay',
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_shows_1',
+ category='%s Replay' % params.channel_name.upper(),
+ window_title='%s Replay' % params.channel_name.upper()
+ ),
+ })
+
+ # Add Live
+ if params.channel_name != 'la_1ere':
+ modes.append({
+ 'label' : _('Live TV'),
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='live_cat',
+ category='%s Live TV' % params.channel_name.upper(),
+ window_title='%s Live TV' % params.channel_name.upper()
+ ),
+ })
+
+ return common.PLUGIN.create_listing(
+ modes,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ ),
+ )
+
+@common.PLUGIN.cached(common.CACHE_TIME)
def list_shows(params):
+ """Build categories listing"""
shows = []
if 'previous_listing' in params:
shows = ast.literal_eval(params['previous_listing'])
@@ -148,7 +208,8 @@ def list_shows(params):
# Level 0
if params.next == 'list_shows_1':
- url_json = channel_catalog % (real_channel)
+
+ url_json = CHANNEL_CATALOG % (real_channel)
file_path = utils.download_catalog(
url_json,
'%s.json' % (
@@ -164,7 +225,7 @@ def list_shows(params):
shows.append({
'label': rubrique_title,
- 'url': common.plugin.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
rubrique=rubrique,
next='list_shows_2_cat',
@@ -174,57 +235,57 @@ def list_shows(params):
# Last videos
shows.append({
- 'label': common.addon.get_localized_string(30104),
- 'url': common.plugin.get_url(
+ 'label': common.ADDON.get_localized_string(30104),
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
next='list_shows_last',
page='0',
- window_title=common.addon.get_localized_string(30104)
+ window_title=common.ADDON.get_localized_string(30104)
)
})
# Search
shows.append({
- 'label': common.addon.get_localized_string(30103),
- 'url': common.plugin.get_url(
+ 'label': common.ADDON.get_localized_string(30103),
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
next='search',
page='0',
- window_title=common.addon.get_localized_string(30103)
+ window_title=common.ADDON.get_localized_string(30103)
)
})
# from A to Z
shows.append({
- 'label': common.addon.get_localized_string(30105),
- 'url': common.plugin.get_url(
+ 'label': common.ADDON.get_localized_string(30105),
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
next='list_shows_from_a_to_z',
- window_title=common.addon.get_localized_string(30105)
+ window_title=common.ADDON.get_localized_string(30105)
)
})
# level 1
elif 'list_shows_from_a_to_z' in params.next:
shows.append({
- 'label': common.addon.get_localized_string(30106),
- 'url': common.plugin.get_url(
+ 'label': common.ADDON.get_localized_string(30106),
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
- next='list_shows_2_from_a_to_z_categories',
+ next='list_shows_2_from_a_to_z_CATEGORIES',
page='0',
- url=url_alpha % ('asc', '%s'),
+ url=URL_ALPHA % ('asc', '%s'),
sens='asc',
rubrique='no_rubrique',
window_title=params.window_title
)
})
shows.append({
- 'label': common.addon.get_localized_string(30107),
- 'url': common.plugin.get_url(
+ 'label': common.ADDON.get_localized_string(30107),
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
- next='list_shows_2_from_a_to_z_categories',
+ next='list_shows_2_from_a_to_z_CATEGORIES',
page='0',
- url=url_alpha % ('desc', '%s'),
+ url=URL_ALPHA % ('desc', '%s'),
sens='desc',
rubrique='no_rubrique',
window_title=params.window_title
@@ -233,12 +294,12 @@ def list_shows(params):
# level 1
elif 'list_shows_last' in params.next:
- for title, url in categories.iteritems():
+ for title, url in CATEGORIES.iteritems():
if 'Toutes catégories' in title:
url = url % (params.channel_name, '%s')
shows.append({
'label': title,
- 'url': common.plugin.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
next='list_videos_last',
page='0',
@@ -251,13 +312,13 @@ def list_shows(params):
# level 1 or 2
elif 'list_shows_2' in params.next:
if 'list_shows_2_cat' in params.next:
- url_json = channel_catalog % (real_channel)
+ url_json = CHANNEL_CATALOG % (real_channel)
file_path = utils.download_catalog(
url_json,
'%s.json' % (
params.channel_name))
- elif 'list_shows_2_from_a_to_z_categories' in params.next:
- url_json = url_alpha % (params.sens, params.page)
+ elif 'list_shows_2_from_a_to_z_CATEGORIES' in params.next:
+ url_json = URL_ALPHA % (params.sens, params.page)
file_path = utils.download_catalog(
url_json,
'%s_%s_%s_alpha.json' % (
@@ -281,7 +342,7 @@ def list_shows(params):
id_programme = emission['id_emission'].encode('utf-8')
if id_programme not in unique_item:
unique_item[id_programme] = id_programme
- icon = url_img % (emission['image_large'])
+ icon = URL_IMG % (emission['image_large'])
genre = emission['genre']
accroche_programme = emission['accroche_programme']
@@ -296,7 +357,7 @@ def list_shows(params):
'label': titre_programme,
'thumb': icon,
'fanart': icon,
- 'url': common.plugin.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
next='list_videos_1',
id_programme=id_programme,
@@ -307,13 +368,13 @@ def list_shows(params):
),
'info': info
})
- if params.next == 'list_shows_2_from_a_to_z_categories':
+ if params.next == 'list_shows_2_from_a_to_z_CATEGORIES':
# More videos...
shows.append({
- 'label': common.addon.get_localized_string(30100),
- 'url': common.plugin.get_url(
+ 'label': common.ADDON.get_localized_string(30100),
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
- next='list_shows_2_from_a_to_z_categories',
+ next='list_shows_2_from_a_to_z_CATEGORIES',
sens=params.sens,
page=str(int(params.page) + 100),
window_title=params.window_title,
@@ -323,7 +384,7 @@ def list_shows(params):
)
})
- return common.plugin.create_listing(
+ return common.PLUGIN.create_listing(
shows,
sort_methods=(
common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
@@ -333,15 +394,16 @@ def list_shows(params):
)
-@common.plugin.cached(common.cache_time)
+@common.PLUGIN.cached(common.CACHE_TIME)
def list_videos(params):
+ """Build videos listing"""
videos = []
if 'previous_listing' in params:
videos = ast.literal_eval(params['previous_listing'])
if 'search' in params.next:
file_path = utils.download_catalog(
- url_search % (params.query, params.page),
+ URL_SEARCH % (params.query, params.page),
'%s_%s_search.json' % (params.channel_name, params.query),
force_dl=True
)
@@ -366,7 +428,7 @@ def list_videos(params):
else:
file_path = utils.download_catalog(
- channel_catalog % params.channel_name,
+ CHANNEL_CATALOG % params.channel_name,
'%s.json' % params.channel_name
)
file_prgm = open(file_path).read()
@@ -398,40 +460,40 @@ def list_videos(params):
continue
file_prgm = utils.get_webcontent(
- show_info % (emission['id_diffusion']))
+ SHOW_INFO % (emission['id_diffusion']))
if(file_prgm != ''):
- json_parserShow = json.loads(file_prgm)
- if json_parserShow['synopsis']:
- plot = json_parserShow['synopsis'].encode('utf-8')
- if json_parserShow['diffusion']['date_debut']:
- date = json_parserShow['diffusion']['date_debut']
+ json_parser_show = json.loads(file_prgm)
+ if json_parser_show['synopsis']:
+ plot = json_parser_show['synopsis'].encode('utf-8')
+ if json_parser_show['diffusion']['date_debut']:
+ date = json_parser_show['diffusion']['date_debut']
date = date.encode('utf-8')
- if json_parserShow['real_duration']:
- duration = int(json_parserShow['real_duration'])
- if json_parserShow['titre']:
- title = json_parserShow['titre'].encode('utf-8')
- if json_parserShow['sous_titre']:
+ if json_parser_show['real_duration']:
+ duration = int(json_parser_show['real_duration'])
+ if json_parser_show['titre']:
+ title = json_parser_show['titre'].encode('utf-8')
+ if json_parser_show['sous_titre']:
title = ' '.join((
title,
'- [I]',
- json_parserShow['sous_titre'].encode('utf-8'),
+ json_parser_show['sous_titre'].encode('utf-8'),
'[/I]'))
- if json_parserShow['genre'] != '':
+ if json_parser_show['genre'] != '':
genre = \
- json_parserShow['genre'].encode('utf-8')
+ json_parser_show['genre'].encode('utf-8')
episode = 0
- if 'episode' in json_parserShow:
- episode = json_parserShow['episode']
+ if 'episode' in json_parser_show:
+ episode = json_parser_show['episode']
season = 0
- if 'saison' in json_parserShow:
- season = json_parserShow['saison']
+ if 'saison' in json_parser_show:
+ season = json_parser_show['saison']
cast = []
director = ''
- personnes = json_parserShow['personnes']
+ personnes = json_parser_show['personnes']
for personne in personnes:
fonctions = ' '.join(
x.encode('utf-8') for x in personne['fonctions'])
@@ -452,8 +514,8 @@ def list_videos(params):
# date : string (%d.%m.%Y / 01.01.2009)
# aired : string (2008-12-07)
- # image = url_img % (json_parserShow['image'])
- image = json_parserShow['image_secure']
+ # image = URL_IMG % (json_parserShow['image'])
+ image = json_parser_show['image_secure']
info = {
'video': {
@@ -472,24 +534,36 @@ def list_videos(params):
}
}
+ # Nouveau pour ajouter le menu pour télécharger la vidéo
+ context_menu = []
+ download_video = (
+ _('Download'),
+ 'XBMC.RunPlugin(' + common.PLUGIN.get_url(
+ action='download_video',
+ id_diffusion=id_diffusion) + ')'
+ )
+ context_menu.append(download_video)
+ # Fin
+
videos.append({
'label': title,
'fanart': image,
'thumb': image,
- 'url': common.plugin.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
- next='play',
+ next='play_r',
id_diffusion=id_diffusion
),
'is_playable': True,
- 'info': info
+ 'info': info,
+ 'context_menu': context_menu # A ne pas oublier pour ajouter le bouton "Download" à chaque vidéo
})
if 'search' in params.next:
# More videos...
videos.append({
- 'label': common.addon.get_localized_string(30100),
- 'url': common.plugin.get_url(
+ 'label': common.ADDON.get_localized_string(30100),
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
next='list_videos_search',
query=params.query,
@@ -504,8 +578,8 @@ def list_videos(params):
elif 'last' in params.next:
# More videos...
videos.append({
- 'label': common.addon.get_localized_string(30100),
- 'url': common.plugin.get_url(
+ 'label': common.ADDON.get_localized_string(30100),
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
url=params.url,
next=params.next,
@@ -518,7 +592,7 @@ def list_videos(params):
})
- return common.plugin.create_listing(
+ return common.PLUGIN.create_listing(
videos,
sort_methods=(
common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
@@ -532,29 +606,202 @@ def list_videos(params):
update_listing='update_listing' in params,
)
+@common.PLUGIN.cached(common.CACHE_TIME)
+def list_live(params):
+ """Build live listing"""
+ lives = []
-@common.plugin.cached(common.cache_time)
-def get_video_URL(params):
- file_prgm = utils.get_webcontent(show_info % (params.id_diffusion))
+ real_channel = params.channel_name
+
+ title = ''
+ plot = ''
+ duration = 0
+ date = ''
+ genre = ''
+
+ if real_channel != 'franceinfo':
+ url_json_live = CHANNEL_LIVE % (real_channel)
+ file_path_live = utils.download_catalog(
+ url_json_live,
+ 'live_%s.json' % (
+ params.channel_name))
+ file_prgm_live = open(file_path_live).read()
+ json_parser_live = json.loads(file_prgm_live)
+ emissions_live = json_parser_live['reponse']['emissions']
+
+ for emission in emissions_live:
+ id_programme = emission['id_programme'].encode('utf-8')
+ if id_programme == '':
+ id_programme = emission['id_emission'].encode('utf-8')
+ id_diffusion = emission['id_diffusion']
+ chaine_id = emission['chaine_id'].encode('utf-8')
+
+ start_time_emission = 'Début : ' + emission['date_diffusion'].split('T')[1].encode('utf-8')
+
+ if emission['accroche']:
+ plot = start_time_emission + '\n ' + emission['accroche'].encode('utf-8')
+ elif emission['accroche_programme']:
+ plot = start_time_emission + '\n ' + emission['accroche_programme'].encode('utf-8')
+ if emission['date_diffusion']:
+ date = emission['date_diffusion']
+ date = date.encode('utf-8')
+ if emission['duree']:
+ duration = int(emission['duree']) * 60
+ if emission['titre']:
+ title = emission['titre'].encode('utf-8')
+
+ if emission['genre'] != '':
+ genre = \
+ emission['genre'].encode('utf-8')
+
+ episode = 0
+ if 'episode' in emission:
+ episode = emission['episode']
+
+ season = 0
+ if 'saison' in emission:
+ season = emission['saison']
+
+ cast = []
+ director = ''
+ if emission['realisateurs'] in emission:
+ director = emission['realisateurs'].encode('utf-8')
+ if emission['acteurs'] in emission:
+ cast.append(emission['acteurs'].encode('utf-8'))
+
+ year = int(date[:4])
+ month = int(date[5:7])
+ day = int(date[8:10])
+ aired = '-'.join((str(year), str(month), str(day)))
+
+
+ image = URL_IMG % (emission['image_large'])
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'plot': plot,
+ 'aired': aired,
+ 'date': date,
+ 'duration': duration,
+ #year': year,
+ 'genre': genre,
+ 'mediatype': 'tvshow',
+ 'season': season,
+ 'episode': episode,
+ 'cast': cast,
+ 'director': director
+ }
+ }
+
+ lives.append({
+ 'label': title,
+ 'fanart': image,
+ 'thumb': image,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_l',
+ id_diffusion=id_diffusion
+ ),
+ 'is_playable': True,
+ 'info': info
+ })
+ else:
+
+ title = '%s Live' % params.channel_name
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'plot': plot,
+ 'date': date,
+ 'duration': duration
+ }
+ }
+
+ lives.append({
+ 'label': title,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_l'
+ ),
+ 'is_playable': True,
+ 'info': info
+ })
+
+
+ return common.PLUGIN.create_listing(
+ lives,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ )
+ )
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def get_video_url(params):
+ """Get video URL and start video player"""
+
+ if params.next == 'play_r' or params.next == 'download_video':
+ file_prgm = utils.get_webcontent(SHOW_INFO % (params.id_diffusion))
json_parser = json.loads(file_prgm)
- url_HD = ''
- url_SD = ''
+
+ desired_quality = common.PLUGIN.get_setting('quality')
+
+ url_selected = ''
+
+ if desired_quality == "DIALOG":
+ all_datas_videos = []
+
+ for video in json_parser['videos']:
+ if video['format'] == 'hls_v5_os' or video['format'] == 'm3u8-download':
+ new_list_item = common.sp.xbmcgui.ListItem()
+ if video['format'] == 'hls_v5_os':
+ new_list_item.setLabel("HD")
+ else:
+ new_list_item.setLabel("SD")
+ new_list_item.setPath(video['url'])
+ all_datas_videos.append(new_list_item)
+
+ seleted_item = common.sp.xbmcgui.Dialog().select(
+ _('Choose video quality'),
+ all_datas_videos)
+
+ if seleted_item == -1:
+ return None
+
+ url_selected = all_datas_videos[seleted_item].getPath()
+
+ elif desired_quality == "BEST":
+ for video in json_parser['videos']:
+ if video['format'] == 'hls_v5_os':
+ url_selected = video['url']
+ else:
+ for video in json_parser['videos']:
+ if video['format'] == 'm3u8-download':
+ url_selected = video['url']
+
+ return url_selected
+
+ elif params.next == 'play_l':
+
+ file_prgm = utils.get_webcontent(LIVE_INFO % (params.channel_name))
+ json_parser = json.loads(file_prgm)
+
+ url_selected = ''
+
for video in json_parser['videos']:
if video['format'] == 'hls_v5_os':
- url_HD = video['url']
- if video['format'] == 'm3u8-download':
- url_SD = video['url']
+ url_protected = video['url']
- desired_quality = common.plugin.get_setting(
- params.channel_id + '.quality')
+ file_prgm2 = utils.get_webcontent(HDFAUTH_URL % (url_protected))
+ json_parser2 = json.loads(file_prgm2)
- if desired_quality == 'HD' and url_HD is not None:
- return url_HD
- else:
- return url_SD
+ return json_parser2['url']
def search(params):
+ """Show keyboard to search a program"""
keyboard = common.sp.xbmc.Keyboard(
default='',
title='',
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/fr/publicsenat.py b/plugin.video.catchuptvandmore/resources/lib/channels/fr/publicsenat.py
new file mode 100755
index 0000000..33d18d6
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/fr/publicsenat.py
@@ -0,0 +1,444 @@
+# -*- coding: utf-8 -*-
+"""
+ Catch-up TV & More
+ Original work (C) JUL1EN094, SPM, SylvainCecchetto
+ Copyright (C) 2016 SylvainCecchetto
+
+ This file is part of Catch-up TV & More.
+
+ Catch-up TV & More is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Catch-up TV & More is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 Catch-up TV & More; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+import re
+import ast
+from bs4 import BeautifulSoup as bs
+from resources.lib import utils
+from resources.lib import common
+
+# TO DO
+# Add info LIVE TV
+
+# Initialize GNU gettext emulation in addon
+# This allows to use UI strings from addon’s English
+# strings.po file instead of numeric codes
+_ = common.ADDON.initialize_gettext()
+
+URL_ROOT = 'https://www.publicsenat.fr'
+
+URL_LIVE_SITE = 'https://www.publicsenat.fr/direct'
+
+URL_DAILYMOTION_EMBED = 'http://www.dailymotion.com/embed/video/%s'
+
+def channel_entry(params):
+ """Entry function of the module"""
+ if 'root' in params.next:
+ return root(params)
+ elif 'list_shows' in params.next:
+ return list_shows(params)
+ elif 'list_videos' in params.next:
+ return list_videos(params)
+ elif 'live' in params.next:
+ return list_live(params)
+ elif 'play' in params.next:
+ return get_video_url(params)
+
+CATEGORIES = {
+ 'https://www.publicsenat.fr/recherche/type/episode/' \
+ 'field_theme/politique-4127?sort_by=pse_search_date_publication' : 'Politique',
+ 'https://www.publicsenat.fr/recherche/type/episode/' \
+ 'field_theme/societe-4126?sort_by=pse_search_date_publication' : 'Société',
+ 'https://www.publicsenat.fr/recherche/type/episode/' \
+ 'field_theme/debat-4128?sort_by=pse_search_date_publication' : 'Débat'
+}
+
+CORRECT_MONTH = {
+ 'janvier' : '01',
+ 'février' : '02',
+ 'mars' : '03',
+ 'avril' : '04',
+ 'mai' : '05',
+ 'juin' : '06',
+ 'juillet' : '07',
+ 'août' : '08',
+ 'septembre' : '09',
+ 'octobre' : '10',
+ 'novembre' : '11',
+ 'décembre' : '12'
+}
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def root(params):
+ """Add Replay and Live in the listing"""
+ modes = []
+
+ # Add Replay
+ modes.append({
+ 'label' : 'Replay',
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_shows_1',
+ category='%s Replay' % params.channel_name.upper(),
+ window_title='%s Replay' % params.channel_name.upper()
+ ),
+ })
+
+ # Add Live
+ modes.append({
+ 'label' : 'Live TV',
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='live_cat',
+ category='%s Live TV' % params.channel_name.upper(),
+ window_title='%s Live TV' % params.channel_name.upper()
+ ),
+ })
+
+ return common.PLUGIN.create_listing(
+ modes,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ ),
+ )
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def list_shows(params):
+ """Build shows listing"""
+ shows = []
+
+ if params.next == 'list_shows_1':
+
+ for category_url, category_name in CATEGORIES.iteritems():
+
+ shows.append({
+ 'label': category_name,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ category_url=category_url,
+ category_name=category_name,
+ page='0',
+ next='list_videos_1',
+ window_title=category_name
+ )
+ })
+
+ return common.PLUGIN.create_listing(
+ shows,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ )
+ )
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def list_videos(params):
+ """Build videos listing"""
+ videos = []
+
+ if 'previous_listing' in params:
+ videos = ast.literal_eval(params['previous_listing'])
+
+ url = params.category_url + '&page=' + str(params.page)
+
+ file_path = utils.download_catalog(
+ url,
+ '%s_%s_%s.html' % (
+ params.channel_name,
+ params.category_name,
+ params.page))
+ root_html = open(file_path).read()
+ root_soup = bs(root_html, 'html.parser')
+
+ if params.category_name == 'Politique':
+ video_soup = root_soup.find_all(
+ 'article',
+ class_="node node-episode node-episode-pse-search-result theme-4127 clearfix")
+ elif params.category_name == 'Société':
+ video_soup = root_soup.find_all(
+ 'article',
+ class_="node node-episode node-episode-pse-search-result theme-4126 clearfix")
+ elif params.category_name == 'Débat':
+ video_soup = root_soup.find_all(
+ 'article',
+ class_="node node-episode node-episode-pse-search-result theme-4128 clearfix")
+
+ for video in video_soup:
+
+ # Test Existing Video
+ if video.find('div', class_="content").find( \
+ 'div', class_="right").find('div', class_="wrapper-duree"):
+
+ title = ''
+ if video.find('div', class_="content").find( \
+ 'div',
+ class_="field field-name-title-field field-type-text field-label-hidden"):
+ title = video.find(
+ 'div',
+ class_="content"
+ ).find(
+ 'div',
+ class_="field field-name-field-ref-emission field-type-entityreference field-label-hidden"
+ ).find(
+ 'div',
+ class_="field-items"
+ ).find(
+ 'div',
+ class_="field-item even"
+ ).get_text().encode('utf-8') + ' - ' \
+ + video.find(
+ 'div',
+ class_="content"
+ ).find(
+ 'div',
+ class_="field field-name-title-field field-type-text field-label-hidden"
+ ).find(
+ 'div',
+ class_="field-items"
+ ).find(
+ 'div',
+ class_="field-item even"
+ ).get_text().encode('utf-8')
+ else:
+ title = video.find(
+ 'div',
+ class_="content"
+ ).find(
+ 'div',
+ class_="field field-name-field-ref-emission field-type-entityreference field-label-hidden"
+ ).find(
+ 'div',
+ class_="field-items"
+ ).find(
+ 'div',
+ class_="field-item even"
+ ).get_text().encode('utf-8')
+
+ img = ''
+ if video.find('div', class_="content").find('div', class_="wrapper-visuel" \
+ ).find('div', class_="scald-atom video").find('div', \
+ class_="field field-name-scald-thumbnail field-type-image field-label-hidden"):
+ img = video.find(
+ 'div',
+ class_="content"
+ ).find(
+ 'div',
+ class_="wrapper-visuel"
+ ).find(
+ 'div',
+ class_="scald-atom video"
+ ).find(
+ 'div',
+ class_="field field-name-scald-thumbnail field-type-image field-label-hidden"
+ ).find(
+ 'div',
+ class_="field-items"
+ ).find(
+ 'div',
+ class_="field-item even"
+ ).find('img').get('src')
+
+ plot = ''
+ if video.find('div', class_="content").find('div', \
+ class_="field field-name-field-contenu field-type-text-long field-label-hidden"):
+ plot = video.find(
+ 'div',
+ class_="content"
+ ).find(
+ 'div',
+ class_="field field-name-field-contenu field-type-text-long field-label-hidden"
+ ).find(
+ 'div',
+ class_="field-items"
+ ).find(
+ 'div',
+ class_="field-item even"
+ ).get_text().encode('utf-8')
+
+
+ value_date = video.find(
+ 'div',
+ class_="content"
+ ).find('div', class_="first-diffusion").get_text().encode('utf-8')
+ date = value_date.split(' ')
+ day = date[2]
+ try:
+ mounth = CORRECT_MONTH[date[3]]
+ except:
+ mounth = '00'
+ year = date[4]
+
+ date = '.'.join((day, mounth, year))
+ aired = '-'.join((year, mounth, day))
+
+ duration = 0
+ duration = int(video.find('div', class_="content").find(
+ 'div', class_="right").find(
+ 'div',
+ class_="wrapper-duree").get_text().encode('utf-8')[:-3]) * 60
+
+
+ url_video = URL_ROOT + video.find(
+ 'div', class_="content").find('a').get('href').encode('utf-8')
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'aired': aired,
+ 'date': date,
+ 'duration': duration,
+ 'year': year,
+ 'plot' : plot,
+ 'mediatype': 'tvshow'
+ }
+ }
+
+ context_menu = []
+ download_video = (
+ _('Download'),
+ 'XBMC.RunPlugin(' + common.PLUGIN.get_url(
+ action='download_video',
+ url_video=url_video) + ')'
+ )
+ context_menu.append(download_video)
+
+ videos.append({
+ 'label': title,
+ 'thumb': img,
+ 'fanart': img,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_r',
+ url_video=url_video
+ ),
+ 'is_playable': True,
+ 'info': info,
+ 'context_menu': context_menu
+ })
+
+ # More videos...
+ videos.append({
+ 'label': common.ADDON.get_localized_string(30100),
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ category_url=params.category_url,
+ category_name=params.category_name,
+ next='list_videos_1',
+ page=str(int(params.page) + 1),
+ update_listing=True,
+ previous_listing=str(videos)
+ ),
+ })
+
+ return common.PLUGIN.create_listing(
+ videos,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_PLAYCOUNT,
+ common.sp.xbmcplugin.SORT_METHOD_DATE,
+ common.sp.xbmcplugin.SORT_METHOD_DURATION,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE
+ ),
+ content='tvshows',
+ update_listing='update_listing' in params,
+ )
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def list_live(params):
+ """Build live listing"""
+ lives = []
+
+ title = ''
+ plot = ''
+ duration = 0
+ img = ''
+ url_live = ''
+
+ html_live = utils.get_webcontent(URL_LIVE_SITE)
+ root_soup = bs(html_live, 'html.parser')
+ live_soup = root_soup.find(
+ 'div',
+ class_='iframe-responsive')
+
+ url_live = live_soup.find('iframe').get('src')
+
+ title = '%s Live' % params.channel_name.upper()
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'plot': plot,
+ 'duration': duration
+ }
+ }
+
+ lives.append({
+ 'label': title,
+ 'fanart': img,
+ 'thumb': img,
+ 'url' : common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_l',
+ url=url_live,
+ ),
+ 'is_playable': True,
+ 'info': info
+ })
+
+ return common.PLUGIN.create_listing(
+ lives,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ )
+ )
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def get_video_url(params):
+ """Get video URL and start video player"""
+ if params.next == 'play_r' or params.next == 'download_video':
+
+ url = ''
+
+ html_video = utils.get_webcontent(params.url_video)
+ ur_video_soup = bs(html_video, 'html.parser')
+ urlembeded_videos_soup = ur_video_soup.find_all('iframe')
+
+ for url in urlembeded_videos_soup:
+ url_video_embed = url.get('src').encode('utf-8')
+ break # get first video hard to find by another method
+
+
+ url_video_embed_http = url_video_embed
+ if params.next == 'download_video':
+ return url_video_embed_http
+ html_video = utils.get_webcontent(url_video_embed_http)
+ html_video = html_video.replace('\\', '')
+
+ all_url_video = re.compile(r'"type":"video/mp4","url":"(.*?)"').findall(html_video)
+ for datas in all_url_video:
+ url = datas
+
+ return url
+
+ elif params.next == 'play_l':
+
+ html_live = utils.get_webcontent(params.url)
+ html_live = html_live.replace('\\', '')
+
+ url_live = re.compile(
+ r'{"type":"application/x-mpegURL","url":"(.*?)"}]}').findall(html_live)
+
+ # Just one flux no quality to choose
+ return url_live[0]
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/fr/tf1.py b/plugin.video.catchuptvandmore/resources/lib/channels/fr/tf1.py
index ae6053c..79c524c 100644..100755
--- a/plugin.video.catchuptvandmore/resources/lib/channels/fr/tf1.py
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/fr/tf1.py
@@ -21,101 +21,194 @@
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""
+import json
from bs4 import BeautifulSoup as bs
from resources.lib import utils
from resources.lib import common
-import json
-url_root = "http://www.tf1.fr/"
-url_time = 'http://www.wat.tv/servertime2/'
-url_token = 'http://api.wat.tv/services/Delivery'
+# TO DO
+# Rework QUALITY
+# Replay LCI (Add date, aired, year, fix some elements)
+
+# Initialize GNU gettext emulation in addon
+# This allows to use UI strings from addon’s English
+# strings.po file instead of numeric codes
+_ = common.ADDON.initialize_gettext()
+
+URL_ROOT = "http://www.tf1.fr/"
+URL_TIME = 'http://www.wat.tv/servertime2/'
+URL_TOKEN = 'http://api.wat.tv/services/Delivery'
+URL_LIVE_TV = 'https://www.tf1.fr/%s/direct'
+URL_LIVE_INFO = 'https://api.mytf1.tf1.fr/live/2/%s'
+URL_API_IMAGE = 'http://api.mytf1.tf1.fr/image'
-secret_key = 'W3m0#1mFI'
-app_name = 'sdk/Iphone/1.0'
-version = '2.1.3'
-hosting_application_name = 'com.tf1.applitf1'
-hosting_application_version = '7.0.4'
+URL_LCI_REPLAY = "http://www.lci.fr/emissions"
+URL_LCI_ROOT = "http://www.lci.fr"
+
+SECRET_KEY = 'W3m0#1mFI'
+APP_NAME = 'sdk/Iphone/1.0'
+VERSION = '2.1.3'
+HOSTING_APPLICATION_NAME = 'com.tf1.applitf1'
+HOSTING_APPLICATION_VERSION = '7.0.4'
+IMG_WIDTH = 640
+IMG_HEIGHT = 360
def channel_entry(params):
- if 'list_shows' in params.next:
+ """Entry function of the module"""
+ if 'root' in params.next:
+ return root(params)
+ elif 'list_shows' in params.next:
return list_shows(params)
elif 'list_videos_categories' in params.next:
return list_videos_categories(params)
elif 'list_videos' in params.next:
return list_videos(params)
+ elif 'live' in params.next:
+ return list_live(params)
elif 'play' in params.next:
return get_video_url(params)
- else:
- return None
-
+ return None
+
+@common.PLUGIN.cached(common.CACHE_TIME)
+def root(params):
+ """Add Replay and Live in the listing"""
+ modes = []
+
+ # Add Replay
+ modes.append({
+ 'label' : 'Replay',
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_shows_1',
+ category='%s Replay' % params.channel_name.upper(),
+ window_title='%s Replay' % params.channel_name.upper()
+ ),
+ })
+
+ # Add Live
+ if params.channel_name != 'tfou' and params.channel_name != 'xtra':
+ modes.append({
+ 'label' : _('Live TV'),
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='live_cat',
+ category='%s Live TV' % params.channel_name.upper(),
+ window_title='%s Live TV' % params.channel_name.upper()
+ ),
+ })
+
+ return common.PLUGIN.create_listing(
+ modes,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ ),
+ )
-@common.plugin.cached(common.cache_time)
+@common.PLUGIN.cached(common.CACHE_TIME)
def list_shows(params):
+ """Build categories listing"""
shows = []
- url = ''.join((
- url_root,
- params.channel_name,
- '/programmes-tv'))
- file_path = utils.download_catalog(
- url,
- params.channel_name + '.html')
- root_html = open(file_path).read()
- root_soup = bs(root_html, 'html.parser')
+ if params.channel_name == 'lci':
- if params.next == 'list_shows_1':
- categories_soup = root_soup.find(
- 'ul',
- attrs={'class': 'filters_2 contentopen'})
- for category in categories_soup.find_all('a'):
- category_name = category.get_text().encode('utf-8')
- category_url = category['data-target'].encode('utf-8')
-
- shows.append({
- 'label': category_name,
- 'url': common.plugin.get_url(
- action='channel_entry',
- category=category_url,
- next='list_shows_2',
- window_title=category_name
- )
- })
+ file_path = utils.download_catalog(
+ URL_LCI_REPLAY,
+ params.channel_name + '.html')
+ root_html = open(file_path).read()
+ root_soup = bs(root_html, 'html.parser')
- elif params.next == 'list_shows_2':
- programs_soup = root_soup.find(
- 'ul',
- attrs={'id': 'js_filter_el_container'})
- for program in programs_soup.find_all('li'):
- category = program['data-type'].encode('utf-8')
- if params.category == category or params.category == 'all':
- program_url = program.find(
- 'div',
- class_='description')
- program_url = program_url.find('a')['href'].encode('utf-8')
+ if params.next == 'list_shows_1':
+ programs_soup = root_soup.find(
+ 'ul',
+ attrs={'class': 'topic-chronology-milestone-component'})
+ for program in programs_soup.find_all('li'):
+ program_url = URL_LCI_ROOT + program.find('a')['href'].encode('utf-8')
program_name = program.find(
- 'p',
- class_='program').get_text().encode('utf-8')
- img = program.find('img')
+ 'h2',
+ class_='text-block').get_text().encode('utf-8')
+ img = program.find_all('source')[0]
try:
img = img['data-srcset'].encode('utf-8')
except:
img = img['srcset'].encode('utf-8')
- img = 'http:' + img.split(',')[-1].split(' ')[0]
+ img = img.split(',')[0].split(' ')[0]
shows.append({
'label': program_name,
'thumb': img,
- 'url': common.plugin.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
program_url=program_url,
- next='list_videos_categories',
+ next='list_videos',
window_title=program_name
)
})
+ else:
+ url = ''.join((
+ URL_ROOT,
+ params.channel_name,
+ '/programmes-tv'))
+ file_path = utils.download_catalog(
+ url,
+ params.channel_name + '.html')
+ root_html = open(file_path).read()
+ root_soup = bs(root_html, 'html.parser')
+
+ if params.next == 'list_shows_1':
+ categories_soup = root_soup.find(
+ 'ul',
+ attrs={'class': 'filters_2 contentopen'})
+ for category in categories_soup.find_all('a'):
+ category_name = category.get_text().encode('utf-8')
+ category_url = category['data-target'].encode('utf-8')
- return common.plugin.create_listing(
+ shows.append({
+ 'label': category_name,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ category=category_url,
+ next='list_shows_2',
+ window_title=category_name
+ )
+ })
+
+ elif params.next == 'list_shows_2':
+ programs_soup = root_soup.find(
+ 'ul',
+ attrs={'id': 'js_filter_el_container'})
+ for program in programs_soup.find_all('li'):
+ category = program['data-type'].encode('utf-8')
+ if params.category == category or params.category == 'all':
+ program_url = program.find(
+ 'div',
+ class_='description')
+ program_url = program_url.find('a')['href'].encode('utf-8')
+ program_name = program.find(
+ 'p',
+ class_='program').get_text().encode('utf-8')
+ img = program.find('img')
+ try:
+ img = img['data-srcset'].encode('utf-8')
+ except:
+ img = img['srcset'].encode('utf-8')
+
+ img = 'http:' + img.split(',')[-1].split(' ')[0]
+
+ shows.append({
+ 'label': program_name,
+ 'thumb': img,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ program_url=program_url,
+ next='list_videos_categories',
+ window_title=program_name
+ )
+ })
+
+ return common.PLUGIN.create_listing(
shows,
sort_methods=(
common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
@@ -124,11 +217,11 @@ def list_shows(params):
)
-@common.plugin.cached(common.cache_time)
+@common.PLUGIN.cached(common.CACHE_TIME)
def list_videos_categories(params):
+ """Build videos categories listing"""
videos_categories = []
url = ''.join((
- url_root,
params.program_url,
'/videos'))
program_html = utils.get_webcontent(url)
@@ -141,16 +234,16 @@ def list_videos_categories(params):
category_title = li.get_text().encode('utf-8')
category_id = li.find('a')['data-filter'].encode('utf-8')
videos_categories.append({
- 'label': category_title,
- 'url': common.plugin.get_url(
- action='channel_entry',
- program_url=params.program_url,
- next='list_videos',
- window_title=category_title,
- category_id=category_id
- )
- })
- return common.plugin.create_listing(
+ 'label': category_title,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ program_url=params.program_url,
+ next='list_videos',
+ window_title=category_title,
+ category_id=category_id
+ )
+ })
+ return common.PLUGIN.create_listing(
videos_categories,
sort_methods=(
common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
@@ -159,97 +252,171 @@ def list_videos_categories(params):
)
-
-@common.plugin.cached(common.cache_time)
+@common.PLUGIN.cached(common.CACHE_TIME)
def list_videos(params):
+ """Build videos listing"""
videos = []
- url = ''.join((
- url_root,
- params.program_url,
- '/videos/',
- '?filter=',
- params.category_id))
- program_html = utils.get_webcontent(url)
- program_soup = bs(program_html, 'html.parser')
+ if params.channel_name == 'lci':
+ program_html = utils.get_webcontent(params.program_url)
+ program_soup = bs(program_html, 'html.parser')
- grid = program_soup.find(
- 'ul',
- class_='grid')
+ list_replay = program_soup.find_all(
+ 'a',
+ class_='topic-emission-extract-block-image trackXiti')
- for li in grid.find_all('li'):
- video_type_string = li.find('div', class_='description').find('a')['data-xiti-libelle'].encode('utf-8')
- video_type_string = video_type_string.split('-')[0]
+ for replay in list_replay:
- if 'Playlist' not in video_type_string:
- title = li.find(
- 'p',
- class_='title').get_text().encode('utf-8')
-
- try:
- stitle = li.find(
- 'p',
- class_='stitle').get_text().encode('utf-8')
- except:
- stitle = ''
-
- try:
- duration = li.find(
- 'span',
- attrs={'data-format': 'duration'})
- duration = int(duration.get_text().encode('utf-8'))
- except:
- duration = 0
-
- img = li.find('img')
+ title = replay.find_all('img')[0].get('alt').encode('utf-8')
+ duration = 0
+ img = replay.find_all('source')[0]
try:
img = img['data-srcset'].encode('utf-8')
except:
img = img['srcset'].encode('utf-8')
- img = 'http:' + img.split(',')[-1].split(' ')[0]
-
- # aired = li.find(
- # 'span',
- # attrs={'data-format': None, 'class': 'momentDate'})
- # aired = aired.get_text().encode('utf-8')
- # aired = aired.split('T')[0]
- aired = ''
-
- # day = aired.split('-')[2]
- # mounth = aired.split('-')[1]
- # year = aired.split('-')[0]
- # date = '.'.join((day, mounth, year))
- date =''
- # date : string (%d.%m.%Y / 01.01.2009)
- # aired : string (2008-12-07)
- program_id = li.find('a')['href'].encode('utf-8')
+ img = img.split(',')[0].split(' ')[0]
+ program_id = URL_LCI_ROOT + replay.get('href').encode('utf-8')
info = {
'video': {
'title': title,
- 'plot': stitle,
- 'aired': aired,
- 'date': date,
+ #'plot': stitle,
+ #'aired': aired,
+ #'date': date,
'duration': duration,
#'year': int(aired[:4]),
'mediatype': 'tvshow'
}
}
+ context_menu = []
+ download_video = (
+ _('Download'),
+ 'XBMC.RunPlugin(' + common.PLUGIN.get_url(
+ action='download_video',
+ program_id=program_id) + ')'
+ )
+ context_menu.append(download_video)
+
videos.append({
'label': title,
'thumb': img,
- 'url': common.plugin.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
- next='play',
+ next='play_r',
program_id=program_id,
),
'is_playable': True,
- 'info': info
+ 'info': info,
+ 'context_menu': context_menu
})
- return common.plugin.create_listing(
+ else:
+ url = ''.join((
+ params.program_url,
+ '/videos/',
+ '?filter=',
+ params.category_id))
+ program_html = utils.get_webcontent(url)
+ program_soup = bs(program_html, 'html.parser')
+
+ grid = program_soup.find(
+ 'ul',
+ class_='grid')
+
+ for li in grid.find_all('li'):
+ video_type_string = li.find(
+ 'div', class_='description').find('a')['data-xiti-libelle'].encode('utf-8')
+ video_type_string = video_type_string.split('-')[0]
+
+ if 'Playlist' not in video_type_string:
+ title = li.find(
+ 'p',
+ class_='title').get_text().encode('utf-8')
+
+ try:
+ stitle = li.find(
+ 'p',
+ class_='stitle').get_text().encode('utf-8')
+ except:
+ stitle = ''
+
+ try:
+ duration_soup = li.find(
+ 'p',
+ class_='uptitle').find(
+ 'span',
+ class_='momentDate')
+ duration = int(duration_soup.get_text().encode('utf-8'))
+ except:
+ duration = 0
+
+ img = li.find('img')
+ try:
+ img = img['data-srcset'].encode('utf-8')
+ except:
+ img = img['srcset'].encode('utf-8')
+
+ img = 'http:' + img.split(',')[-1].split(' ')[0]
+
+ try:
+ date_soup = li.find(
+ 'div',
+ class_='text').find(
+ 'p',
+ class_='uptitle').find('span')
+
+ aired = date_soup['data-date'].encode('utf-8').split('T')[0]
+ day = aired.split('-')[2]
+ mounth = aired.split('-')[1]
+ year = aired.split('-')[0]
+ date = '.'.join((day, mounth, year))
+ # date : string (%d.%m.%Y / 01.01.2009)
+ # aired : string (2008-12-07)
+
+ except:
+ date = ''
+ aired = ''
+ year = 0
+
+ program_id = li.find('a')['href'].encode('utf-8')
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'plot': stitle,
+ 'aired': aired,
+ 'date': date,
+ 'duration': duration,
+ 'year': int(aired[:4]),
+ 'mediatype': 'tvshow'
+ }
+ }
+
+ context_menu = []
+ download_video = (
+ _('Download'),
+ 'XBMC.RunPlugin(' + common.PLUGIN.get_url(
+ action='download_video',
+ program_id=program_id) + ')'
+ )
+ context_menu.append(download_video)
+
+ videos.append({
+ 'label': title,
+ 'thumb': img,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_r',
+ program_id=program_id,
+ ),
+ 'is_playable': True,
+ 'info': info,
+ 'context_menu': context_menu
+ })
+
+ return common.PLUGIN.create_listing(
videos,
sort_methods=(
common.sp.xbmcplugin.SORT_METHOD_DATE,
@@ -259,58 +426,176 @@ def list_videos(params):
),
content='tvshows')
+@common.PLUGIN.cached(common.CACHE_TIME)
+def list_live(params):
+ """Build live listing"""
+ lives = []
-@common.plugin.cached(common.cache_time)
-def get_video_url(params):
- url = url_root + params.program_id
- video_html = utils.get_webcontent(url)
- video_html_soup = bs(video_html, 'html.parser')
+ file_path = utils.download_catalog(
+ URL_LIVE_INFO % params.channel_name,
+ '%s_info_live.json' % (params.channel_name)
+ )
+ file_info_live = open(file_path).read()
+ json_parser = json.loads(file_info_live)
+
+ title = json_parser["current"]["title"].encode('utf-8') + ' - ' \
+ + json_parser["current"]["episode"].encode('utf-8')
+ if "description" in json_parser["current"]:
+ plot = json_parser["current"]["humanStartDate"].encode('utf-8') + ' - ' \
+ + json_parser["current"]["humanEndDate"].encode('utf-8') \
+ + '\n ' + json_parser["current"]["description"].encode('utf-8')
+ else:
+ plot = json_parser["current"]["humanStartDate"].encode('utf-8') + ' - ' \
+ + json_parser["current"]["humanEndDate"].encode('utf-8')
+
+ duration = 0
+ #duration = json_parser["videoJsonPlayer"]["videoDurationSeconds"]
+
+ # Get Image (Code java found in a Forum)
+ id_image = json_parser["current"]["image"].encode('utf-8')
+ value_md5 = common.sp.md5(str(IMG_WIDTH) + str(IMG_HEIGHT) + id_image \
+ + 'elk45sz6ers68').hexdigest()
+ value_md5 = value_md5[:6]
+ try:
+ img = URL_API_IMAGE + '/' + str(IMG_WIDTH) + '/' + str(IMG_HEIGHT) + '/' \
+ + id_image + '/' + str(value_md5)
+ except:
+ img = ''
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'plot': plot,
+ 'duration': duration
+ }
+ }
- iframe_player_soup = video_html_soup.find(
- 'div',
- class_='iframe_player')
+ lives.append({
+ 'label': title,
+ 'fanart': img,
+ 'thumb': img,
+ 'url' : common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_l',
+ ),
+ 'is_playable': True,
+ 'info': info
+ })
- data_src = iframe_player_soup['data-src'].encode('utf-8')
- video_id = data_src[-8:]
+ return common.PLUGIN.create_listing(
+ lives,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ )
+ )
- timeserver = str(utils.get_webcontent(url_time))
+@common.PLUGIN.cached(common.CACHE_TIME)
+def get_video_url(params):
+ """Get video URL and start video player"""
+
+ if params.next == 'play_r' or params.next == 'download_video':
+ if "http" not in params.program_id:
+ if params.program_id[0] == '/':
+ params.program_id = params.program_id[1:]
+ url = URL_ROOT + params.program_id
+ else:
+ url = params.program_id
+ video_html = utils.get_webcontent(url)
+ video_html_soup = bs(video_html, 'html.parser')
+
+ iframe_player_soup = video_html_soup.find(
+ 'div',
+ class_='iframe_player')
+
+ if params.channel_name == 'lci':
+ video_id = iframe_player_soup['data-watid'].encode('utf-8')
+ else:
+ data_src = iframe_player_soup['data-src'].encode('utf-8')
+ video_id = data_src[-8:]
+
+ timeserver = str(utils.get_webcontent(URL_TIME))
+
+ auth_key = '%s-%s-%s-%s-%s' % (
+ video_id,
+ SECRET_KEY,
+ APP_NAME,
+ SECRET_KEY,
+ timeserver
+ )
- auth_key = '%s-%s-%s-%s-%s' % (
- video_id,
- secret_key,
- app_name,
- secret_key,
- timeserver
- )
+ auth_key = common.sp.md5(auth_key).hexdigest()
+ auth_key = auth_key + '/' + timeserver
+
+ post_data = {
+ 'appName': APP_NAME,
+ 'method': 'getUrl',
+ 'mediaId': video_id,
+ 'authKey': auth_key,
+ 'version': VERSION,
+ 'hostingApplicationName': HOSTING_APPLICATION_NAME,
+ 'hostingApplicationVersion': HOSTING_APPLICATION_VERSION
+ }
+
+ url_video = utils.get_webcontent(
+ url=URL_TOKEN,
+ request_type='post',
+ post_dic=post_data)
+ url_video = json.loads(url_video)
+ url_video = url_video['message'].replace('\\', '')
+
+ desired_quality = common.PLUGIN.get_setting('quality')
+
+ if desired_quality == 'BEST' or desired_quality == 'DIALOG':
+ try:
+ url_video = url_video.split('&bwmax')[0]
+ except:
+ pass
- auth_key = common.sp.md5(auth_key).hexdigest()
- auth_key = auth_key + '/' + timeserver
-
- post_data = {
- 'appName': app_name,
- 'method': 'getUrl',
- 'mediaId': video_id,
- 'authKey': auth_key,
- 'version': version,
- 'hostingApplicationName': hosting_application_name,
- 'hostingApplicationVersion': hosting_application_version
- }
+ return url_video
+
+ elif params.next == 'play_l':
+
+ # Video_ID 'L_%CHANNEL_NAME%'
+ video_id = 'L_%s' % params.channel_name.upper()
- url_video = utils.get_webcontent(
- url=url_token,
- request_type='post',
- post_dic=post_data)
- url_video = json.loads(url_video)
- url_video = url_video['message'].replace('\\', '')
+ timeserver = str(utils.get_webcontent(URL_TIME))
- desired_quality = common.plugin.get_setting(
- params.channel_id + '.quality')
+ auth_key = '%s-%s-%s-%s-%s' % (
+ video_id,
+ SECRET_KEY,
+ APP_NAME,
+ SECRET_KEY,
+ timeserver
+ )
- if desired_quality == 'Force HD':
- try:
- url_video = url_video.split('&bwmax')[0]
- except:
- pass
+ auth_key = common.sp.md5(auth_key).hexdigest()
+ auth_key = auth_key + '/' + timeserver
+
+ post_data = {
+ 'appName': APP_NAME,
+ 'method': 'getUrl',
+ 'mediaId': video_id,
+ 'authKey': auth_key,
+ 'version': VERSION,
+ 'hostingApplicationName': HOSTING_APPLICATION_NAME,
+ 'hostingApplicationVersion': HOSTING_APPLICATION_VERSION
+ }
+
+ url_video = utils.get_webcontent(
+ url=URL_TOKEN,
+ request_type='post',
+ post_dic=post_data)
+ url_video = json.loads(url_video)
+ url_video = url_video['message'].replace('\\', '')
+
+ desired_quality = common.PLUGIN.get_setting('quality')
+
+ if desired_quality == 'BEST' or desired_quality == 'DIALOG':
+ try:
+ url_video = url_video.split('&bwmax')[0]
+ except:
+ pass
- return url_video \ No newline at end of file
+ return url_video
diff --git a/plugin.video.catchuptvandmore/resources/lib/common.py b/plugin.video.catchuptvandmore/resources/lib/common.py
index aea8366..f403d7f 100644..100755
--- a/plugin.video.catchuptvandmore/resources/lib/common.py
+++ b/plugin.video.catchuptvandmore/resources/lib/common.py
@@ -19,21 +19,21 @@
with Catch-up TV & More; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""
-from resources.lib import simpleplugin as sp
-import os
-plugin = sp.Plugin()
-addon = sp.Addon()
+import os
+from resources.lib import simpleplugin as sp
-cache_time = 10
+PLUGIN = sp.Plugin()
+ADDON = sp.Addon()
-plugin_name = 'Catch-up TV & More'
+CACHE_TIME = 10
+PLUGIN_NAME = 'Catch-up TV & More'
def get_window_title():
query = sp.sys.argv[2][1:]
- params = plugin.get_params(query)
+ params = PLUGIN.get_params(query)
if 'window_title' in params:
return params.window_title
else:
- return plugin_name
+ return PLUGIN_NAME
diff --git a/plugin.video.catchuptvandmore/resources/lib/simpleplugin.py b/plugin.video.catchuptvandmore/resources/lib/simpleplugin.py
index f3b6f9d..f3b6f9d 100644..100755
--- a/plugin.video.catchuptvandmore/resources/lib/simpleplugin.py
+++ b/plugin.video.catchuptvandmore/resources/lib/simpleplugin.py
diff --git a/plugin.video.catchuptvandmore/resources/lib/skeleton.py b/plugin.video.catchuptvandmore/resources/lib/skeleton.py
index d8546d4..7d2f9a2 100644..100755
--- a/plugin.video.catchuptvandmore/resources/lib/skeleton.py
+++ b/plugin.video.catchuptvandmore/resources/lib/skeleton.py
@@ -21,40 +21,57 @@
"""
-categories = {
- 'main_menu.fr': 'French channels'
- # 'main_menu.be': 'Belgian channels'
+CATEGORIES = {
+ 'main_menu.fr': 'French channels',
+ 'main_menu.eu': 'European channels'
}
-channels = {
+CHANNELS = {
'main_menu.fr': {
'channels.fr.tf1.tf1': 'TF1',
'channels.fr.pluzz.france2': 'France 2',
'channels.fr.pluzz.france3': 'France 3',
- 'channels.fr.canalplus.canalplus': 'Canal +',
+ 'channels.fr.groupecanal.cplus': 'Canal +',
'channels.fr.pluzz.france5': 'France 5',
'channels.fr.6play.m6': 'M6',
- 'channels.fr.arte.arte': 'Arte',
- 'channels.fr.c.c8': 'C8',
+ 'channels.fr.groupecanal.c8': 'C8',
'channels.fr.6play.w9': 'W9',
'channels.fr.tf1.tmc': 'TMC',
'channels.fr.tf1.nt1': 'NT1',
'channels.fr.nrj.nrj12': 'NRJ 12',
'channels.fr.pluzz.france4': 'France 4',
'channels.fr.bfmtv.bfmtv': 'BFM TV',
- 'channels.fr.itele.itele': 'i-Télé',
- 'channels.fr.c.cstar': 'CStar',
+ 'channels.fr.groupecanal.cnews': 'CNews',
+ 'channels.fr.groupecanal.cstar': 'CStar',
'channels.fr.gulli.gulli': 'Gulli',
'channels.fr.pluzz.franceo': 'France Ô',
'channels.fr.tf1.hd1': 'HD1',
'channels.fr.lequipe.lequipe': 'L\'Équipe',
'channels.fr.6play.6ter': '6ter',
'channels.fr.numero23.numero23': 'Numéro 23',
- 'channels.fr.nrj.cherie25': 'Chérie 25'
+ 'channels.fr.nrj.cherie25': 'Chérie 25',
+ 'channels.fr.pluzz.la_1ere': 'La 1ère (Outre-Mer)',
+ 'channels.fr.pluzz.franceinfo': 'France Info',
+ 'channels.fr.bfmtv.bfmbusiness': 'BFM Business',
+ 'channels.fr.bfmtv.rmc': 'RMC',
+ 'channels.fr.bfmtv.01net': '01Net TV',
+ 'channels.fr.tf1.tfou': 'Tfou (MYTF1)',
+ 'channels.fr.tf1.xtra': 'Xtra (MYTF1)',
+ 'channels.fr.tf1.lci': 'LCI',
+ 'channels.fr.lcp.lcp': 'LCP Assemblée Nationale',
+ 'channels.fr.bfmtv.rmcdecouverte': 'RMC Découverte HD24',
+ 'channels.fr.6play.stories': 'Stories (6play)',
+ 'channels.fr.6play.bruce': 'Bruce (6play)',
+ 'channels.fr.6play.crazy_kitchen': 'Crazy Kitchen (6play)',
+ 'channels.fr.6play.home': 'Home Time (6play)',
+ 'channels.fr.6play.styles': 'Sixième Style (6play)',
+ 'channels.fr.6play.comedy': 'Comic (6play)',
+ 'channels.fr.france24.france24': 'France 24',
+ 'channels.fr.publicsenat.publicsenat': 'Public Sénat'
+ },
+ 'main_menu.eu': {
+ 'channels.eu.arte.arte': 'Arte',
+ 'channels.eu.euronews.euronews': 'Euronews'
}
-
- # 'main_menu.be': {
- # 'channels.be.rtbf.rtbf': 'RTBF'
- # }
}
diff --git a/plugin.video.catchuptvandmore/resources/lib/utils.py b/plugin.video.catchuptvandmore/resources/lib/utils.py
index 5123afb..e9206df 100644..100755
--- a/plugin.video.catchuptvandmore/resources/lib/utils.py
+++ b/plugin.video.catchuptvandmore/resources/lib/utils.py
@@ -31,16 +31,16 @@ from resources.lib import common
user_data = common.sp.xbmc.translatePath(
os.path.join(
'special://profile/addon_data',
- common.addon.id))
+ common.ADDON.id))
cache_path = common.sp.xbmc.translatePath(
os.path.join(
user_data,
'cache'))
-default_ua = "Mozilla/5.0 (Windows NT 6.1; WOW64) " \
+default_ua = "Mozilla/5.0 (X11; Linux x86_64) " \
"AppleWebKit/537.36 (KHTML, like Gecko) " \
- "Chrome/55.0.2883.87 Safari/537.36"
+ "Chrome/60.0.3112.78 Safari/537.36"
user_agents = [
'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36'
@@ -74,7 +74,7 @@ def download_catalog(
specific_headers={},
params={}):
file_name = format_filename(file_name)
- common.addon.log('URL download_catalog : ' + url)
+ common.ADDON.log('URL download_catalog : ' + url)
if not os.path.exists(cache_path):
os.makedirs(cache_path, mode=0777)
@@ -124,7 +124,7 @@ def get_webcontent(
random_ua=False,
specific_headers={},
params={}):
- common.addon.log('URL get_webcontent : ' + url)
+ common.ADDON.log('URL get_webcontent : ' + url)
if random_ua:
ua = user_agents[randint(0, len(user_agents) - 1)]
else:
@@ -167,6 +167,6 @@ def get_redirected_url(
def send_notification(
- message, title=common.plugin_name, time=5000, sound=True):
+ message, title=common.PLUGIN_NAME, time=5000, sound=True):
common.sp.xbmcgui.Dialog().notification(
- title, message, common.addon.icon, time)
+ title, message, common.ADDON.icon, time)
diff --git a/plugin.video.catchuptvandmore/resources/media/categories/eu.png b/plugin.video.catchuptvandmore/resources/media/categories/eu.png
new file mode 100755
index 0000000..e534746
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/categories/eu.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/categories/fr.png b/plugin.video.catchuptvandmore/resources/media/categories/fr.png
new file mode 100755
index 0000000..cb017dc
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/categories/fr.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/arte.png b/plugin.video.catchuptvandmore/resources/media/channels/eu/arte.png
index 3c003a2..3c003a2 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/arte.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/eu/arte.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/eu/arte_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/eu/arte_fanart.png
new file mode 100755
index 0000000..dd5491b
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/eu/arte_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/eu/euronews.png b/plugin.video.catchuptvandmore/resources/media/channels/eu/euronews.png
new file mode 100755
index 0000000..0b40147
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/eu/euronews.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/eu/euronews_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/eu/euronews_fanart.png
new file mode 100755
index 0000000..a05737f
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/eu/euronews_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/01net.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/01net.png
new file mode 100755
index 0000000..10e36e0
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/01net.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/01net_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/01net_fanart.png
new file mode 100755
index 0000000..c793db8
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/01net_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/6ter.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/6ter.png
index 320cf16..320cf16 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/6ter.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/6ter.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/6ter_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/6ter_fanart.png
index 0fdefb5..0fdefb5 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/6ter_fanart.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/6ter_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/bfmbusiness.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/bfmbusiness.png
new file mode 100755
index 0000000..8286439
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/bfmbusiness.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/bfmbusiness_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/bfmbusiness_fanart.png
new file mode 100755
index 0000000..a849cda
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/bfmbusiness_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/bfmtv.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/bfmtv.png
index 3ca5f2a..3ca5f2a 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/bfmtv.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/bfmtv.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/bfmtv_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/bfmtv_fanart.png
index 226487f..226487f 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/bfmtv_fanart.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/bfmtv_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/bruce.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/bruce.png
new file mode 100755
index 0000000..4d043f5
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/bruce.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/bruce_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/bruce_fanart.png
new file mode 100755
index 0000000..fd37443
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/bruce_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/c8.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/c8.png
index e18d86c..e18d86c 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/c8.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/c8.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/c8_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/c8_fanart.png
index 05a9a6c..05a9a6c 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/c8_fanart.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/c8_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/cherie25.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/cherie25.png
index f4f9d60..f4f9d60 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/cherie25.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/cherie25.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/cherie25_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/cherie25_fanart.png
new file mode 100755
index 0000000..6ecbd9e
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/cherie25_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/cnews.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/cnews.png
new file mode 100755
index 0000000..a3f5127
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/cnews.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/cnews_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/cnews_fanart.png
new file mode 100755
index 0000000..a759d39
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/cnews_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/comedy.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/comedy.png
new file mode 100755
index 0000000..279348c
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/comedy.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/comedy_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/comedy_fanart.png
new file mode 100755
index 0000000..f2a41c1
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/comedy_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/canalplus.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/cplus.png
index 6829f23..6829f23 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/canalplus.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/cplus.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/canalplus_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/cplus_fanart.png
index 2a2e3b4..2a2e3b4 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/canalplus_fanart.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/cplus_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/crazy_kitchen.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/crazy_kitchen.png
new file mode 100755
index 0000000..6d8c2d2
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/crazy_kitchen.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/crazy_kitchen_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/crazy_kitchen_fanart.png
new file mode 100755
index 0000000..1e03344
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/crazy_kitchen_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/cstar.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/cstar.png
index 4d3a463..4d3a463 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/cstar.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/cstar.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/cstar_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/cstar_fanart.png
index f7c45db..f7c45db 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/cstar_fanart.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/cstar_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/france2.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/france2.png
index 6f741cd..6f741cd 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/france2.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/france2.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/france24.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/france24.png
new file mode 100755
index 0000000..9a9db7c
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/france24.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/france24_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/france24_fanart.png
new file mode 100755
index 0000000..dadb2fb
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/france24_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/france2_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/france2_fanart.png
index 8184c2a..8184c2a 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/france2_fanart.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/france2_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/france3.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/france3.png
index 3309012..3309012 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/france3.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/france3.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/france3_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/france3_fanart.png
index dede4f8..dede4f8 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/france3_fanart.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/france3_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/france4.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/france4.png
index a8a1bba..a8a1bba 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/france4.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/france4.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/france4_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/france4_fanart.png
new file mode 100755
index 0000000..d83de13
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/france4_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/france5.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/france5.png
index bc1f6ea..bc1f6ea 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/france5.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/france5.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/france5_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/france5_fanart.png
new file mode 100755
index 0000000..96ce7ae
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/france5_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/franceinfo.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/franceinfo.png
new file mode 100755
index 0000000..bdc12e4
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/franceinfo.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/franceinfo_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/franceinfo_fanart.png
new file mode 100755
index 0000000..edb1cb8
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/franceinfo_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/franceo.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/franceo.png
index b2de049..b2de049 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/franceo.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/franceo.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/franceo_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/franceo_fanart.png
new file mode 100755
index 0000000..e05df4c
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/franceo_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/gulli.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/gulli.png
index b2e1522..b2e1522 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/gulli.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/gulli.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/gulli_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/gulli_fanart.png
index 94739ab..94739ab 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/gulli_fanart.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/gulli_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/hd1.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/hd1.png
index c33450f..c33450f 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/hd1.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/hd1.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/hd1_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/hd1_fanart.png
index 665dc6c..665dc6c 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/hd1_fanart.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/hd1_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/home.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/home.png
new file mode 100755
index 0000000..3c3f68f
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/home.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/home_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/home_fanart.png
new file mode 100755
index 0000000..1c22df9
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/home_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/itele.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/itele.png
deleted file mode 100644
index 2e1d937..0000000
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/itele.png
+++ /dev/null
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/itele_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/itele_fanart.png
deleted file mode 100644
index 1bca166..0000000
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/itele_fanart.png
+++ /dev/null
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/la_1ere.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/la_1ere.png
new file mode 100755
index 0000000..29de8d2
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/la_1ere.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/la_1ere_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/la_1ere_fanart.png
new file mode 100755
index 0000000..1dcc660
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/la_1ere_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/lci.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/lci.png
new file mode 100755
index 0000000..c979af1
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/lci.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/lci_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/lci_fanart.png
new file mode 100755
index 0000000..565bdee
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/lci_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/lcp.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/lcp.png
new file mode 100755
index 0000000..d33817d
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/lcp.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/lcp_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/lcp_fanart.png
new file mode 100755
index 0000000..d697fdf
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/lcp_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/lequipe.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/lequipe.png
index 90b5b46..90b5b46 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/lequipe.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/lequipe.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/lequipe_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/lequipe_fanart.png
index bfc2dbe..bfc2dbe 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/lequipe_fanart.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/lequipe_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/m6.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/m6.png
index 24852b7..24852b7 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/m6.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/m6.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/m6_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/m6_fanart.png
index f5e8e8e..f5e8e8e 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/m6_fanart.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/m6_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/nrj12.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/nrj12.png
index 0c4c9f4..0c4c9f4 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/nrj12.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/nrj12.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/nrj12_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/nrj12_fanart.png
index 848d9c6..848d9c6 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/nrj12_fanart.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/nrj12_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/nt1.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/nt1.png
index 59c8e33..59c8e33 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/nt1.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/nt1.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/nt1_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/nt1_fanart.png
index bc00729..bc00729 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/nt1_fanart.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/nt1_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/numero23.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/numero23.png
index c6f154f..cd302c4 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/numero23.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/numero23.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/numero23_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/numero23_fanart.png
new file mode 100755
index 0000000..35045dd
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/numero23_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/parispremiere.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/parispremiere.png
new file mode 100755
index 0000000..83ad901
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/parispremiere.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/parispremiere_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/parispremiere_fanart.png
new file mode 100755
index 0000000..823bd90
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/parispremiere_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/publicsenat.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/publicsenat.png
new file mode 100755
index 0000000..8a756d9
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/publicsenat.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/publicsenat_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/publicsenat_fanart.png
new file mode 100755
index 0000000..38fc4bb
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/publicsenat_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/rmc.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/rmc.png
new file mode 100755
index 0000000..21bbe7e
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/rmc.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/rmc_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/rmc_fanart.png
new file mode 100755
index 0000000..d471802
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/rmc_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/rmcdecouverte.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/rmcdecouverte.png
new file mode 100755
index 0000000..5908627
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/rmcdecouverte.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/stories.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/stories.png
new file mode 100755
index 0000000..716f06a
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/stories.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/stories_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/stories_fanart.png
new file mode 100755
index 0000000..4083644
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/stories_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/styles.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/styles.png
new file mode 100755
index 0000000..84bb4b5
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/styles.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/styles_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/styles_fanart.png
new file mode 100755
index 0000000..120a167
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/styles_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/teva.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/teva.png
new file mode 100755
index 0000000..e376edf
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/teva.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/teva_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/teva_fanart.png
new file mode 100755
index 0000000..b45bff7
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/teva_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/tf1.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/tf1.png
index 18b7490..18b7490 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/tf1.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/tf1.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/tf1_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/tf1_fanart.png
index e23d730..e23d730 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/tf1_fanart.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/tf1_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/tfou.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/tfou.png
new file mode 100755
index 0000000..1b69f8d
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/tfou.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/tfou_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/tfou_fanart.png
new file mode 100755
index 0000000..f47d92d
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/tfou_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/tmc.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/tmc.png
index 2ad9872..2ad9872 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/tmc.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/tmc.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/tmc_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/tmc_fanart.png
index de8fef7..de8fef7 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/tmc_fanart.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/tmc_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/w9.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/w9.png
index a0c27c4..a0c27c4 100644..100755
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/w9.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/w9.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/w9_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/w9_fanart.png
new file mode 100755
index 0000000..0fe0102
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/w9_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/xtra.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/xtra.png
new file mode 100755
index 0000000..dc311d1
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/xtra.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/screenshots/screenshot-01.jpg b/plugin.video.catchuptvandmore/resources/screenshots/screenshot-01.jpg
index 11c6c33..11c6c33 100644..100755
--- a/plugin.video.catchuptvandmore/resources/screenshots/screenshot-01.jpg
+++ b/plugin.video.catchuptvandmore/resources/screenshots/screenshot-01.jpg
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/screenshots/screenshot-02.jpg b/plugin.video.catchuptvandmore/resources/screenshots/screenshot-02.jpg
index da9e325..da9e325 100644..100755
--- a/plugin.video.catchuptvandmore/resources/screenshots/screenshot-02.jpg
+++ b/plugin.video.catchuptvandmore/resources/screenshots/screenshot-02.jpg
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/screenshots/screenshot-03.jpg b/plugin.video.catchuptvandmore/resources/screenshots/screenshot-03.jpg
index a5c6b9c..a5c6b9c 100644..100755
--- a/plugin.video.catchuptvandmore/resources/screenshots/screenshot-03.jpg
+++ b/plugin.video.catchuptvandmore/resources/screenshots/screenshot-03.jpg
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/screenshots/screenshot-04.jpg b/plugin.video.catchuptvandmore/resources/screenshots/screenshot-04.jpg
index 05ee326..05ee326 100644..100755
--- a/plugin.video.catchuptvandmore/resources/screenshots/screenshot-04.jpg
+++ b/plugin.video.catchuptvandmore/resources/screenshots/screenshot-04.jpg
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/screenshots/screenshot-05.jpg b/plugin.video.catchuptvandmore/resources/screenshots/screenshot-05.jpg
index f7d309f..f7d309f 100644..100755
--- a/plugin.video.catchuptvandmore/resources/screenshots/screenshot-05.jpg
+++ b/plugin.video.catchuptvandmore/resources/screenshots/screenshot-05.jpg
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/settings.xml b/plugin.video.catchuptvandmore/resources/settings.xml
index af6fdaa..5037cbb 100644..100755
--- a/plugin.video.catchuptvandmore/resources/settings.xml
+++ b/plugin.video.catchuptvandmore/resources/settings.xml
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>
-
+
<!-- Main menu -->
<category label="30000">
<!-- Hide main menu categories -->
<setting label="30010" type="lsep"/>
- <setting label="30020" type="bool" id="main_menu.fr" default="true"/>
- <!-- <setting label="30021" type="bool" id="main_menu.be" default="true"/> -->
+ <setting label="30020" type="bool" id="main_menu.fr" default="true"/>
+ <setting label="30023" type="bool" id="main_menu.eu" default="true"/>
</category>
@@ -14,147 +14,185 @@
<category label="30001">
<!-- Hide channels from categories -->
<setting label="30011" type="lsep"/>
+
<setting label="30020" type="lsep" subsetting="true" visible="eq(1,true)"/>
<setting label="30020" type="bool" id="main_menu.fr" default="true" visible="false"/>
<setting label="TF1" type="bool" id="channels.fr.tf1.tf1" default="true" visible="eq(-1,true)"/>
<setting label="" type="number" visible="false" id="channels.fr.tf1.tf1.order" default="1"/>
-
+
<setting label="France 2" type="bool" id="channels.fr.pluzz.france2" default="true" visible="eq(-3,true)"/>
<setting label="" type="number" visible="false" id="channels.fr.pluzz.france2.order" default="2"/>
-
+
<setting label="France 3" type="bool" id="channels.fr.pluzz.france3" default="true" visible="eq(-5,true)"/>
<setting label="" type="number" visible="false" id="channels.fr.pluzz.france3.order" default="3"/>
-
- <setting label="Canal +" type="bool" id="channels.fr.canalplus.canalplus" default="true" visible="eq(-7,true)"/>
- <setting label="" type="number" visible="false" id="channels.fr.canalplus.canalplus.order" default="4"/>
-
+
+ <setting label="Canal +" type="bool" id="channels.fr.groupecanal.cplus" default="true" visible="eq(-7,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.groupecanal.cplus.order" default="4"/>
+
<setting label="France 5" type="bool" id="channels.fr.pluzz.france5" default="true" visible="eq(-9,true)"/>
<setting label="" type="number" visible="false" id="channels.fr.pluzz.france5.order" default="5"/>
-
+
<setting label="M6" type="bool" id="channels.fr.6play.m6" default="true" visible="eq(-11,true)"/>
<setting label="" type="number" visible="false" id="channels.fr.6play.m6.order" default="6"/>
-
- <setting label="Arte" type="bool" id="channels.fr.arte.arte" default="true" visible="eq(-13,true)"/>
- <setting label="" type="number" visible="false" id="channels.fr.arte.arte.order" default="7"/>
-
- <setting label="C8" type="bool" id="channels.fr.c.c8" default="true" visible="eq(-15,true)"/>
- <setting label="" type="number" visible="false" id="channels.fr.c.c8.order" default="8"/>
-
- <setting label="W9" type="bool" id="channels.fr.6play.w9" default="true" visible="eq(-17,true)"/>
- <setting label="" type="number" visible="false" id="channels.fr.6play.w9.order" default="9"/>
-
- <setting label="TMC" type="bool" id="channels.fr.tf1.tmc" default="true" visible="eq(-19,true)"/>
- <setting label="" type="number" visible="false" id="channels.fr.tf1.tmc.order" default="10"/>
-
- <setting label="NT1" type="bool" id="channels.fr.tf1.nt1" default="true" visible="eq(-21,true)"/>
- <setting label="" type="number" visible="false" id="channels.fr.tf1.nt1.order" default="11"/>
-
- <setting label="NRJ 12" type="bool" id="channels.fr.nrj.nrj12" default="true" visible="eq(-23,true)"/>
- <setting label="" type="number" visible="false" id="channels.fr.nrj.nrj12.order" default="12"/>
-
- <setting label="France 4" type="bool" id="channels.fr.pluzz.france4" default="true" visible="eq(-25,true)"/>
- <setting label="" type="number" visible="false" id="channels.fr.pluzz.france4.order" default="14"/>
-
- <setting label="BFM TV" type="bool" id="channels.fr.bfmtv.bfmtv" default="true" visible="eq(-27,true)"/>
- <setting label="" type="number" visible="false" id="channels.fr.bfmtv.bfmtv.order" default="15"/>
-
- <setting label="i-Télé" type="bool" id="channels.fr.itele.itele" default="true" visible="eq(-29,true)"/>
- <setting label="" type="number" visible="false" id="channels.fr.itele.itele.order" default="16"/>
-
- <setting label="CStar" type="bool" id="channels.fr.c.cstar" default="true" visible="eq(-31,true)"/>
- <setting label="" type="number" visible="false" id="channels.fr.c.cstar.order" default="17"/>
-
- <setting label="Gulli" type="bool" id="channels.fr.gulli.gulli" default="true" visible="eq(-33,true)"/>
- <setting label="" type="number" visible="false" id="channels.fr.gulli.gulli.order" default="18"/>
-
- <setting label="France Ô" type="bool" id="channels.fr.pluzz.franceo" default="true" visible="eq(-35,true)"/>
- <setting label="" type="number" visible="false" id="channels.fr.pluzz.franceo.order" default="19"/>
-
- <setting label="HD1" type="bool" id="channels.fr.tf1.hd1" default="true" visible="eq(-37,true)"/>
- <setting label="" type="number" visible="false" id="channels.fr.tf1.hd1.order" default="20"/>
-
- <setting label="L'Équipe" type="bool" id="channels.fr.lequipe.lequipe" default="true" visible="eq(-39,true)"/>
- <setting label="" type="number" visible="false" id="channels.fr.lequipe.lequipe.order" default="21"/>
-
- <setting label="6ter" type="bool" id="channels.fr.6play.6ter" default="true" visible="eq(-41,true)"/>
- <setting label="" type="number" visible="false" id="channels.fr.6play.6ter.order" default="22"/>
-
- <setting label="Numéro 23" type="bool" id="channels.fr.numero23.numero23" default="true" visible="eq(-43,true)"/>
- <setting label="" type="number" visible="false" id="channels.fr.numero23.numero23.order" default="23"/>
-
- <setting label="Chérie 25" type="bool" id="channels.fr.nrj.cherie25" default="true" visible="eq(-45,true)"/>
- <setting label="" type="number" visible="false" id="channels.fr.nrj.cherie25.order" default="25"/>
-<!-- <setting label="30021" type="lsep" subsetting="true" visible="eq(1,true)"/>
- <setting label="30021" type="bool" id="main_menu.be" default="true" visible="false"/>
- <setting label="RTBF" type="bool" id="channels.be.rtbf.rtbf" default="true" visible="eq(-1,true)"/> -->
- </category>
+ <setting label="C8" type="bool" id="channels.fr.groupecanal.c8" default="true" visible="eq(-13,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.groupecanal.c8.order" default="7"/>
+ <setting label="W9" type="bool" id="channels.fr.6play.w9" default="true" visible="eq(-15,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.6play.w9.order" default="8"/>
- <!-- Quality and content (and also hidden settings) -->
- <category label="30002">
-
- <setting label="30020" type="lsep" subsetting="true" visible="eq(1,true)"/>
- <setting label="30020" type="bool" id="main_menu.fr" default="true" visible="false"/>
-
- <setting label="TF1" type="bool" id="channels.fr.tf1.tf1" default="true" visible="false"/>
- <!-- <setting label="30070" type="bool" id="channels.fr.tf1.tf1.bonus" default="true" visible="eq(-1,true) + eq(-2,true)"/> -->
- <setting label="30070" type="bool" id="channels.fr.tf1.tf1.bonus" default="true" visible="false"/>
- <setting label="30087" type="labelenum" id="channels.fr.tf1.tf1.quality" visible="eq(-2,true) + eq(-3,true)" values="Force HD|Auto"/>
+ <setting label="TMC" type="bool" id="channels.fr.tf1.tmc" default="true" visible="eq(-17,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.tf1.tmc.order" default="9"/>
+
+ <setting label="NT1" type="bool" id="channels.fr.tf1.nt1" default="true" visible="eq(-19,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.tf1.nt1.order" default="10"/>
+
+ <setting label="NRJ 12" type="bool" id="channels.fr.nrj.nrj12" default="true" visible="eq(-21,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.nrj.nrj12.order" default="11"/>
+
+ <setting label="France 4" type="bool" id="channels.fr.pluzz.france4" default="true" visible="eq(-23,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.pluzz.france4.order" default="12"/>
+
+ <setting label="BFM TV" type="bool" id="channels.fr.bfmtv.bfmtv" default="true" visible="eq(-25,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.bfmtv.bfmtv.order" default="13"/>
+
+ <setting label="CNews" type="bool" id="channels.fr.groupecanal.cnews" default="true" visible="eq(-27,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.groupecanal.cnews.order" default="14"/>
+
+ <setting label="CStar" type="bool" id="channels.fr.groupecanal.cstar" default="true" visible="eq(-29,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.groupecanal.cstar.order" default="15"/>
+
+ <setting label="Gulli" type="bool" id="channels.fr.gulli.gulli" default="true" visible="eq(-31,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.gulli.gulli.order" default="16"/>
+
+ <setting label="France Ô" type="bool" id="channels.fr.pluzz.franceo" default="true" visible="eq(-33,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.pluzz.franceo.order" default="17"/>
+
+ <setting label="HD1" type="bool" id="channels.fr.tf1.hd1" default="true" visible="eq(-35,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.tf1.hd1.order" default="18"/>
+
+ <setting label="L'Équipe" type="bool" id="channels.fr.lequipe.lequipe" default="true" visible="eq(-37,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.lequipe.lequipe.order" default="19"/>
+
+ <setting label="6ter" type="bool" id="channels.fr.6play.6ter" default="true" visible="eq(-39,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.6play.6ter.order" default="20"/>
+
+ <setting label="Numéro 23" type="bool" id="channels.fr.numero23.numero23" default="true" visible="eq(-41,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.numero23.numero23.order" default="21"/>
+
+ <setting label="Chérie 25" type="bool" id="channels.fr.nrj.cherie25" default="true" visible="eq(-43,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.nrj.cherie25.order" default="22"/>
+
+ <setting label="La 1ère (Outre-Mer)" type="bool" id="channels.fr.pluzz.la_1ere" default="true" visible="eq(-45,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.pluzz.la_1ere.order" default="23"/>
+
+ <setting label="France Info" type="bool" id="channels.fr.pluzz.franceinfo" default="true" visible="eq(-47,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.pluzz.franceinfo.order" default="24"/>
+
+ <setting label="BFM Business" type="bool" id="channels.fr.bfmtv.bfmbusiness" default="true" visible="eq(-49,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.bfmtv.bfmbusiness.order" default="25"/>
- <setting label="France 2" type="bool" id="channels.fr.pluzz.france2" default="true" visible="false"/>
- <setting label="30071" type="labelenum" id="channels.fr.pluzz.france2.quality" visible="eq(-1,true) + eq(-5,true)" values="HD|SD"/>
+ <setting label="RMC" type="bool" id="channels.fr.bfmtv.rmc" default="true" visible="eq(-51,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.bfmtv.rmc.order" default="26"/>
- <setting label="France 3" type="bool" id="channels.fr.pluzz.france3" default="true" visible="false"/>
- <setting label="30072" type="labelenum" id="channels.fr.pluzz.france3.quality" visible="eq(-1,true) + eq(-7,true)" values="HD|SD"/>
+ <setting label="01Net TV" type="bool" id="channels.fr.bfmtv.01net" default="true" visible="eq(-53,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.bfmtv.01net.order" default="27"/>
- <setting label="France 5" type="bool" id="channels.fr.pluzz.france5" default="true" visible="false"/>
- <setting label="30074" type="labelenum" id="channels.fr.pluzz.france5.quality" visible="eq(-1,true) + eq(-9,true)" values="HD|SD"/>
-
- <setting label="M6" type="bool" id="channels.fr.6play.m6" default="true" visible="false"/>
- <setting label="30076" type="labelenum" id="channels.fr.6play.m6.quality" visible="eq(-1,true) + eq(-11,true)" values="Auto|Force HD|Force SD"/>
-
- <setting label="Arte" type="bool" id="channels.fr.arte.arte" default="true" visible="false"/>
- <setting label="30079" type="labelenum" id="channels.fr.arte.arte.quality" visible="eq(-1,true) + eq(-13,true)" values="Auto|HD+|HD|SD|SD-"/>
+ <setting label="Tfou (MYTF1)" type="bool" id="channels.fr.tf1.tfou" default="true" visible="eq(-55,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.tf1.tfou.order" default="28"/>
- <setting label="30080" type="labelenum" id="channels.fr.arte.arte.language" visible="eq(-2,true) + eq(-14,true)" values="Auto|fr|de"/>
+ <setting label="Xtra (MYTF1)" type="bool" id="channels.fr.tf1.xtra" default="true" visible="eq(-57,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.tf1.xtra.order" default="29"/>
- <setting label="W9" type="bool" id="channels.fr.6play.w9" default="true" visible="false"/>
- <setting label="30077" type="labelenum" id="channels.fr.6play.W9.quality" visible="eq(-1,true) + eq(-16,true)" values="Auto|Force HD|Force SD"/>
-
- <setting label="TMC" type="bool" id="channels.fr.tf1.tmc" default="true" visible="false"/>
- <setting label="30082" type="bool" id="channels.fr.tf1.tmc.bonus" default="true" visible="eq(-1,true) + eq(-18,true)"/>
+ <setting label="LCI" type="bool" id="channels.fr.tf1.lci" default="true" visible="eq(-59,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.tf1.lci.order" default="30"/>
- <setting label="NT1" type="bool" id="channels.fr.tf1.nt1" default="true" visible="false"/>
- <setting label="30083" type="bool" id="channels.fr.tf1.nt1.bonus" default="true" visible="eq(-1,true) + eq(-20,true)"/>
+ <setting label="LCP Assemblée Nationale" type="bool" id="channels.fr.lcp.lcp" default="true" visible="eq(-61,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.lcp.lcp.order" default="31"/>
- <setting label="NRJ 12" type="bool" id="channels.fr.nrj.nrj12" default="true" visible="false"/>
- <setting label="30085" type="labelenum" id="channels.fr.nrj.nrj12.quality" visible="eq(-1,true) + eq(-22,true)" values="Auto|Force HD|Force SD"/>
+ <setting label="RMC Découverte HD24" type="bool" id="channels.fr.bfmtv.rmcdecouverte" default="true" visible="eq(-63,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.bfmtv.rmcdecouverte.order" default="32"/>
- <setting label="France 4" type="bool" id="channels.fr.pluzz.france4" default="true" visible="false"/>
- <setting label="30073" type="labelenum" id="channels.fr.pluzz.france4.quality" visible="eq(-1,true) + eq(-24,true)" values="HD|SD"/>
+ <setting label="Stories (6play)" type="bool" id="channels.fr.6play.stories" default="true" visible="eq(-65,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.6play.stories.order" default="33"/>
- <setting label="BFM TV" type="bool" id="channels.fr.bfmtv.bfmtv" default="true" visible="false"/>
- <setting label="30081" type="labelenum" id="channels.fr.bfmtv.bfmtv.quality" visible="eq(-1,true) + eq(-26,true)" values="HD+|HD|SD|SD-"/>
+ <setting label="Bruce (6play)" type="bool" id="channels.fr.6play.bruce" default="true" visible="eq(-67,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.6play.bruce.order" default="34"/>
- <setting label="France Ô" type="bool" id="channels.fr.pluzz.franceo" default="true" visible="false"/>
- <setting label="30075" type="labelenum" id="channels.fr.pluzz.franceo.quality" visible="eq(-1,true) + eq(-28,true)" values="HD|SD"/>
+ <setting label="Crazy Kitchen (6play)" type="bool" id="channels.fr.6play.crazy_kitchen" default="true" visible="eq(-69,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.6play.crazy_kitchen.order" default="35"/>
- <setting label="HD1" type="bool" id="channels.fr.tf1.hd1" default="true" visible="false"/>
- <setting label="30084" type="bool" id="channels.fr.tf1.hd1.bonus" default="true" visible="eq(-1,true) + eq(-30,true)"/>
+ <setting label="Home Time (6play)" type="bool" id="channels.fr.6play.home" default="true" visible="eq(-71,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.6play.home.order" default="36"/>
- <setting label="6ter" type="bool" id="channels.fr.6play.6ter" default="true" visible="false"/>
- <setting label="30078" type="labelenum" id="channels.fr.6play.6ter.quality" visible="eq(-1,true) + eq(-32,true)" values="Auto|Force HD|Force SD"/>
+ <setting label="Sixième Style (6play)" type="bool" id="channels.fr.6play.styles" default="true" visible="eq(-73,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.6play.styles.order" default="37"/>
- <setting label="L'Équipe" type="bool" id="channels.fr.lequipe.lequipe" default="true" visible="false"/>
- <setting label="30086" type="labelenum" id="channels.fr.lequipe.lequipe.quality" visible="eq(-1,true) + eq(-34,true)" values="HD+|HD|SD"/>
+ <setting label="Comic (6play)" type="bool" id="channels.fr.6play.comedy" default="true" visible="eq(-75,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.6play.comedy.order" default="38"/>
- <setting label="Numéro 23" type="bool" id="channels.fr.numero23.numero23" default="true" visible="false"/>
- <setting label="30088" type="labelenum" id="channels.fr.numero23.numero23.quality" visible="eq(-1,true) + eq(-36,true)" values="HD+|HD|SD"/>
+ <setting label="France24" type="bool" id="channels.fr.france24.france24" default="true" visible="eq(-77,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.france24.france24.order" default="39"/>
+
+ <setting label="Public Sénat" type="bool" id="channels.fr.publicsenat.publicsenat" default="true" visible="eq(-79,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.publicsenat.publicsenat.order" default="40"/>
+
+ <!--<setting label="Teva" type="bool" id="channels.fr.6play.teva" default="true" visible="eq(-81,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.6play.teva.order" default="41"/>
+
+ <setting label="Paris Première" type="bool" id="channels.fr.6play.parispremiere" default="true" visible="eq(-83,true)"/>
+ <setting label="" type="number" visible="false" id="channels.fr.6play.parispremiere.order" default="42"/>-->
+
+ <setting label="30023" type="lsep" subsetting="true" visible="eq(1,true)"/>
+ <setting label="30023" type="bool" id="main_menu.eu" default="true" visible="false"/>
+
+ <setting label="Euronews" type="bool" id="channels.eu.euronews.euronews" default="true" visible="eq(-1,true)"/>
+ <setting label="" type="number" visible="false" id="channels.eu.euronews.euronews.order" default="1"/>
+
+ <setting label="Arte" type="bool" id="channels.eu.arte.arte" default="true" visible="eq(-3,true)"/>
+ <setting label="" type="number" visible="false" id="channels.eu.arte.arte.order" default="2"/>
+
+ </category>
+
+
+ <!-- Quality and Content (and also hidden settings) -->
+ <category label="30002">
+
+ <setting label="30070" type="lsep" />
+ <setting label="30087" type="labelenum" id="quality" values="BEST|DEFAULT|DIALOG"/>
+
+ <setting label="30071" type="lsep" />
+ <setting label="30020" type="lsep" subsetting="true" visible="eq(1,true)"/>
+ <setting label="30020" type="bool" id="main_menu.fr" default="true" visible="false"/>
+
+ <setting label="30081" type="labelenum" id="channels.fr.france24.france24.language" visible="eq(-1,true)" values="FR|EN|AR"/>
+
+ <setting label="30023" type="lsep" subsetting="true" visible="eq(1,true)"/>
+ <setting label="30023" type="bool" id="main_menu.eu" default="true" visible="false"/>
+
+ <setting label="30080" type="labelenum" id="channels.eu.arte.arte.language" visible="eq(-1,true)" values="FR|DE"/>
+ <setting label="30082" type="labelenum" id="channels.eu.euronews.euronews.language" visible="eq(-2,true)" values="FR|EN|AR|DE|IT|ES|PT|RU|TR|FA|GR|HU"/>
+
+ <setting label="" type="bool" id="show_hidden_items_information" default="true" visible="false"/>
+ </category>
+
+
+ <!-- Download ... -->
+ <category label="30003">
+ <setting label="30012" type="lsep"/>
+ <setting label="30200" type="folder" id="dlFolder" source="auto" option="writeable"/>
+ </category>
+
+
+ <!-- Account ... -->
+ <category label="30004">
+
+ <setting label="30020" type="lsep" subsetting="true" visible="eq(1,true)"/>
+ <setting label="30020" type="bool" id="main_menu.fr" default="true" visible="false"/>
- <setting label="" type="bool" id="show_hidden_items_information" default="true" visible="false"/>
+ <setting label="NRJ Login" type="text" id="channels.fr.nrj.login" visible="eq(-1,true)" defaut=""/>
+ <setting label="NRJ Password" type="text" id="channels.fr.nrj.password" option="hidden" visible="eq(-2,true)" defaut=""/>
</category>
-
-</settings> \ No newline at end of file
+</settings>
diff --git a/plugin.video.cheddar/LICENSE b/plugin.video.cheddar/LICENSE
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/plugin.video.cheddar/LICENSE
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/plugin.video.cheddar/README.md b/plugin.video.cheddar/README.md
new file mode 100644
index 0000000..e4d90ea
--- /dev/null
+++ b/plugin.video.cheddar/README.md
@@ -0,0 +1 @@
+# plugin.video.cheddar \ No newline at end of file
diff --git a/plugin.video.cheddar/addon.xml b/plugin.video.cheddar/addon.xml
index 42c4ea5..66e244b 100644
--- a/plugin.video.cheddar/addon.xml
+++ b/plugin.video.cheddar/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<addon id="plugin.video.cheddar" name="Cheddar" provider-name="Lunatixz" version="1.0.0">
+<addon id="plugin.video.cheddar" name="Cheddar" provider-name="Lunatixz" version="1.0.1">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
<import addon="script.module.simplecache" version="1.0.0"/>
@@ -16,7 +16,7 @@
<source>https://github.com/Lunatixz/XBMC_Addons/tree/master/plugin.video.cheddar</source>
<website>https://cheddar.com/</website>
<forum>http://forum.kodi.tv/showthread.php?tid=319217</forum>
- <news></news>
+ <news>>v.1.0.1[CR]-Leia Compatibility</news>
<assets>
<icon>resources/images/icon.png</icon>
<fanart>resources/images/fanart.jpg</fanart>
diff --git a/plugin.video.cheddar/default.py b/plugin.video.cheddar/default.py
index 453f672..34a29ae 100644
--- a/plugin.video.cheddar/default.py
+++ b/plugin.video.cheddar/default.py
@@ -17,192 +17,7 @@
# along with Cheddar. If not, see <http://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
-import os, sys, datetime, re, traceback, urllib, urllib2, socket
-import xbmc, xbmcvfs, xbmcgui, xbmcplugin, xbmcaddon
-from simplecache import SimpleCache
-from bs4 import BeautifulSoup
-
-# Plugin Info
-ADDON_ID = 'plugin.video.cheddar'
-REAL_SETTINGS = xbmcaddon.Addon(id=ADDON_ID)
-ADDON_NAME = REAL_SETTINGS.getAddonInfo('name')
-SETTINGS_LOC = REAL_SETTINGS.getAddonInfo('profile')
-ADDON_PATH = REAL_SETTINGS.getAddonInfo('path').decode('utf-8')
-ADDON_VERSION = REAL_SETTINGS.getAddonInfo('version')
-ICON = REAL_SETTINGS.getAddonInfo('icon')
-FANART = REAL_SETTINGS.getAddonInfo('fanart')
-LANGUAGE = REAL_SETTINGS.getLocalizedString
-
-## GLOBALS ##
-TIMEOUT = 30
-BASEURL = 'http://cheddar.com/'
-DEBUG = REAL_SETTINGS.getSetting('Enable_Debugging') == 'true'
-
-Cheddar_MENU = [("Latest" , 'collections/latest', 1),
- ("Browse" , 'collections' , 1)]
-
-def log(msg, level=xbmc.LOGDEBUG):
- if DEBUG == True:
- if level == xbmc.LOGERROR:
- msg += ' ,' + traceback.format_exc()
- xbmc.log(ADDON_ID + '-' + ADDON_VERSION + '-' + msg, level)
-
-def getParams():
- param=[]
- if len(sys.argv[2])>=2:
- params=sys.argv[2]
- cleanedparams=params.replace('?','')
- if (params[len(params)-1]=='/'):
- params=params[0:len(params)-2]
- pairsofparams=cleanedparams.split('&')
- param={}
- for i in range(len(pairsofparams)):
- splitparams={}
- splitparams=pairsofparams[i].split('=')
- if (len(splitparams))==2:
- param[splitparams[0]]=splitparams[1]
- return param
-
-socket.setdefaulttimeout(TIMEOUT)
-class Cheddar():
- def __init__(self):
- log('__init__')
- self.cache = SimpleCache()
-
-
- def openURL(self, url):
- try:
- cacheResponce = self.cache.get(ADDON_NAME + '.openURL, url = %s'%url)
- if not cacheResponce:
- request = urllib2.Request(url)
- request.add_header('User-Agent','Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)')
- response = urllib2.urlopen(request, timeout=TIMEOUT)
- results = response.read()
- response.close()
- self.cache.set(ADDON_NAME + '.openURL, url = %s'%url, results, expiration=datetime.timedelta(hours=12))
- return self.cache.get(ADDON_NAME + '.openURL, url = %s'%url)
- except urllib2.URLError, e:
- log("openURL Failed! " + str(e), xbmc.LOGERROR)
- except socket.timeout, e:
- log("openURL Failed! " + str(e), xbmc.LOGERROR)
- except:
- xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30001), ICON, 4000)
-
-
- def mainMenu(self):
- log('mainMenu')
- self.addLink('Live', '', 0)
- for item in Cheddar_MENU:
- self.addDir(*item)
-
-
- def browseLive(self):
- log('browseLive')
- soup = BeautifulSoup(self.openURL(BASEURL), "html.parser")
- liveLink = 'http:' + soup('div', {'class': 'hero_video'})[0].find('source').get('src')
- self.playVideo('Live', liveLink)
-
-
- def browse(self, link):
- log('browse')
- soup = BeautifulSoup(self.openURL(BASEURL+link), "html.parser")
- latestLink = (soup('div', {'class': 'video_thumb'}))
- for item in latestLink:
- try:
- uriLink = item('a', {'class': 'cf'})[0]
- uri = BASEURL + uriLink['href']
- thumb = uriLink('div', {'class': 'vid_img'})[0].find_all('img')[0].get('src')
- airdate, title = uriLink.text.strip().replace('\r','').replace('\t','').split('\n')
- plot = 'Aired: %s'%airdate
- label = title.strip()
- airdate = datetime.datetime.strptime(airdate, "%B %d, %Y")
- infoList = {"mediatype":'video',"label":label,"title":label,"plot":plot,'genre':'News',"studio":"cheddar","aired":airdate.strftime('%Y-%m-%d'),"date":airdate.strftime('%d/%m/%Y')}
- infoArt = {"thumb":thumb,"poster":thumb,"fanart":FANART}
- self.addLink(label, uri, 9, infoList, infoArt)
- except:
- xbmc.executebuiltin("Container.Refresh")
-
-
- def playVideo(self, name, uri):
- log('playVideo, uri = ' + uri)
- try:
- metaLink = BeautifulSoup(self.openURL(uri), "html.parser")
- meta = metaLink('div', {'class': 'wrap video_details'})[0]('div', {'class': 'video_details_content'})[0]
- title = meta.find('h4').text
- plot = meta.find('article').text
- airdate = meta.find('p').text
- plotout = 'Aired: %s'%airdate
- airdate = datetime.datetime.strptime(airdate, "%B %d, %Y")
- url = metaLink('div', {'class': 'hero_video'})[0].find('source').get('src')+'.mp4'
- thumb = metaLink('div', {'class': 'hero_video'})[0].find('video').get('poster')
- infoList = {"mediatype":'video',"label":title,"title":title,"plot":plot,'genre':'News',"plotoutline":plotout,"studio":"cheddar","aired":airdate.strftime('%Y-%m-%d')}
- infoArt = {"thumb":thumb,"poster":thumb,"fanart":FANART}
- liz = xbmcgui.ListItem(title, path=url)
- liz.setInfo(type="Video", infoLabels=infoList)
- liz.setArt(infoArt)
- except:
- liz = xbmcgui.ListItem(name, path=uri)
- xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
-
-
- def addLink(self, name, u, mode, infoList=False, infoArt=False, total=0):
- name = name.encode("utf-8")
- log('addLink, name = ' + name)
- liz=xbmcgui.ListItem(name)
- liz.setProperty('IsPlayable', 'true')
- if infoList == False:
- liz.setInfo(type="Video", infoLabels={"mediatype":"video","label":name,"title":name})
- else:
- liz.setInfo(type="Video", infoLabels=infoList)
-
- if infoArt == False:
- liz.setArt({'thumb':ICON,'fanart':FANART})
- else:
- liz.setArt(infoArt)
- u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
- xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,totalItems=total)
-
-
- def addDir(self, name, u, mode, infoList=False, infoArt=False):
- name = name.encode("utf-8")
- log('addDir, name = ' + name)
- liz=xbmcgui.ListItem(name)
- liz.setProperty('IsPlayable', 'false')
- if infoList == False:
- liz.setInfo(type="Video", infoLabels={"mediatype":"video","label":name,"title":name} )
- else:
- liz.setInfo(type="Video", infoLabels=infoList)
- if infoArt == False:
- liz.setArt({'thumb':ICON,'fanart':FANART})
- else:
- liz.setArt(infoArt)
- u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
- xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
-
-params=getParams()
-try:
- url=urllib.unquote_plus(params["url"])
-except:
- url=None
-try:
- name=urllib.unquote_plus(params["name"])
-except:
- name=None
-try:
- mode=int(params["mode"])
-except:
- mode=None
-
-log("Mode: "+str(mode))
-log("URL : "+str(url))
-log("Name: "+str(name))
-
-if mode==None: Cheddar().mainMenu()
-elif mode == 0: Cheddar().browseLive()
-elif mode == 1: Cheddar().browse(url)
-elif mode == 9: Cheddar().playVideo(name, url)
-
-xbmcplugin.addSortMethod(int(sys.argv[1]) , xbmcplugin.SORT_METHOD_NONE )
-xbmcplugin.addSortMethod(int(sys.argv[1]) , xbmcplugin.SORT_METHOD_LABEL )
-xbmcplugin.endOfDirectory(int(sys.argv[1]), cacheToDisc=True) \ No newline at end of file
+#entrypoint
+if __name__ == '__main__':
+ from resources.lib import cheddar \ No newline at end of file
diff --git a/plugin.video.cheddar/resources/__init__.py b/plugin.video.cheddar/resources/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.cheddar/resources/__init__.py
diff --git a/plugin.video.cheddar/resources/lib/__init__.py b/plugin.video.cheddar/resources/lib/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.cheddar/resources/lib/__init__.py
diff --git a/plugin.video.cheddar/resources/lib/cheddar.py b/plugin.video.cheddar/resources/lib/cheddar.py
new file mode 100644
index 0000000..7e2e634
--- /dev/null
+++ b/plugin.video.cheddar/resources/lib/cheddar.py
@@ -0,0 +1,212 @@
+# Copyright (C) 2017 Lunatixz
+#
+#
+# This file is part of Cheddar
+#
+# Cheddar is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Cheddar is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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 Cheddar. If not, see <http://www.gnu.org/licenses/>.
+
+# -*- coding: utf-8 -*-
+import os, sys, datetime, re, traceback, urllib, urllib2, socket
+import xbmc, xbmcvfs, xbmcgui, xbmcplugin, xbmcaddon
+
+from simplecache import SimpleCache
+from bs4 import BeautifulSoup
+
+# Plugin Info
+ADDON_ID = 'plugin.video.cheddar'
+REAL_SETTINGS = xbmcaddon.Addon(id=ADDON_ID)
+ADDON_NAME = REAL_SETTINGS.getAddonInfo('name')
+SETTINGS_LOC = REAL_SETTINGS.getAddonInfo('profile')
+ADDON_PATH = REAL_SETTINGS.getAddonInfo('path').decode('utf-8')
+ADDON_VERSION = REAL_SETTINGS.getAddonInfo('version')
+ICON = REAL_SETTINGS.getAddonInfo('icon')
+FANART = REAL_SETTINGS.getAddonInfo('fanart')
+LANGUAGE = REAL_SETTINGS.getLocalizedString
+
+## GLOBALS ##
+TIMEOUT = 30
+BASEURL = 'http://cheddar.com/'
+DEBUG = REAL_SETTINGS.getSetting('Enable_Debugging') == 'true'
+CONTENT_TYPE = 'files'
+
+Cheddar_MENU = [("Latest" , 'collections/latest', 1),
+ ("Browse" , 'collections' , 1)]
+
+def log(msg, level=xbmc.LOGDEBUG):
+ if DEBUG == True:
+ if level == xbmc.LOGERROR:
+ msg += ' ,' + traceback.format_exc()
+ xbmc.log(ADDON_ID + '-' + ADDON_VERSION + '-' + msg, level)
+
+def getParams():
+ param=[]
+ if len(sys.argv[2])>=2:
+ params=sys.argv[2]
+ cleanedparams=params.replace('?','')
+ if (params[len(params)-1]=='/'):
+ params=params[0:len(params)-2]
+ pairsofparams=cleanedparams.split('&')
+ param={}
+ for i in range(len(pairsofparams)):
+ splitparams={}
+ splitparams=pairsofparams[i].split('=')
+ if (len(splitparams))==2:
+ param[splitparams[0]]=splitparams[1]
+ return param
+
+socket.setdefaulttimeout(TIMEOUT)
+class Cheddar():
+ def __init__(self):
+ log('__init__')
+ self.cache = SimpleCache()
+
+
+ def openURL(self, url):
+ try:
+ cacheResponce = self.cache.get(ADDON_NAME + '.openURL, url = %s'%url)
+ if not cacheResponce:
+ request = urllib2.Request(url)
+ request.add_header('User-Agent','Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)')
+ response = urllib2.urlopen(request, timeout=TIMEOUT)
+ results = response.read()
+ response.close()
+ self.cache.set(ADDON_NAME + '.openURL, url = %s'%url, results, expiration=datetime.timedelta(hours=12))
+ return self.cache.get(ADDON_NAME + '.openURL, url = %s'%url)
+ except urllib2.URLError as e:
+ log("openURL Failed! " + str(e), xbmc.LOGERROR)
+ except socket.timeout as e:
+ log("openURL Failed! " + str(e), xbmc.LOGERROR)
+ except:
+ xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30001), ICON, 4000)
+
+
+ def mainMenu(self):
+ log('mainMenu')
+ self.addLink('Live', '', 0)
+ for item in Cheddar_MENU:
+ self.addDir(*item)
+
+
+ def browseLive(self):
+ log('browseLive')
+ soup = BeautifulSoup(self.openURL(BASEURL), "html.parser")
+ liveLink = 'http:' + soup('div', {'class': 'hero_video'})[0].find('source').get('src')
+ self.playVideo('Live', liveLink)
+
+
+ def browse(self, link):
+ log('browse')
+ soup = BeautifulSoup(self.openURL(BASEURL+link), "html.parser")
+ latestLink = (soup('div', {'class': 'video_thumb'}))
+ for item in latestLink:
+ try:
+ uriLink = item('a', {'class': 'cf'})[0]
+ uri = BASEURL + uriLink['href']
+ thumb = uriLink('div', {'class': 'vid_img'})[0].find_all('img')[0].get('src')
+ airdate, title = uriLink.text.strip().replace('\r','').replace('\t','').split('\n')
+ plot = 'Aired: %s'%airdate
+ label = title.strip()
+ airdate = datetime.datetime.strptime(airdate, "%B %d, %Y")
+ infoList = {"mediatype":'video',"label":label,"title":label,"plot":plot,'genre':'News',"studio":"cheddar","aired":airdate.strftime('%Y-%m-%d'),"date":airdate.strftime('%d/%m/%Y')}
+ infoArt = {"thumb":thumb,"poster":thumb,"fanart":FANART}
+ self.addLink(label, uri, 9, infoList, infoArt)
+ except:
+ xbmc.executebuiltin("Container.Refresh")
+
+
+ def playVideo(self, name, uri):
+ log('playVideo, uri = ' + uri)
+ try:
+ metaLink = BeautifulSoup(self.openURL(uri), "html.parser")
+ meta = metaLink('div', {'class': 'wrap video_details'})[0]('div', {'class': 'video_details_content'})[0]
+ title = meta.find('h4').text
+ plot = meta.find('article').text
+ airdate = meta.find('p').text
+ plotout = 'Aired: %s'%airdate
+ airdate = datetime.datetime.strptime(airdate, "%B %d, %Y")
+ url = metaLink('div', {'class': 'hero_video'})[0].find('source').get('src')+'.mp4'
+ thumb = metaLink('div', {'class': 'hero_video'})[0].find('video').get('poster')
+ infoList = {"mediatype":'video',"label":title,"title":title,"plot":plot,'genre':'News',"plotoutline":plotout,"studio":"cheddar","aired":airdate.strftime('%Y-%m-%d')}
+ infoArt = {"thumb":thumb,"poster":thumb,"fanart":FANART}
+ liz = xbmcgui.ListItem(title, path=url)
+ liz.setInfo(type="Video", infoLabels=infoList)
+ liz.setArt(infoArt)
+ except:
+ liz = xbmcgui.ListItem(name, path=uri)
+ xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
+
+
+ def addLink(self, name, u, mode, infoList=False, infoArt=False, total=0):
+ name = name.encode("utf-8")
+ log('addLink, name = ' + name)
+ liz=xbmcgui.ListItem(name)
+ liz.setProperty('IsPlayable', 'true')
+ if infoList == False:
+ liz.setInfo(type="Video", infoLabels={"mediatype":"video","label":name,"title":name})
+ else:
+ liz.setInfo(type="Video", infoLabels=infoList)
+
+ if infoArt == False:
+ liz.setArt({'thumb':ICON,'fanart':FANART})
+ else:
+ liz.setArt(infoArt)
+ u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
+ xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,totalItems=total)
+
+
+ def addDir(self, name, u, mode, infoList=False, infoArt=False):
+ name = name.encode("utf-8")
+ log('addDir, name = ' + name)
+ liz=xbmcgui.ListItem(name)
+ liz.setProperty('IsPlayable', 'false')
+ if infoList == False:
+ liz.setInfo(type="Video", infoLabels={"mediatype":"video","label":name,"title":name} )
+ else:
+ liz.setInfo(type="Video", infoLabels=infoList)
+ if infoArt == False:
+ liz.setArt({'thumb':ICON,'fanart':FANART})
+ else:
+ liz.setArt(infoArt)
+ u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
+ xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
+
+params=getParams()
+try:
+ url=urllib.unquote_plus(params["url"])
+except:
+ url=None
+try:
+ name=urllib.unquote_plus(params["name"])
+except:
+ name=None
+try:
+ mode=int(params["mode"])
+except:
+ mode=None
+
+log("Mode: "+str(mode))
+log("URL : "+str(url))
+log("Name: "+str(name))
+
+if mode==None: Cheddar().mainMenu()
+elif mode == 0: Cheddar().browseLive()
+elif mode == 1: Cheddar().browse(url)
+elif mode == 9: Cheddar().playVideo(name, url)
+
+xbmcplugin.setContent(int(sys.argv[1]) , CONTENT_TYPE)
+xbmcplugin.addSortMethod(int(sys.argv[1]) , xbmcplugin.SORT_METHOD_UNSORTED)
+xbmcplugin.addSortMethod(int(sys.argv[1]) , xbmcplugin.SORT_METHOD_NONE)
+xbmcplugin.addSortMethod(int(sys.argv[1]) , xbmcplugin.SORT_METHOD_LABEL)
+xbmcplugin.addSortMethod(int(sys.argv[1]) , xbmcplugin.SORT_METHOD_TITLE)
+xbmcplugin.endOfDirectory(int(sys.argv[1]), cacheToDisc=True) \ No newline at end of file
diff --git a/plugin.video.cnn/LICENSE b/plugin.video.cnn/LICENSE
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/plugin.video.cnn/LICENSE
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/plugin.video.cnn/README.md b/plugin.video.cnn/README.md
new file mode 100644
index 0000000..4e26aba
--- /dev/null
+++ b/plugin.video.cnn/README.md
@@ -0,0 +1 @@
+# plugin.video.cnn \ No newline at end of file
diff --git a/plugin.video.cnn/addon.xml b/plugin.video.cnn/addon.xml
new file mode 100644
index 0000000..4ea6642
--- /dev/null
+++ b/plugin.video.cnn/addon.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<addon id="plugin.video.cnn" version="1.0.0" name="CNN" provider-name="Lunatixz">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="script.module.simplecache" version="1.0.0"/>
+ <import addon="script.module.youtube.dl" version="17.0.0"/>
+ <import addon="script.module.beautifulsoup4" version="4.3.2"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource" library="default.py">
+ <provides>video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <summary lang="en_GB">Instant breaking news alerts and the most talked about stories.</summary>
+ <description lang="en_GB">CNN.com is among the world's leaders in online news and information delivery. Staffed 24 hours, seven days a week by a dedicated staff in CNN's world headquarters in Atlanta, Georgia, and in bureaus worldwide, CNN.com relies heavily on CNN's global team of almost 4,000 news professionals. CNN.com features the latest multimedia technologies, from live video streaming to audio packages to searchable archives of news features and background information. The site is updated continuously throughout the day.</description>
+ <platform>all</platform>
+ <license>GNU GENERAL PUBLIC LICENSE. Version 3, June 2007</license>
+ <source>https://github.com/Lunatixz/plugin.video.cnn/tree/master</source>
+ <website>http://cnn.com</website>
+ <news></news>
+ <forum>https://forum.kodi.tv/showthread.php?tid=324060</forum>
+ <assets>
+ <icon>resources/images/icon.png</icon>
+ <fanart>resources/images/fanart.jpg</fanart>
+ <screenshot>resources/images/screenshot01.png</screenshot>
+ <screenshot>resources/images/screenshot02.png</screenshot>
+ <screenshot>resources/images/screenshot03.png</screenshot>
+ </assets>
+ </extension>
+</addon>
diff --git a/plugin.video.cnn/default.py b/plugin.video.cnn/default.py
new file mode 100644
index 0000000..597cb1b
--- /dev/null
+++ b/plugin.video.cnn/default.py
@@ -0,0 +1,23 @@
+# Copyright (C) 2017 Lunatixz
+#
+#
+# This file is part of CNN.
+#
+# CNN is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# CNN is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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 CNN. If not, see <http://www.gnu.org/licenses/>.
+
+# -*- coding: utf-8 -*-
+
+#entrypoint
+if __name__ == '__main__':
+ from resources.lib import cnn \ No newline at end of file
diff --git a/plugin.video.cnn/resources/__init__.py b/plugin.video.cnn/resources/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.cnn/resources/__init__.py
diff --git a/plugin.video.cnn/resources/images/fanart.jpg b/plugin.video.cnn/resources/images/fanart.jpg
new file mode 100644
index 0000000..45f8a57
--- /dev/null
+++ b/plugin.video.cnn/resources/images/fanart.jpg
Binary files differ
diff --git a/plugin.video.cnn/resources/images/icon.png b/plugin.video.cnn/resources/images/icon.png
new file mode 100644
index 0000000..b3497fa
--- /dev/null
+++ b/plugin.video.cnn/resources/images/icon.png
Binary files differ
diff --git a/plugin.video.cnn/resources/images/screenshot01.png b/plugin.video.cnn/resources/images/screenshot01.png
new file mode 100644
index 0000000..376b9df
--- /dev/null
+++ b/plugin.video.cnn/resources/images/screenshot01.png
Binary files differ
diff --git a/plugin.video.cnn/resources/images/screenshot02.png b/plugin.video.cnn/resources/images/screenshot02.png
new file mode 100644
index 0000000..9b720b2
--- /dev/null
+++ b/plugin.video.cnn/resources/images/screenshot02.png
Binary files differ
diff --git a/plugin.video.cnn/resources/images/screenshot03.png b/plugin.video.cnn/resources/images/screenshot03.png
new file mode 100644
index 0000000..62e4460
--- /dev/null
+++ b/plugin.video.cnn/resources/images/screenshot03.png
Binary files differ
diff --git a/plugin.video.cnn/resources/language/resource.language.en_gb/strings.po b/plugin.video.cnn/resources/language/resource.language.en_gb/strings.po
new file mode 100644
index 0000000..56c8792
--- /dev/null
+++ b/plugin.video.cnn/resources/language/resource.language.en_gb/strings.po
@@ -0,0 +1,29 @@
+# Kodi Media Center language file
+# Addon Name: "CNN
+# Addon id: plugin.video.cnn
+# Addon Provider: Lunatixz
+msgid ""
+msgstr ""
+"Project-Id-Version: plugin.video.cnn\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Lunatixz Translation Team\n"
+"Language-Team: English (http://www.transifex.com/projects/p/xbmc-addons/language/en/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "#30000"
+msgid "Enable Debugging [Log errors]"
+msgstr ""
+
+msgctxt "#30001"
+msgid "Something went wrong, Try again..."
+msgstr ""
+
+msgctxt "#30002"
+msgid "Select Preferred Quality"
+msgstr ""
diff --git a/plugin.video.cnn/resources/lib/__init__.py b/plugin.video.cnn/resources/lib/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.cnn/resources/lib/__init__.py
diff --git a/plugin.video.cnn/resources/lib/cnn.py b/plugin.video.cnn/resources/lib/cnn.py
new file mode 100644
index 0000000..b0c8a96
--- /dev/null
+++ b/plugin.video.cnn/resources/lib/cnn.py
@@ -0,0 +1,208 @@
+# Copyright (C) 2017 Lunatixz
+#
+#
+# This file is part of CNN.
+#
+# CNN is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# CNN is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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 CNN. If not, see <http://www.gnu.org/licenses/>.
+
+# -*- coding: utf-8 -*-
+import sys, time, datetime, re, traceback
+import urllib, urllib2, socket, json
+import xbmc, xbmcgui, xbmcplugin, xbmcaddon
+
+from bs4 import BeautifulSoup
+from YDStreamExtractor import getVideoInfo
+from simplecache import SimpleCache, use_cache
+
+# Plugin Info
+ADDON_ID = 'plugin.video.cnn'
+REAL_SETTINGS = xbmcaddon.Addon(id=ADDON_ID)
+ADDON_NAME = REAL_SETTINGS.getAddonInfo('name')
+SETTINGS_LOC = REAL_SETTINGS.getAddonInfo('profile')
+ADDON_PATH = REAL_SETTINGS.getAddonInfo('path').decode('utf-8')
+ADDON_VERSION = REAL_SETTINGS.getAddonInfo('version')
+ICON = REAL_SETTINGS.getAddonInfo('icon')
+FANART = REAL_SETTINGS.getAddonInfo('fanart')
+LANGUAGE = REAL_SETTINGS.getLocalizedString
+
+## GLOBALS ##
+TIMEOUT = 15
+CONTENT_TYPE = 'files'
+DEBUG = REAL_SETTINGS.getSetting('Enable_Debugging') == 'true'
+QUALITY = int(REAL_SETTINGS.getSetting('Quality'))
+BASE_URL = 'http://www.cnn.com'
+SHORTS_URL = 'http://www.cnn.com/specials/videos/digital-shorts'
+JSON_URL = 'http://www.cnn.com/video/data/3.0/video/%s/relateds.json'
+MENU_ITEMS = ['Business', 'Entertainment', 'Health', 'Justice', 'Living', 'CNNMoney', 'Politics', 'Style', 'Technology', 'Travel', 'TV', 'US', 'World', 'Weather']
+
+def log(msg, level=xbmc.LOGDEBUG):
+ if DEBUG == False and level != xbmc.LOGERROR: return
+ if level == xbmc.LOGERROR: msg += ' ,' + traceback.format_exc()
+ xbmc.log(ADDON_ID + '-' + ADDON_VERSION + '-' + msg, level)
+
+def getParams():
+ param=[]
+ if len(sys.argv[2])>=2:
+ params=sys.argv[2]
+ cleanedparams=params.replace('?','')
+ if (params[len(params)-1]=='/'): params=params[0:len(params)-2]
+ pairsofparams=cleanedparams.split('&')
+ param={}
+ for i in range(len(pairsofparams)):
+ splitparams={}
+ splitparams=pairsofparams[i].split('=')
+ if (len(splitparams))==2: param[splitparams[0]]=splitparams[1]
+ return param
+
+socket.setdefaulttimeout(TIMEOUT)
+class CNN(object):
+ def __init__(self):
+ log('__init__')
+ self.cache = SimpleCache()
+
+
+ def openURL(self, url):
+ log('openURL, url = ' + str(url))
+ try:
+ cacheresponse = self.cache.get(ADDON_NAME + '.openURL, url = %s'%url)
+ if not cacheresponse:
+ request = urllib2.Request(url)
+ response = urllib2.urlopen(request, timeout = TIMEOUT).read()
+ self.cache.set(ADDON_NAME + '.openURL, url = %s'%url, response, expiration=datetime.timedelta(hours=1))
+ return self.cache.get(ADDON_NAME + '.openURL, url = %s'%url)
+ except Exception as e:
+ log("openURL Failed! " + str(e), xbmc.LOGERROR)
+ xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30001), ICON, 4000)
+ return ''
+
+
+ def buildMenu(self):
+ for item in MENU_ITEMS: self.addDir(item, JSON_URL%item.lower(), 1)
+ self.addDir('Digital Shorts', SHORTS_URL, 2)
+ self.addYoutube("Browse Youtube" , 'plugin://plugin.video.youtube/user/CNN/')
+
+
+ def browse(self, name, url):
+ log('browse, ' + name)
+ response = json.loads(self.openURL(url))
+ items = response['videos']
+ for item in items:
+ try:
+ runtime = item['duration'].split(':')
+ if len(runtime) == 3:
+ h, m, s = runtime
+ duration = int(h) * 3600 + int(m) * 60 + int(s)
+ else:
+ m, s = runtime
+ duration = int(m) * 60 + int(s)
+ except: duration = item['duration']
+ label = item['headline']
+ thumb = 'http:%s'%item['fullsize_url']
+ infoLabels = {"mediatype":"episode","label":label ,"title":label,"duration":duration,"plot":item['description'],"genre":"News"}
+ infoArt = {"thumb":thumb,"poster":thumb,"fanart":FANART,"icon":ICON,"logo":ICON}
+ self.addLink(label, BASE_URL + item['clickback_url'], 9, infoLabels, infoArt, len(items))
+
+
+ def browseShorts(self, name, url):
+ log('browseShorts, ' + name)
+ soup = BeautifulSoup(self.openURL(url), "html.parser")
+ videos = soup('article', {'class': 'cd'})
+ for video in videos:
+ vid_url = video('h3', {'class': 'cd__headline'})[0].find('a')['href']
+ if not vid_url.startswith('http'): vid_url = BASE_URL + vid_url
+ if vid_url.startswith('http://cnn.it'): continue
+ if not '/video' in vid_url: continue
+ thumb = (video('div', {'class': 'cd__wrapper'})[0])
+ try: thumb = 'http:' + (json.loads((re.search('"large":(.*?)"},', str(thumb)).group(1) + '"}'))['uri'])
+ except: thumb = ICON
+ results = video('div', {'class': 'cd__content'})[0]
+ try: title = results('div', {'class': 'cd__kicker'})[0].get_text()
+ except: title = None
+ subtitle = results('span', {'class': 'cd__headline-text'})[0].get_text()
+ label = '%s - %s'%(title, subtitle) if title is not None else subtitle
+ try: plot = results('div', {'class': 'cd__description'})[0].get_text()
+ except: plot = subtitle
+ duration = 0
+ infoLabels = {"mediatype":"episode","label":label ,"title":label,"duration":duration,"plot":plot}
+ infoArt = {"thumb":thumb,"poster":thumb,"fanart":FANART,"icon":ICON,"logo":ICON}
+ self.addLink(label, vid_url, 9, infoLabels, infoArt, len(videos))
+
+
+ def playVideo(self, name, url, liz=None):
+ log('playVideo')
+ info = getVideoInfo(url,QUALITY,True)
+ if info is None: return
+ info = info.streams()
+ url = info[0]['xbmc_url']
+ liz = xbmcgui.ListItem(name, path=url)
+ if 'subtitles' in info[0]['ytdl_format']: liz.setSubtitles([x['url'] for x in info[0]['ytdl_format']['subtitles'].get('en','') if 'url' in x])
+ xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
+
+
+ def addYoutube(self, name, url):
+ liz=xbmcgui.ListItem(name)
+ liz.setProperty('IsPlayable', 'false')
+ liz.setInfo(type="Video", infoLabels={"label":name,"title":name} )
+ liz.setArt({'thumb':ICON,'fanart':FANART})
+ xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=liz,isFolder=True)
+
+
+ def addLink(self, name, u, mode, infoList=False, infoArt=False, total=0):
+ name = name.encode("utf-8")
+ log('addLink, name = ' + name)
+ liz=xbmcgui.ListItem(name)
+ liz.setProperty('IsPlayable', 'true')
+ if infoList == False: liz.setInfo(type="Video", infoLabels={"mediatype":"video","label":name,"title":name})
+ else: liz.setInfo(type="Video", infoLabels=infoList)
+ if infoArt == False: liz.setArt({'thumb':ICON,'fanart':FANART})
+ else: liz.setArt(infoArt)
+ u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
+ xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,totalItems=total)
+
+
+ def addDir(self, name, u, mode, infoList=False, infoArt=False):
+ name = name.encode("utf-8")
+ log('addDir, name = ' + name)
+ liz=xbmcgui.ListItem(name)
+ liz.setProperty('IsPlayable', 'false')
+ if infoList == False: liz.setInfo(type="Video", infoLabels={"mediatype":"video","label":name,"title":name})
+ else: liz.setInfo(type="Video", infoLabels=infoList)
+ if infoArt == False: liz.setArt({'thumb':ICON,'fanart':FANART})
+ else: liz.setArt(infoArt)
+ u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
+ xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
+
+
+params=getParams()
+try: url=urllib.unquote_plus(params["url"])
+except: url=None
+try: name=urllib.unquote_plus(params["name"])
+except: name=None
+try: mode=int(params["mode"])
+except: mode=None
+log("Mode: "+str(mode))
+log("URL : "+str(url))
+log("Name: "+str(name))
+
+if mode==None: CNN().buildMenu()
+elif mode == 1: CNN().browse(name, url)
+elif mode == 2: CNN().browseShorts(name, url)
+elif mode == 9: CNN().playVideo(name, url)
+
+xbmcplugin.setContent(int(sys.argv[1]) , CONTENT_TYPE)
+xbmcplugin.addSortMethod(int(sys.argv[1]) , xbmcplugin.SORT_METHOD_UNSORTED)
+xbmcplugin.addSortMethod(int(sys.argv[1]) , xbmcplugin.SORT_METHOD_NONE)
+xbmcplugin.addSortMethod(int(sys.argv[1]) , xbmcplugin.SORT_METHOD_LABEL)
+xbmcplugin.addSortMethod(int(sys.argv[1]) , xbmcplugin.SORT_METHOD_TITLE)
+xbmcplugin.endOfDirectory(int(sys.argv[1]), cacheToDisc=True) \ No newline at end of file
diff --git a/plugin.video.cnn/resources/settings.xml b/plugin.video.cnn/resources/settings.xml
new file mode 100644
index 0000000..fbc5978
--- /dev/null
+++ b/plugin.video.cnn/resources/settings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<settings>
+ <setting id="Enable_Debugging" type="bool" label="30000" default="false" />
+ <setting id="Quality" type="enum" label="30002" default="3" values="SD|720p|1080p|Highest Available"/>
+</settings>
diff --git a/plugin.video.conversasabenfica/LICENSE b/plugin.video.conversasabenfica/LICENSE
new file mode 100644
index 0000000..bebefc9
--- /dev/null
+++ b/plugin.video.conversasabenfica/LICENSE
@@ -0,0 +1,692 @@
+Copyright (c) 2017 enen92 <enen92@kodi.tv> (https://www.youtube.com/channel/UCpWxnp_Pe3PlJYBFeMIvitA)
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY 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 <http://www.gnu.org/licenses/>
+
+
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ {one line to give the program's name and a brief idea of what it does.}
+ Copyright (C) {year} {name of author}
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ {project} Copyright (C) {year} {fullname}
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+
diff --git a/plugin.video.conversasabenfica/addon.xml b/plugin.video.conversasabenfica/addon.xml
new file mode 100644
index 0000000..1807cc1
--- /dev/null
+++ b/plugin.video.conversasabenfica/addon.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<addon id="plugin.video.conversasabenfica" name="Conversas à Benfica" version="1.0.0" provider-name="enen92">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="script.module.routing" version="0.2.0"/>
+ <import addon="script.module.requests" version="2.12.4"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource" library="main.py">
+ <provides>video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <summary lang="en_GB">Watch Conversas à Benfica, a youtube podcast made by Benfica fans for Benfica fans</summary>
+ <summary lang="pt_PT">Conversas à Benfica, um podcast no youtube feito por Benfiquistas para Benfiquistas!</summary>
+ <description lang="en_GB">Conversas à Benfica... Easy![CR]For the ones who love Benfica and (almost) everything around it.[CR]Everything related with the played football and the stands.[CR]History, laughs and beers![CR]ONE LIFE, ONE GAME!</description>
+ <description lang="pt_PT">Conversas à Benfica... Fácil![CR]Para quem gosta do Benfica e de (quase) tudo o que gira à sua volta.[CR]Tudo o que envolve futebol nos relvados e nas bancadas. Futebol positivo![CR] Histórias, gargalhadas e umas cervejas![CR]UMA VIDA, UM JOGO!</description>
+ <language>pt</language>
+ <platform>all</platform>
+ <license>GPL-3.0</license>
+ <forum>https://forum.kodi.tv/showthread.php?tid=319630</forum>
+ <website>https://www.youtube.com/channel/UCpWxnp_Pe3PlJYBFeMIvitA</website>
+ <email>enen92@kodi.tv</email>
+ <source>https://github.com/enen92/plugin.video.conversasabenfica</source>
+ <news>The first version of the addon</news>
+ <disclaimer></disclaimer>
+ <assets>
+ <icon>resources/images/icon.png</icon>
+ <fanart>resources/images/fanart.jpg</fanart>
+ <screenshot>resources/images/screenshot-1.png</screenshot>
+ <screenshot>resources/images/screenshot-2.png</screenshot>
+ <screenshot>resources/images/screenshot-3.png</screenshot>
+ <screenshot>resources/images/screenshot-4.png</screenshot>
+ </assets>
+ </extension>
+</addon>
diff --git a/plugin.video.conversasabenfica/changelog.txt b/plugin.video.conversasabenfica/changelog.txt
new file mode 100644
index 0000000..c1c4b96
--- /dev/null
+++ b/plugin.video.conversasabenfica/changelog.txt
@@ -0,0 +1,2 @@
+v1.0.0
+- The first version of the addon \ No newline at end of file
diff --git a/plugin.video.conversasabenfica/main.py b/plugin.video.conversasabenfica/main.py
new file mode 100644
index 0000000..c438b1d
--- /dev/null
+++ b/plugin.video.conversasabenfica/main.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+
+from resources.lib import plugin
+import xbmcaddon
+
+
+plugin.run()
+
+
diff --git a/plugin.video.conversasabenfica/resources/__init__.py b/plugin.video.conversasabenfica/resources/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.conversasabenfica/resources/__init__.py
diff --git a/plugin.video.conversasabenfica/resources/images/fanart.jpg b/plugin.video.conversasabenfica/resources/images/fanart.jpg
new file mode 100644
index 0000000..2cae27a
--- /dev/null
+++ b/plugin.video.conversasabenfica/resources/images/fanart.jpg
Binary files differ
diff --git a/plugin.video.conversasabenfica/resources/images/icon.png b/plugin.video.conversasabenfica/resources/images/icon.png
new file mode 100644
index 0000000..41e88c9
--- /dev/null
+++ b/plugin.video.conversasabenfica/resources/images/icon.png
Binary files differ
diff --git a/plugin.video.conversasabenfica/resources/images/screenshot-1.png b/plugin.video.conversasabenfica/resources/images/screenshot-1.png
new file mode 100644
index 0000000..bcacdd7
--- /dev/null
+++ b/plugin.video.conversasabenfica/resources/images/screenshot-1.png
Binary files differ
diff --git a/plugin.video.conversasabenfica/resources/images/screenshot-2.png b/plugin.video.conversasabenfica/resources/images/screenshot-2.png
new file mode 100644
index 0000000..5a4a036
--- /dev/null
+++ b/plugin.video.conversasabenfica/resources/images/screenshot-2.png
Binary files differ
diff --git a/plugin.video.conversasabenfica/resources/images/screenshot-3.png b/plugin.video.conversasabenfica/resources/images/screenshot-3.png
new file mode 100644
index 0000000..72babb0
--- /dev/null
+++ b/plugin.video.conversasabenfica/resources/images/screenshot-3.png
Binary files differ
diff --git a/plugin.video.conversasabenfica/resources/images/screenshot-4.png b/plugin.video.conversasabenfica/resources/images/screenshot-4.png
new file mode 100644
index 0000000..1419958
--- /dev/null
+++ b/plugin.video.conversasabenfica/resources/images/screenshot-4.png
Binary files differ
diff --git a/plugin.video.conversasabenfica/resources/language/resource.language.en_gb/strings.po b/plugin.video.conversasabenfica/resources/language/resource.language.en_gb/strings.po
new file mode 100644
index 0000000..64db3e9
--- /dev/null
+++ b/plugin.video.conversasabenfica/resources/language/resource.language.en_gb/strings.po
@@ -0,0 +1,55 @@
+# Kodi Media Center language file
+# Addon Name: Conversas à Benfica
+# Addon id: plugin.video.conversasabenfica
+# Addon Provider: enen92
+msgid ""
+msgstr ""
+"Project-Id-Version: XBMC Addons\n"
+"Report-Msgid-Bugs-To: alanwww1@xbmc.org\n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Kodi Translation Team\n"
+"Language-Team: English (http://www.transifex.com/projects/p/xbmc-addons/language/en/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#This is a comment
+
+msgctxt "#32000"
+msgid "All videos"
+msgstr ""
+
+msgctxt "#32001"
+msgid "Watch all uploaded videos"
+msgstr ""
+
+msgctxt "#32002"
+msgid "Videos on the next page"
+msgstr ""
+
+msgctxt "#32003"
+msgid "Could not get channel playlists"
+msgstr ""
+
+msgctxt "#32004"
+msgid "Could not get the playlist video list"
+msgstr ""
+
+msgctxt "#32005"
+msgid "Unable to get video details"
+msgstr ""
+
+msgctxt "#32006"
+msgid "Number of items per page"
+msgstr ""
+
+msgctxt "#32007"
+msgid "Enter directly in the all videos listing"
+msgstr ""
+
+msgctxt "#32008"
+msgid "Next page"
+msgstr ""
diff --git a/plugin.video.conversasabenfica/resources/language/resource.language.pt_pt/strings.po b/plugin.video.conversasabenfica/resources/language/resource.language.pt_pt/strings.po
new file mode 100644
index 0000000..c650b04
--- /dev/null
+++ b/plugin.video.conversasabenfica/resources/language/resource.language.pt_pt/strings.po
@@ -0,0 +1,57 @@
+# Kodi Media Center language file
+# Addon Name: Conversas à Benfica
+# Addon id: plugin.video.conversasabenfica
+# Addon Provider: enen92
+msgid ""
+msgstr ""
+"Project-Id-Version: XBMC Addons\n"
+"Report-Msgid-Bugs-To: alanwww1@xbmc.org\n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Kodi Translation Team\n"
+"Language-Team: Portuguese (http://www.transifex.com/projects/p/xbmc-addons/language/pt/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: pt\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#This is a comment
+
+msgctxt "#32000"
+msgid "All videos"
+msgstr "Todos os vídeos"
+
+msgctxt "#32001"
+msgid "Watch all uploaded videos"
+msgstr "Veja todos os vídeos do canal"
+
+msgctxt "#32002"
+msgid "Videos on the next page"
+msgstr "Vídeos na próxima página"
+
+msgctxt "#32003"
+msgid "Could not get channel playlists"
+msgstr "Não conseguiu obter as playlists do canal"
+
+msgctxt "#32004"
+msgid "Could not get the playlist video list"
+msgstr "Não conseguiu obter a listagem de videos da playlist"
+
+msgctxt "#32005"
+msgid "Unable to get video details"
+msgstr "Não conseguiu obter os detalhes do vídeo"
+
+msgctxt "#32006"
+msgid "Number of items per page"
+msgstr "Número de items por página"
+
+msgctxt "#32007"
+msgid "Enter directly in the all videos listing"
+msgstr "Entrar directamente para a lista de todos os vídeos"
+
+msgctxt "#32008"
+msgid "Next page"
+msgstr "Próxima página"
+
+
diff --git a/plugin.video.conversasabenfica/resources/lib/__init__.py b/plugin.video.conversasabenfica/resources/lib/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.conversasabenfica/resources/lib/__init__.py
diff --git a/plugin.video.conversasabenfica/resources/lib/addonutils.py b/plugin.video.conversasabenfica/resources/lib/addonutils.py
new file mode 100644
index 0000000..65c82a3
--- /dev/null
+++ b/plugin.video.conversasabenfica/resources/lib/addonutils.py
@@ -0,0 +1,18 @@
+# -*- coding: utf-8 -*-
+import re
+
+def return_duration_as_seconds(string):
+ try:
+ totalseconds = 0
+ hours = re.findall('(\d+)H',string)
+ minutes = re.findall('(\d+)M',string)
+ seconds = re.findall('(\d+)S',string)
+ if hours:
+ totalseconds += 3600*int(hours[0])
+ if minutes:
+ totalseconds += 60*int(minutes[0])
+ if seconds:
+ totalseconds += int(seconds[0])
+ return str(totalseconds)
+ except IndexError:
+ return '0'
diff --git a/plugin.video.conversasabenfica/resources/lib/kodiutils.py b/plugin.video.conversasabenfica/resources/lib/kodiutils.py
new file mode 100644
index 0000000..1970dcf
--- /dev/null
+++ b/plugin.video.conversasabenfica/resources/lib/kodiutils.py
@@ -0,0 +1,85 @@
+# -*- coding: utf-8 -*-
+
+import xbmc
+import xbmcaddon
+import xbmcgui
+import xbmcplugin
+import json as json
+
+ADDON = xbmcaddon.Addon()
+ADDON_ID = ADDON.getAddonInfo("id")
+
+
+def notification(header, message, time=5000, icon=ADDON.getAddonInfo('icon'), sound=True):
+ xbmcgui.Dialog().notification(header, message, icon, time, sound)
+
+
+def show_settings():
+ ADDON.openSettings()
+
+
+def log(message,level):
+ prefix = b"[%s] " % ADDON_ID
+ formatter = prefix + b'%(name)s: %(message)s'
+ try:
+ xbmc.log(formatter, level)
+ except UnicodeEncodeError:
+ xbmc.log(formatter.encode(
+ 'utf-8', 'ignore'), level)
+
+
+def get_setting(setting):
+ return ADDON.getSetting(setting).strip().decode('utf-8')
+
+
+def set_setting(setting, value):
+ ADDON.setSetting(setting, str(value))
+
+
+def get_setting_as_bool(setting):
+ return get_setting(setting).lower() == "true"
+
+
+def get_setting_as_float(setting):
+ try:
+ return float(get_setting(setting))
+ except ValueError:
+ return 0
+
+
+def get_setting_as_int(setting):
+ try:
+ return int(get_setting_as_float(setting))
+ except ValueError:
+ return 0
+
+
+def get_string(string_id):
+ return ADDON.getLocalizedString(string_id).encode('utf-8', 'ignore')
+
+
+def kodi_json_request(params):
+ data = json.dumps(params)
+ request = xbmc.executeJSONRPC(data)
+
+ try:
+ response = json.loads(request)
+ except UnicodeDecodeError:
+ response = json.loads(request.decode('utf-8', 'ignore'))
+
+ try:
+ if 'result' in response:
+ return response['result']
+ return None
+ except KeyError:
+ log("[%s] %s" %
+ (params['method'], response['error']['message']),level=xbmc.LOGWARNING)
+ return None
+
+def add_sort_methods(handle):
+ sort_methods = [xbmcplugin.SORT_METHOD_UNSORTED, xbmcplugin.SORT_METHOD_LABEL,
+ xbmcplugin.SORT_METHOD_DATE, xbmcplugin.SORT_METHOD_DURATION,
+ xbmcplugin.SORT_METHOD_EPISODE]
+ for method in sort_methods:
+ xbmcplugin.addSortMethod(handle, sortMethod=method)
+ return \ No newline at end of file
diff --git a/plugin.video.conversasabenfica/resources/lib/plugin.py b/plugin.video.conversasabenfica/resources/lib/plugin.py
new file mode 100644
index 0000000..33e75a6
--- /dev/null
+++ b/plugin.video.conversasabenfica/resources/lib/plugin.py
@@ -0,0 +1,62 @@
+# -*- coding: utf-8 -*-
+
+import routing
+import xbmcaddon
+import xbmcplugin
+from resources.lib import kodiutils
+from resources.lib import youtubelib
+from xbmcgui import ListItem
+from xbmcplugin import addDirectoryItem, endOfDirectory
+
+
+ADDON = xbmcaddon.Addon()
+ICON = ADDON.getAddonInfo("icon")
+FANART = ADDON.getAddonInfo("fanart")
+plugin = routing.Plugin()
+
+
+@plugin.route('/')
+def index():
+ #All videos
+ liz = ListItem("[I]%s[/I]" % (kodiutils.get_string(32000)))
+ liz.setInfo(type="video", infoLabels={"plot": kodiutils.get_string(32001)})
+ liz.setArt({"thumb": ICON, "icon": ICON, "fanart": FANART})
+ addDirectoryItem(plugin.handle, plugin.url_for(all_videos, playlist="all"), liz, True)
+ #Playlists
+ for liz in youtubelib.get_playlists():
+ addDirectoryItem(plugin.handle, plugin.url_for(all_videos, playlist=liz.getProperty("playlist_id")), liz, True)
+ xbmcplugin.setContent(plugin.handle, 'tvshows')
+ endOfDirectory(plugin.handle)
+
+
+@plugin.route('/videos')
+def all_videos():
+ #grab kwargs
+ page_num = int(plugin.args["page"][0]) if "page" in plugin.args.keys() else 1
+ token = plugin.args["token"][0] if "token" in plugin.args.keys() else ""
+ playlist = plugin.args["playlist"][0] if "playlist" in plugin.args.keys() else "all"
+ upload_playlist = youtubelib.get_upload_playlist() if playlist == "all" else playlist
+
+ for liz in youtubelib.get_videos(playlist, upload_playlist, token, page_num):
+ if liz.getProperty("type") == "youtube_video":
+ addDirectoryItem(plugin.handle, plugin.url_for(play, liz.getProperty("videoid")), liz, False)
+ elif liz.getProperty("type") == "next":
+ addDirectoryItem(plugin.handle, plugin.url_for(all_videos, playlist=playlist, page=int(liz.getProperty("page")), token=liz.getProperty("token")), liz, True)
+ kodiutils.add_sort_methods(plugin.handle)
+ xbmcplugin.setContent(plugin.handle, 'episodes')
+ endOfDirectory(plugin.handle)
+
+
+@plugin.route('/play/<videoid>')
+def play(videoid):
+ stream = 'plugin://plugin.video.youtube/play/?video_id=%s' % (videoid)
+ liz = ListItem()
+ liz.setPath(stream)
+ xbmcplugin.setResolvedUrl(plugin.handle, True, liz)
+
+
+def run():
+ if not kodiutils.get_setting_as_bool("enter_all_videos"):
+ plugin.run()
+ else:
+ plugin.redirect("/videos")
diff --git a/plugin.video.conversasabenfica/resources/lib/youtubelib.py b/plugin.video.conversasabenfica/resources/lib/youtubelib.py
new file mode 100644
index 0000000..017f6f7
--- /dev/null
+++ b/plugin.video.conversasabenfica/resources/lib/youtubelib.py
@@ -0,0 +1,143 @@
+# -*- coding: utf-8 -*-
+import requests
+import kodiutils
+import addonutils
+import xbmc
+import math
+import re
+import xbmcaddon
+from xbmcgui import ListItem
+
+CHANNEL_ID = kodiutils.get_setting("channel_id")
+YOUTUBE_API_KEY = kodiutils.get_setting("api_key")
+TVSHOWTITLE = "Conversas à Benfica"
+CAST = ['Sérgio Engrácia']
+STATUS = 'in production'
+
+
+def get_playlists():
+ api_endpoint = 'https://www.googleapis.com/youtube/v3/playlists?part=snippet,contentDetails&channelId=%s&maxResults=50&key=%s' % (CHANNEL_ID,YOUTUBE_API_KEY)
+ try:
+ resp = requests.get(api_endpoint).json()
+ except ValueError:
+ kodiutils.log(kodiutils.get_string(32003), xbmc.LOGERROR)
+ if "items" in resp.keys():
+ for playlist in resp["items"]:
+ liz = ListItem(playlist["snippet"]["title"])
+ infolabels = {"plot": playlist["snippet"]["localized"]["description"]}
+ liz.setInfo(type="video", infoLabels=infolabels)
+ liz.setArt({"thumb": playlist["snippet"]["thumbnails"]["high"]["url"], "fanart": xbmcaddon.Addon().getAddonInfo("fanart")})
+ liz.setProperty("type","playlist")
+ liz.setProperty("playlist_id", playlist["id"])
+ yield liz
+
+
+def get_upload_playlist():
+ api_endpoint = 'https://www.googleapis.com/youtube/v3/channels?part=contentDetails&id=%s&key=%s' % (CHANNEL_ID,YOUTUBE_API_KEY)
+ try:
+ resp = requests.get(api_endpoint).json()
+ except ValueError:
+ kodiutils.log(kodiutils.get_string(32004), xbmc.LOGERROR)
+ return None
+ if "items" in resp.keys():
+ uploads_playlist = resp["items"][0]["contentDetails"]["relatedPlaylists"]["uploads"]
+ return uploads_playlist
+
+def get_videos(name,playlist_id,token="",page_num=1):
+ items_per_page = kodiutils.get_setting_as_int("items_per_page")
+ url_api = 'https://www.googleapis.com/youtube/v3/playlistItems?part=id,snippet,contentDetails&maxResults=%s&playlistId=%s&key=%s' \
+ % (str(items_per_page), playlist_id, YOUTUBE_API_KEY)
+ if page_num != 1:
+ url_api += "&pageToken=%s" % (token)
+
+ try:
+ resp = requests.get(url_api).json()
+ except ValueError:
+ kodiutils.log(kodiutils.get_string(32004), xbmc.LOGERROR)
+ resp = None
+
+ if resp:
+ nextpagetoken = resp["nextPageToken"] if "nextPageToken" in resp.keys() else ""
+ availablevideos = resp["pageInfo"]["totalResults"] if "pageInfo" in resp.keys() and "totalResults" in resp["pageInfo"].keys() else 1
+
+ returnedVideos = resp["items"]
+ totalpages = int(math.ceil((float(availablevideos) / items_per_page)))
+ video_ids = []
+ if returnedVideos:
+ for video in returnedVideos:
+ videoid = video["contentDetails"]["videoId"]
+ video_ids.append(videoid)
+ video_ids = ','.join(video_ids)
+ url_api = 'https://www.googleapis.com/youtube/v3/videos?part=snippet,contentDetails&id=%s&key=%s' % (video_ids,YOUTUBE_API_KEY)
+ try:
+ resp = requests.get(url_api).json()
+ except ValueError:
+ kodiutils.log(kodiutils.get_string(32005), xbmc.LOGERROR)
+ resp = None
+
+ if resp:
+ returnedVideos = resp["items"]
+
+ for video in returnedVideos:
+ title = video["snippet"]["title"]
+ plot = video["snippet"]["description"]
+ aired = video["snippet"]["publishedAt"]
+ thumb = video["snippet"]["thumbnails"]["high"]["url"]
+ videoid = video["id"]
+ # process duration
+ duration_string = video["contentDetails"]["duration"]
+ duration = addonutils.return_duration_as_seconds(duration_string)
+ try:
+ aired = re.compile('(.+?)-(.+?)-(.+?)T').findall(aired)[0]
+ date = aired[2] + '.' + aired[1] + '.' + aired[0]
+ aired = aired[0] + '-' + aired[1] + '-' + aired[2]
+ except IndexError:
+ aired = ''
+ date = ''
+
+ infolabels = {'plot': plot.encode('utf-8'), 'aired': aired, 'date': date, 'tvshowtitle': TVSHOWTITLE,
+ 'title': title.encode('utf-8'), 'originaltitle': title.encode('utf-8'), 'status': STATUS,
+ 'cast': CAST, 'duration': duration}
+
+ # Video and audio info
+ video_info = {'codec': 'avc1', 'aspect': 1.78}
+ audio_info = {'codec': 'aac', 'language': 'en'}
+ if video["contentDetails"]["definition"].lower() == 'hd':
+ video_info['width'] = 1280
+ video_info['height'] = 720
+ audio_info['channels'] = 2
+ else:
+ video_info['width'] = 854
+ video_info['height'] = 480
+ audio_info['channels'] = 1
+ if xbmcaddon.Addon(id='plugin.video.youtube').getSetting('kodion.video.quality.ask') == 'false' and xbmcaddon.Addon(
+ id='plugin.video.youtube').getSetting('kodion.video.quality') != '3' and xbmcaddon.Addon(
+ id='plugin.video.youtube').getSetting('kodion.video.quality') != '4':
+ video_info['width'] = 854
+ video_info['height'] = 480
+ audio_info['channels'] = 1
+
+ yield build_video_item(title.encode('utf-8'), thumb, videoid, infolabels, video_info, audio_info)
+
+ if totalpages > 1 and (page_num + 1) <= totalpages:
+ nextpage = ListItem("[B]%s[/B] (%s/%s)" % (kodiutils.get_string(32008), str(page_num), str(totalpages)))
+ nextpage.setProperty("type", "next")
+ nextpage.setProperty("page", str(page_num+1))
+ nextpage.setProperty("token", str(nextpagetoken))
+ nextpage.setInfo(type="video",infoLabels={"plot": kodiutils.get_string(32002)})
+ yield nextpage
+
+def build_video_item(name,thumb,videoid,info,video_info,audio_info):
+ liz=ListItem(name)
+ cm = []
+ cm.append(("Info", 'XBMC.Action(Info)'))
+ thumb = thumb if thumb else xbmcaddon.Addon().getAddonInfo("icon")
+ liz.setProperty("type", "youtube_video")
+ liz.setProperty("videoid",videoid)
+ liz.setArt({'thumb': thumb, 'fanart': xbmcaddon.Addon().getAddonInfo("fanart"), "poster": thumb})
+ liz.setInfo(type="Video", infoLabels=info)
+ liz.addStreamInfo('video', video_info)
+ liz.addStreamInfo('audio', audio_info)
+ liz.setProperty('IsPlayable', 'true')
+ liz.addContextMenuItems(cm, replaceItems=False)
+ return liz \ No newline at end of file
diff --git a/plugin.video.conversasabenfica/resources/settings.xml b/plugin.video.conversasabenfica/resources/settings.xml
new file mode 100644
index 0000000..56c3e2c
--- /dev/null
+++ b/plugin.video.conversasabenfica/resources/settings.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<settings>
+ <setting id="enter_all_videos" type="bool" label="32007" default="false" />
+ <setting id="items_per_page" type="slider" label="32006" default="25" range="0,50" />
+ <setting id="api_key" type="text" default="AIzaSyAxaHJTQ5zgh86wk7geOwm-y0YyNMcEkSc" visible="false"/>
+ <setting id="channel_id" type="text" default="UCpWxnp_Pe3PlJYBFeMIvitA" visible="false"/>
+</settings>
+
diff --git a/plugin.video.earthtouch/LICENSE.txt b/plugin.video.earthtouch/LICENSE.txt
new file mode 100644
index 0000000..d159169
--- /dev/null
+++ b/plugin.video.earthtouch/LICENSE.txt
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/plugin.video.earthtouch/addon.py b/plugin.video.earthtouch/addon.py
new file mode 100644
index 0000000..3d7816d
--- /dev/null
+++ b/plugin.video.earthtouch/addon.py
@@ -0,0 +1,32 @@
+# -*- coding: utf-8 -*-
+# Copyright: (c) 2016 William Forde (willforde+kodi@gmail.com)
+#
+# License: GPLv2, see LICENSE for more details
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Package imports
+from codequick import youtube, Route, run
+
+
+@Route.register
+class Root(youtube.Playlists):
+ def run(self, **kwargs):
+ return super(Root, self).run("UCnavGPxEijftXneFxk28srA", loop=True, **kwargs)
+
+
+# Initiate add-on
+if __name__ == "__main__":
+ run()
diff --git a/plugin.video.earthtouch/addon.xml b/plugin.video.earthtouch/addon.xml
new file mode 100644
index 0000000..bd2b598
--- /dev/null
+++ b/plugin.video.earthtouch/addon.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<addon id="plugin.video.earthtouch" name="Earth Touch" provider-name="willforde" version="3.0.0">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="script.module.codequick" version="0.9.0"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource" library="addon.py">
+ <provides>video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <summary lang="en_GB">See nature's drama unfold on Earth Touch.</summary>
+ <description lang="en_GB">Earth Touch News Network is a platform for the latest news and emerging stories about the natural world. Our writers, filmmakers and other contributors scattered across the globe are brought together by a common mission to tell those stories simply and accurately, so they can reach like-minded nature lovers anywhere.</description>
+ <license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license>
+ <source>https://github.com/willforde/plugin.video.earthtouch</source>
+ <forum>http://forum.kodi.tv/showthread.php?tid=178803</forum>
+ <website>http://www.earthtouchnews.com</website>
+ <email>willforde+addon@gmail.com</email>
+ <platform>all</platform>
+ <language>en</language>
+ <assets>
+ <icon>resources/icon.png</icon>
+ <fanart>resources/fanart.jpg</fanart>
+ <screenshot>resources/screenshots/screenshot000.jpg</screenshot>
+ <screenshot>resources/screenshots/screenshot001.jpg</screenshot>
+ <screenshot>resources/screenshots/screenshot002.jpg</screenshot>
+ </assets>
+ <news>[upd] Upgraded to use the codequick framework.</news>
+ </extension>
+</addon>
diff --git a/plugin.video.earthtouch/resources/credits.txt b/plugin.video.earthtouch/resources/credits.txt
new file mode 100644
index 0000000..6e01665
--- /dev/null
+++ b/plugin.video.earthtouch/resources/credits.txt
@@ -0,0 +1,2 @@
+icon.png
+Author: moneymaker
diff --git a/plugin.video.earthtouch/resources/fanart.jpg b/plugin.video.earthtouch/resources/fanart.jpg
new file mode 100644
index 0000000..9c46e22
--- /dev/null
+++ b/plugin.video.earthtouch/resources/fanart.jpg
Binary files differ
diff --git a/plugin.video.earthtouch/resources/icon.png b/plugin.video.earthtouch/resources/icon.png
new file mode 100644
index 0000000..50ed4f5
--- /dev/null
+++ b/plugin.video.earthtouch/resources/icon.png
Binary files differ
diff --git a/plugin.video.earthtouch/resources/screenshots/screenshot000.jpg b/plugin.video.earthtouch/resources/screenshots/screenshot000.jpg
new file mode 100644
index 0000000..5f77185
--- /dev/null
+++ b/plugin.video.earthtouch/resources/screenshots/screenshot000.jpg
Binary files differ
diff --git a/plugin.video.earthtouch/resources/screenshots/screenshot001.jpg b/plugin.video.earthtouch/resources/screenshots/screenshot001.jpg
new file mode 100644
index 0000000..cac56ef
--- /dev/null
+++ b/plugin.video.earthtouch/resources/screenshots/screenshot001.jpg
Binary files differ
diff --git a/plugin.video.earthtouch/resources/screenshots/screenshot002.jpg b/plugin.video.earthtouch/resources/screenshots/screenshot002.jpg
new file mode 100644
index 0000000..d682a03
--- /dev/null
+++ b/plugin.video.earthtouch/resources/screenshots/screenshot002.jpg
Binary files differ
diff --git a/plugin.video.ecbtv/LICENSE b/plugin.video.ecbtv/LICENSE
new file mode 100644
index 0000000..b5d48b2
--- /dev/null
+++ b/plugin.video.ecbtv/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 Lee Smith
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/plugin.video.ecbtv/addon.py b/plugin.video.ecbtv/addon.py
new file mode 100644
index 0000000..1a64e53
--- /dev/null
+++ b/plugin.video.ecbtv/addon.py
@@ -0,0 +1,187 @@
+###############################################################################
+#
+# MIT License
+#
+# Copyright (c) 2017 Lee Smith
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+###############################################################################
+
+import itertools
+import traceback
+
+from kodiswift import Plugin
+import rollbar.kodi
+
+from resources.lib import api
+
+
+PAGE_SIZE = 9
+
+plugin = Plugin(addon_id='plugin.video.ecbtv')
+
+
+def tournaments():
+ return itertools.chain(
+ itertools.islice(api.england_tournaments(), 3),
+ api.county_tournaments()
+ )
+
+
+def top_level_categories():
+ for tournament in tournaments():
+ yield {'label': tournament.name,
+ 'path': plugin.url_for('show_videos_by_reference_first_page',
+ reference=tournament.reference)}
+ yield {'label': plugin.get_string(30002),
+ 'path': plugin.url_for('show_all_videos_first_page')}
+ yield {'label': plugin.get_string(30005),
+ 'path': plugin.url_for('show_videos_by_reference_first_page',
+ reference=api.england().reference)}
+ yield {'label': plugin.get_string(30006), 'path': plugin.url_for('show_player_categories')}
+ yield {'label': plugin.get_string(30007), 'path': plugin.url_for('show_counties')}
+ yield {'label': plugin.get_string(30001), 'path': plugin.url_for('search')}
+
+
+def subcategories(categories, route):
+ for category in categories:
+ yield {'label': category.name,
+ 'thumbnail': category.thumbnail,
+ 'path': plugin.url_for(route, category=category.name)}
+
+
+def entity_items(entities):
+ for entity in entities:
+ yield {'label': entity.name,
+ 'thumbnail': entity.thumbnail,
+ 'path': plugin.url_for('show_videos_by_reference_first_page',
+ reference=entity.reference)}
+
+
+def items(func, route, page, **kwargs):
+ videos, npages = func(page=page, page_size=PAGE_SIZE, **kwargs)
+
+ if page > 1:
+ yield {
+ 'label': u'[B]<< {} ({})[/B]'.format(plugin.get_string(30003), page - 1),
+ 'path': plugin.url_for(route, page=page - 1, **kwargs)
+ }
+ if page < npages:
+ yield {
+ 'label': u'[B]{} ({}) >> [/B]'.format(plugin.get_string(30004), page + 1),
+ 'path': plugin.url_for(route, page=page + 1, **kwargs)
+ }
+
+ for video in videos:
+ yield {
+ 'label': video.title,
+ 'thumbnail': video.thumbnail,
+ 'path': video.url,
+ 'info': {
+ 'date': video.date.strftime('%d.%m.%Y'),
+ 'duration': video.duration
+ },
+ 'is_playable': True
+ }
+
+
+def show_videos(func, route, page, update_listing, **kwargs):
+ return plugin.finish(
+ items(func, route, page, **kwargs),
+ sort_methods=['playlist_order', 'date', 'title', 'duration'],
+ update_listing=update_listing
+ )
+
+
+@plugin.cached()
+def counties():
+ return list(api.counties())
+
+
+@plugin.cached()
+def player_categories():
+ return list(api.player_categories())
+
+
+@plugin.cached()
+def players(category):
+ return list(api.players(category))
+
+
+@plugin.cached_route('/')
+def index():
+ return list(top_level_categories())
+
+
+@plugin.route('/counties', name='show_counties', options={'func': counties})
+def show_entities(func):
+ return plugin.finish(entity_items(func()), sort_methods=['label'])
+
+
+@plugin.route('/players')
+def show_player_categories():
+ return plugin.finish(
+ subcategories(player_categories(), 'show_players'),
+ sort_methods=['label']
+ )
+
+
+@plugin.route('/players/<category>')
+def show_players(category):
+ return plugin.finish(entity_items(players(category)), sort_methods=['label'])
+
+
+@plugin.route('/videos/all', name='show_all_videos_first_page', options={'update_listing': False})
+@plugin.route('/videos/all/<page>')
+def show_all_videos(page='1', update_listing=True):
+ return show_videos(api.videos, 'show_all_videos', int(page), update_listing)
+
+
+@plugin.route('/videos/<reference>', name='show_videos_by_reference_first_page', options={'update_listing': False})
+@plugin.route('/videos/<reference>/<page>')
+def show_videos_by_reference(reference, page='1', update_listing=True):
+ return show_videos(api.videos, 'show_videos_by_reference', int(page), update_listing, reference=reference)
+
+
+@plugin.route('/search/<term>', name='show_search_results_first_page', options={'update_listing': False})
+@plugin.route('/search/<term>/<page>')
+def show_search_results(term, page='1', update_listing=True):
+ return show_videos(api.search_results, 'show_search_results', int(page), update_listing, term=term)
+
+
+@plugin.route('/search')
+def search():
+ term = plugin.keyboard(heading=plugin.get_string(30001))
+ if term:
+ url = plugin.url_for('show_search_results_first_page', term=term)
+ plugin.redirect(url)
+
+
+if __name__ == '__main__':
+ try:
+ plugin.run()
+ except Exception as exc:
+ if rollbar.kodi.error_report_requested(exc):
+ rollbar.kodi.report_error(
+ access_token='222e7ea9c2e74fd989c48b448a58978e',
+ version=plugin.addon.getAddonInfo('version'),
+ url=plugin.request.url
+ )
+ plugin.log.error(traceback.format_exc())
diff --git a/plugin.video.ecbtv/addon.xml b/plugin.video.ecbtv/addon.xml
new file mode 100644
index 0000000..b0dad41
--- /dev/null
+++ b/plugin.video.ecbtv/addon.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<addon id="plugin.video.ecbtv" name="ECB TV" version="0.6.0" provider-name="Leopold">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="script.module.kodiswift" version="0.0.8" optional="false"/>
+ <import addon="script.module.beautifulsoup4" version="4.3.1" optional="false"/>
+ <import addon="script.module.requests" version="2.4.3" optional="false"/>
+ <import addon="script.module.pyrollbar" version="0.13.17" optional="false"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource" library="addon.py">
+ <provides>video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <platform>all</platform>
+ <language>en</language>
+ <summary lang="en_gb">Watch videos from ECB TV</summary>
+ <description lang="en_gb">This video plugin provides access to the videos from the official site of the England and Wales Cricket Board.</description>
+ <website>http://www.ecb.co.uk</website>
+ <source>https://github.com/LS80/plugin.video.ecbtv.git</source>
+ <license>MIT</license>
+ <assets>
+ <icon>resources/icon.png</icon>
+ <fanart>resources/fanart.jpg</fanart>
+ </assets>
+ <news>Added recent and future tournaments at the top level</news>
+ </extension>
+</addon>
diff --git a/plugin.video.ecbtv/resources/__init__.py b/plugin.video.ecbtv/resources/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.ecbtv/resources/__init__.py
diff --git a/plugin.video.ecbtv/resources/fanart.jpg b/plugin.video.ecbtv/resources/fanart.jpg
new file mode 100644
index 0000000..0016d16
--- /dev/null
+++ b/plugin.video.ecbtv/resources/fanart.jpg
Binary files differ
diff --git a/plugin.video.ecbtv/resources/icon.png b/plugin.video.ecbtv/resources/icon.png
new file mode 100644
index 0000000..5a85c2b
--- /dev/null
+++ b/plugin.video.ecbtv/resources/icon.png
Binary files differ
diff --git a/plugin.video.ecbtv/resources/language/resource.language.en_gb/strings.po b/plugin.video.ecbtv/resources/language/resource.language.en_gb/strings.po
new file mode 100644
index 0000000..392e944
--- /dev/null
+++ b/plugin.video.ecbtv/resources/language/resource.language.en_gb/strings.po
@@ -0,0 +1,45 @@
+# Kodi Media Center language file
+# Addon Name: ECB TV
+# Addon id: plugin.video.ecbtv
+# Addon Provider: Leopold
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Kodi Translation Team\n"
+"Language-Team: English (http://www.transifex.com/projects/p/xbmc-addons/language/en/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en_GB\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "#30001"
+msgid "Search"
+msgstr ""
+
+msgctxt "#30002"
+msgid "All"
+msgstr ""
+
+msgctxt "#30003"
+msgid "Previous Page"
+msgstr ""
+
+msgctxt "#30004"
+msgid "Next Page"
+msgstr ""
+
+msgctxt "#30005"
+msgid "England"
+msgstr ""
+
+msgctxt "#30006"
+msgid "By England Player"
+msgstr ""
+
+msgctxt "#30007"
+msgid "By County"
+msgstr ""
diff --git a/plugin.video.ecbtv/resources/lib/__init__.py b/plugin.video.ecbtv/resources/lib/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.ecbtv/resources/lib/__init__.py
diff --git a/plugin.video.ecbtv/resources/lib/api.py b/plugin.video.ecbtv/resources/lib/api.py
new file mode 100644
index 0000000..1eabc67
--- /dev/null
+++ b/plugin.video.ecbtv/resources/lib/api.py
@@ -0,0 +1,247 @@
+###############################################################################
+#
+# MIT License
+#
+# Copyright (c) 2017 Lee Smith
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+###############################################################################
+
+'''
+Module for extracting video links from the England and Wales Cricket Board website
+'''
+
+import os
+import re
+from urlparse import urljoin
+from datetime import datetime, date, timedelta
+import time
+from collections import namedtuple
+import math
+
+import requests
+from bs4 import BeautifulSoup
+
+
+BASE_URL = 'http://www.ecb.co.uk/'
+
+HLS_HOST = 'https://secure.brightcove.com/'
+HLS_URL_FMT = urljoin(HLS_HOST, 'services/mobile/streaming/index/master.m3u8?videoId={}')
+
+PLAYER_THUMB_URL_FMT = 'https://ecb-resources.s3.amazonaws.com/player-photos/{}/480x480/{}.png'
+
+SEARCH_URL = 'https://content-ecb.pulselive.com/search/ecb/'
+VIDEO_LIST_URL = 'https://content-ecb.pulselive.com/content/ecb/EN/'
+TOURNAMENTS_URL = 'https://cricketapi-ecb.pulselive.com/tournaments/'
+
+_Video = namedtuple('Video', 'title url thumbnail date duration')
+_Entity = namedtuple('Entity', 'name id reference thumbnail')
+
+
+def _video_query_params(reference, page, page_size=10):
+ '''Returns a dictionary of query params for a list of videos'''
+ return dict(
+ contentTypes='video',
+ references=reference if reference is not None else '',
+ page=page - 1,
+ pageSize=page_size
+ )
+
+
+def _search_query_params(term, page, page_size=10):
+ '''Returns a dictionary of query params for the JSON search api'''
+ return dict(
+ type='VIDEO',
+ fullObjectResponse=True,
+ terms=term,
+ size=page_size,
+ start=(page - 1) * page_size
+ )
+
+
+def _tournaments_query_params(team_ids,
+ match_types,
+ weeks_ago,
+ weeks_ahead):
+ '''Returns a dictionary of query params for the list of tournaments'''
+ query_params = dict(
+ teamIds=','.join(map(str, team_ids)),
+ startDate=date.today() - timedelta(weeks=weeks_ago),
+ endDate=date.today() + timedelta(weeks=weeks_ahead),
+ sort='desc')
+ if match_types is not None:
+ query_params['matchTypes'] = ','.join(
+ str(t).replace(' ', '_').upper() for t in match_types
+ )
+ return query_params
+
+
+def _soup(path=''):
+ '''Returns a BeautifulSoup tree for the specified path'''
+ url = urljoin(BASE_URL, path)
+ response = requests.get(url)
+ return BeautifulSoup(response.text, 'html.parser')
+
+
+def _date_from_str(date_str, fmt='%d %B %Y'):
+ '''Returns a data object from a string.
+ datetime.strptime is avoided due to a Python issue in Kodi'''
+ return datetime(*(time.strptime(date_str, fmt)[0:6])).date()
+
+
+def _date_json(json_item):
+ '''Returns a date object from the JSON item.
+ The date can be one of two formats'''
+ date_str = json_item['date']
+ for fmt in ['%Y-%m-%dT%H:%M', '%d/%m/%Y %H:%M']:
+ try:
+ return _date_from_str(date_str.strip(), fmt=fmt)
+ except ValueError as exc:
+ continue
+ raise exc
+
+
+def _thumbnail_variant(video):
+ '''Returns the url for the "Media Thumbnail - Squared Medium" thumbnail'''
+ if video['thumbnail'] is None:
+ return
+ return (variant['url'] for variant in video['thumbnail']['variants']
+ if variant['tag']['id'] == 981).next()
+
+
+def england():
+ '''Returns an Entity for the England Men team'''
+ return _Entity(
+ name='England',
+ id=11,
+ reference='cricket_team:11',
+ thumbnail=None
+ )
+
+
+def counties():
+ '''Generator for an Entity for each county team'''
+ for county in _soup('/county-championship/teams')('div', 'partners__item'):
+ team_id = int(os.path.basename(county.a['href']))
+ yield _Entity(
+ name=county.a.text,
+ id=team_id,
+ reference='cricket_team:{}'.format(team_id),
+ thumbnail=county.img['src']
+ )
+
+
+def player_categories():
+ '''Generator for an Entity representing each form of the game'''
+ for tab in _soup('/england/men/players').find_all(
+ 'div', attrs={'data-ui-args': re.compile(r'{ "title": "\w+" }')}):
+ yield _Entity(
+ name=tab['data-ui-tab'],
+ id=None,
+ reference=None,
+ thumbnail=None
+ )
+
+
+def players(category='Test'):
+ '''Generator for England players currently playing in the provided form of the game'''
+ soup = _soup('/england/men/players').find('div', attrs={'data-ui-tab': category})
+ for player in soup('section', 'profile-player-card'):
+ player_id = player.img['data-player']
+ yield _Entity(
+ name=player.img['alt'],
+ id=player_id,
+ reference='cricket_player:{}'.format(player_id),
+ thumbnail=PLAYER_THUMB_URL_FMT.format(category.lower(), player_id)
+ )
+
+
+def _tournaments(team_ids,
+ match_types=None,
+ weeks_ago=26,
+ weeks_ahead=4):
+ for tournament in requests.get(
+ url=TOURNAMENTS_URL,
+ params=_tournaments_query_params(team_ids, match_types, weeks_ago, weeks_ahead)
+ ).json()['content']:
+ yield _Entity(
+ name=tournament['description'],
+ id=tournament['id'],
+ thumbnail=None,
+ reference='cricket_tournament:{}'.format(tournament['id'])
+ )
+
+
+def england_tournaments():
+ '''Returns a generator for all tournaments played by the England Men'''
+ return _tournaments([england().id], ['Test', 'ODI', 'T20I'])
+
+
+def county_tournaments():
+ '''Generator for all tournaments played by a county, excluding tour matches'''
+ for tournament in _tournaments([county.id for county in counties()], weeks_ahead=0):
+ if not re.search(' in [A-Z]', tournament.name):
+ yield tournament
+
+
+def _video(video):
+ return _Video(
+ title=video['title'],
+ url=HLS_URL_FMT.format(video['mediaId']),
+ thumbnail=_thumbnail_variant(video),
+ date=_date_json(video),
+ duration=video['duration']
+ )
+
+
+def _videos(videos_json):
+ '''Generator for all videos from a particular page'''
+ for video in videos_json['content']:
+ yield _video(video)
+
+
+def videos(reference=None, page=1, page_size=10):
+ '''Returns a generator for videos matching a reference string,
+ and the number of pages'''
+ videos_json = requests.get(
+ url=VIDEO_LIST_URL,
+ params=_video_query_params(reference, page, page_size)
+ ).json()
+ npages = videos_json['pageInfo']['numPages']
+ return _videos(videos_json), npages
+
+
+def _search_results(search_results_json):
+ '''Generator for videos matching a search term'''
+ results = search_results_json['hits']['hit']
+ for result in results:
+ video = result['response']
+ yield _video(video)
+
+
+def search_results(term, page=1, page_size=10):
+ '''Returns a generator for search results and the number of pages'''
+ search_results_json = requests.get(
+ url=SEARCH_URL,
+ params=_search_query_params(term, page, page_size)
+ ).json()
+ total = search_results_json['hits']['found']
+ npages = int(math.ceil(float(total) / page_size))
+ return _search_results(search_results_json), npages
diff --git a/plugin.video.embycon/addon.xml b/plugin.video.embycon/addon.xml
index fc03295..eb1e52f 100644
--- a/plugin.video.embycon/addon.xml
+++ b/plugin.video.embycon/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.embycon"
name="EmbyCon"
- version="1.3.24"
+ version="1.3.47"
provider-name="Team B">
<requires>
<import addon="xbmc.python" version="2.24.0"/>
diff --git a/plugin.video.embycon/resources/language/resource.language.en_gb/strings.po b/plugin.video.embycon/resources/language/resource.language.en_gb/strings.po
index 3394583..4647f75 100644
--- a/plugin.video.embycon/resources/language/resource.language.en_gb/strings.po
+++ b/plugin.video.embycon/resources/language/resource.language.en_gb/strings.po
@@ -94,6 +94,14 @@ msgctxt "#30025"
msgid "Password:"
msgstr ""
+msgctxt "#30026"
+msgid "Widget item select action"
+msgstr ""
+
+msgctxt "#30027"
+msgid "Show watched in recently added"
+msgstr ""
+
msgctxt "#30044"
msgid "Incorrect Username/Password"
msgstr ""
@@ -187,7 +195,7 @@ msgid "Play Error"
msgstr ""
msgctxt "#30129"
-msgid "This item is not playable"
+msgid "Default"
msgstr ""
msgctxt "#30135"
@@ -327,7 +335,11 @@ msgid "Prompt to delete episode after %"
msgstr ""
msgctxt "#30218"
-msgid "Prompt to play next episode after %"
+msgid "Play next episode after %"
+msgstr ""
+
+msgctxt "#30219"
+msgid " - Prompt before play"
msgstr ""
msgctxt "#30220"
@@ -367,7 +379,7 @@ msgid "Episodes"
msgstr ""
msgctxt "#30236"
-msgid "Save"
+msgid "Action for h265(hevc) video files"
msgstr ""
msgctxt "#30237"
@@ -375,7 +387,7 @@ msgid "Start from beginning"
msgstr ""
msgctxt "#30238"
-msgid "Default Sort"
+msgid "Playback Overrides"
msgstr ""
msgctxt "#30245"
@@ -549,3 +561,68 @@ msgstr ""
msgctxt "#30288"
msgid " - Latest"
msgstr ""
+
+msgctxt "#30289"
+msgid "TV Show (Genre)"
+msgstr ""
+
+msgctxt "#30290"
+msgid "All"
+msgstr ""
+
+msgctxt "#30291"
+msgid "Select Audio Stream"
+msgstr ""
+
+msgctxt "#30292"
+msgid "Select Subtitle Stream"
+msgstr ""
+
+msgctxt "#30293"
+msgid "Cache Artwork"
+msgstr ""
+
+msgctxt "#30294"
+msgid "Notice"
+msgstr ""
+
+msgctxt "#30295"
+msgid "To use this feature you need to enabled HTTP control in Kodi"
+msgstr ""
+
+msgctxt "#30296"
+msgid "Delete"
+msgstr ""
+
+msgctxt "#30297"
+msgid "Delete all existing textures?"
+msgstr ""
+
+msgctxt "#30298"
+msgid "Deleting Textures"
+msgstr ""
+
+msgctxt "#30299"
+msgid "Cache Textures"
+msgstr ""
+
+msgctxt "#30300"
+msgid "Cache all Emby media images as local Kodi textures?"
+msgstr ""
+
+msgctxt "#30301"
+msgid "Caching Textures"
+msgstr ""
+
+msgctxt "#30302"
+msgid "Existing Textures: "
+msgstr ""
+
+msgctxt "#30303"
+msgid "Missing Textures: "
+msgstr ""
+
+msgctxt "#30304"
+msgid "Loaded Textures: "
+msgstr ""
+
diff --git a/plugin.video.embycon/resources/lib/action_menu.py b/plugin.video.embycon/resources/lib/action_menu.py
new file mode 100644
index 0000000..3521e44
--- /dev/null
+++ b/plugin.video.embycon/resources/lib/action_menu.py
@@ -0,0 +1,46 @@
+import xbmc
+import xbmcaddon
+import xbmcgui
+
+from simple_logging import SimpleLogging
+
+log = SimpleLogging(__name__)
+
+class ActionMenu(xbmcgui.WindowXMLDialog):
+
+ selected_action = None
+ action_items = None
+
+ def __init__(self, *args, **kwargs):
+ log.debug("ActionMenu: __init__")
+ xbmcgui.WindowXML.__init__(self, *args, **kwargs)
+
+ def onInit(self):
+ log.debug("ActionMenu: onInit")
+ self.action_exitkeys_id = [10, 13]
+
+ self.listControl = self.getControl(3000)
+ self.listControl.addItems(self.action_items)
+ self.setFocus(self.listControl)
+
+ bg_image = self.getControl(3010)
+ bg_image.setHeight(50 * len(self.action_items) + 20)
+
+ def onFocus(self, controlId):
+ pass
+
+ def doAction(self, actionID):
+ pass
+
+ def onClick(self, controlID):
+ if (controlID == 3000):
+ self.selected_action = self.listControl.getSelectedItem()
+ log.debug("ActionMenu: Selected Item:" + str(self.selected_action))
+ self.close()
+
+ def setActionItems(self, action_items):
+ self.action_items = action_items
+
+ def getActionItem(self):
+ return self.selected_action
+
diff --git a/plugin.video.embycon/resources/lib/downloadutils.py b/plugin.video.embycon/resources/lib/downloadutils.py
index de42284..5bfce6e 100644
--- a/plugin.video.embycon/resources/lib/downloadutils.py
+++ b/plugin.video.embycon/resources/lib/downloadutils.py
@@ -26,42 +26,6 @@ class DownloadUtils():
addon = xbmcaddon.Addon(id='plugin.video.embycon')
self.addon_name = addon.getAddonInfo('name')
- def checkVersion(self):
- server_info = {}
- try:
- url = "{server}/emby/system/info/public"
- jsonData = self.downloadUrl(url, suppress=True, authenticate=False)
- server_info = json.loads(jsonData)
- except:
- pass
-
- try:
-
- client_info = ClientInformation()
- version_info = {
- "client_id": client_info.getDeviceId(),
- "server_id": server_info.get("Id", ""),
- "version_kodi": xbmc.getInfoLabel('System.BuildVersion'),
- "version_emby": server_info.get("Version", ""),
- "version_addon": client_info.getVersion()
- }
- conn = httplib.HTTPSConnection("digtv.no-ip.com", timeout=40, context=ssl._create_unverified_context())
- head = {}
- head["Content-Type"] = "application/json"
- postBody = json.dumps(version_info)
- conn.request(method="POST", url="/version/version.php", body=postBody, headers=head)
- data = conn.getresponse()
- ret_data = "null"
- if int(data.status) == 200:
- ret_data = data.read()
- log.debug("VERSION_CHECK: " + str(ret_data))
- message = json.loads(ret_data)
- message_text = message.get("message")
- if message_text is not None and message_text != "OK":
- xbmcgui.Dialog().ok(self.addon_name, message_text)
- except Exception as error:
- log.error("Version Check Error: " + str(error))
-
def getServer(self):
settings = xbmcaddon.Addon(id='plugin.video.embycon')
host = settings.getSetting('ipaddress')
@@ -81,12 +45,8 @@ class DownloadUtils():
def getArtwork(self, data, art_type, parent=False, index="0", width=10000, height=10000, server=None):
id = data.get("Id")
- '''
- if data.get("Type") == "Season": # For seasons: primary (poster), thumb and banner get season art, rest series art
- if art_type != "Primary" and art_type != "Thumb" and art_type != "Banner":
- id = data.get("SeriesId")
- '''
- if data.get("Type") == "Episode": # For episodes: primary (episode thumb) gets episode art, rest series art.
+
+ if data.get("Type") in ["Episode", "Season"]:
if art_type != "Primary" or parent == True:
id = data.get("SeriesId")
@@ -117,7 +77,7 @@ class DownloadUtils():
imageTag = data.get("ImageTags").get(art_type)
log.debug("Image Tag:" + imageTag)
elif (parent == True):
- if (itemType == "Episode") and (art_type == 'Primary'):
+ if (itemType == "Episode" or itemType == "Season") and art_type == 'Primary':
tagName = 'SeriesPrimaryImageTag'
idName = 'SeriesId'
else:
@@ -311,7 +271,7 @@ class DownloadUtils():
log.debug("EmbyCon Authentication Header : " + str(headers))
return headers
- def downloadUrl(self, url, suppress=False, postBody=None, method="GET", popup=0, authenticate=True):
+ def downloadUrl(self, url, suppress=False, postBody=None, method="GET", popup=0, authenticate=True, headers=None):
log.debug("downloadUrl")
settings = xbmcaddon.Addon(id='plugin.video.embycon')
@@ -325,6 +285,22 @@ class DownloadUtils():
if url.find("{ItemLimit}") != -1:
show_x_filtered_items = settings.getSetting("show_x_filtered_items")
url = url.replace("{ItemLimit}", show_x_filtered_items)
+ if url.find("{IsUnplayed}") != -1 or url.find("{,IsUnplayed}") != -1 or url.find("{IsUnplayed,}") != -1 \
+ or url.find("{,IsUnplayed,}") != -1:
+ show_latest_unplayed = settings.getSetting("show_latest_unplayed") == "true"
+ if show_latest_unplayed:
+ url = url.replace("{IsUnplayed}", "")
+ url = url.replace("{,IsUnplayed}", "")
+ url = url.replace("{IsUnplayed,}", "")
+ url = url.replace("{,IsUnplayed,}", "")
+ elif url.find("{IsUnplayed}") != -1:
+ url = url.replace("{IsUnplayed}", "IsUnplayed")
+ elif url.find("{,IsUnplayed}") != -1:
+ url = url.replace("{,IsUnplayed}", ",IsUnplayed")
+ elif url.find("{IsUnplayed,}") != -1:
+ url = url.replace("{IsUnplayed,}", "IsUnplayed,")
+ elif url.find("{,IsUnplayed,}") != -1:
+ url = url.replace("{,IsUnplayed,}", ",IsUnplayed,")
log.debug(url)
return_data = "null"
@@ -395,6 +371,8 @@ class DownloadUtils():
return_data = gzipper.read()
else:
return_data = retData
+ if headers is not None and isinstance(headers, dict):
+ headers.update(data.getheaders())
log.debug("Data Len After : " + str(len(return_data)))
log.debug("====== 200 returned =======")
log.debug("Content-Type : " + str(contentType))
@@ -413,7 +391,7 @@ class DownloadUtils():
log.error(error)
if suppress is False:
if popup == 0:
- xbmcgui.Dialog().notification(self.addon_name, i18n('url_error_') + str(data.reason))
+ xbmcgui.Dialog().notification(self.addon_name, i18n('url_error_') % str(data.reason))
else:
xbmcgui.Dialog().ok(self.addon_name, i18n('url_error_') % str(data.reason))
log.error(error)
@@ -423,7 +401,7 @@ class DownloadUtils():
log.error(error)
if suppress is False:
if popup == 0:
- xbmcgui.Dialog().notification(self.addon_name, i18n('url_error_') + str(msg))
+ xbmcgui.Dialog().notification(self.addon_name, i18n('url_error_') % str(msg))
else:
xbmcgui.Dialog().ok(self.addon_name, i18n('url_error_') % i18n('unable_connect_server'), str(msg))
#raise
diff --git a/plugin.video.embycon/resources/lib/functions.py b/plugin.video.embycon/resources/lib/functions.py
index 34f0322..aa2953e 100644
--- a/plugin.video.embycon/resources/lib/functions.py
+++ b/plugin.video.embycon/resources/lib/functions.py
@@ -16,7 +16,7 @@ import xbmcaddon
import xbmc
from downloadutils import DownloadUtils
-from utils import getDetailsString, getArt
+from utils import getDetailsString, getArt, cache_artwork
from kodi_utils import HomeWindow
from clientinfo import ClientInformation
from datamanager import DataManager
@@ -25,6 +25,8 @@ from simple_logging import SimpleLogging
from menu_functions import displaySections, showMovieAlphaList, showGenreList, showWidgets, showSearch
from translation import i18n
from server_sessions import showServerSessions
+from action_menu import ActionMenu
+from widgets import getWidgetContent, getWidgetContentCast, getWidgetContentSimilar, getWidgetContentNextUp, getSuggestions, getWidgetUrlContent, checkForNewContent
__addon__ = xbmcaddon.Addon(id='plugin.video.embycon')
__addondir__ = xbmc.translatePath(__addon__.getAddonInfo('profile'))
@@ -63,7 +65,6 @@ def mainEntryPoint():
except:
params = {}
- checkService()
home_window = HomeWindow()
if (len(params) == 0):
@@ -87,6 +88,8 @@ def mainEntryPoint():
if mode == "CHANGE_USER":
checkServer(change_user=True, notify=False)
+ elif mode== "CACHE_ARTWORK":
+ cache_artwork()
elif mode == "DETECT_SERVER":
checkServer(force=True, notify=True)
elif mode == "DETECT_SERVER_USER":
@@ -108,10 +111,14 @@ def mainEntryPoint():
delete(item_id)
elif mode == "MOVIE_ALPHA":
showMovieAlphaList()
- elif mode == "MOVIE_GENRA":
+ elif mode == "MOVIE_GENRE":
showGenreList()
+ elif mode == "SERIES_GENRE":
+ showGenreList(item_type="series")
elif mode == "WIDGETS":
showWidgets()
+ elif mode == "SHOW_MENU":
+ showMenu(params)
elif mode == "SHOW_SETTINGS":
__addon__.openSettings()
WINDOW = xbmcgui.getCurrentWindowId()
@@ -122,7 +129,17 @@ def mainEntryPoint():
home_window.setProperty("force_data_reload", "true")
xbmc.executebuiltin("Container.Refresh")
elif mode == "WIDGET_CONTENT":
- getWigetContent(int(sys.argv[1]), params)
+ getWidgetContent(int(sys.argv[1]), params)
+ elif mode == "WIDGET_CONTENT_CAST":
+ getWidgetContentCast(int(sys.argv[1]), params)
+ elif mode == "WIDGET_CONTENT_SIMILAR":
+ getWidgetContentSimilar(int(sys.argv[1]), params)
+ elif mode == "WIDGET_CONTENT_NEXTUP":
+ getWidgetContentNextUp(int(sys.argv[1]), params)
+ elif mode == "WIDGET_CONTENT_SUGGESTIONS":
+ getSuggestions(int(sys.argv[1]), params)
+ elif mode == "WIDGET_CONTENT_URL":
+ getWidgetUrlContent(int(sys.argv[1]), params)
elif mode == "PARENT_CONTENT":
checkServer(notify=False)
showParentContent(sys.argv[0], int(sys.argv[1]), params)
@@ -187,6 +204,7 @@ def markWatched(item_id):
downloadUtils.downloadUrl(url, postBody="", method="POST")
home_window = HomeWindow()
home_window.setProperty("force_data_reload", "true")
+ checkForNewContent()
xbmc.executebuiltin("Container.Refresh")
@@ -196,6 +214,7 @@ def markUnwatched(item_id):
downloadUtils.downloadUrl(url, method="DELETE")
home_window = HomeWindow()
home_window.setProperty("force_data_reload", "true")
+ checkForNewContent()
xbmc.executebuiltin("Container.Refresh")
@@ -205,6 +224,7 @@ def markFavorite(item_id):
downloadUtils.downloadUrl(url, postBody="", method="POST")
home_window = HomeWindow()
home_window.setProperty("force_data_reload", "true")
+ checkForNewContent()
xbmc.executebuiltin("Container.Refresh")
@@ -214,6 +234,7 @@ def unmarkFavorite(item_id):
downloadUtils.downloadUrl(url, method="DELETE")
home_window = HomeWindow()
home_window.setProperty("force_data_reload", "true")
+ checkForNewContent()
xbmc.executebuiltin("Container.Refresh")
@@ -226,6 +247,8 @@ def delete(item_id):
progress.create(i18n('deleting'), i18n('waiting_server_delete'))
downloadUtils.downloadUrl(url, method="DELETE")
progress.close()
+ home_window = HomeWindow()
+ checkForNewContent()
xbmc.executebuiltin("Container.Refresh")
@@ -248,6 +271,8 @@ def addGUIItem(url, details, extraData, display_options, folder=True):
# Create the URL to pass to the item
if folder:
u = sys.argv[0] + "?url=" + urllib.quote(url) + mode + "&media_type=" + extraData["itemtype"]
+ if extraData.get("name_format"):
+ u += '&name_format=' + urllib.quote(extraData.get("name_format"))
else:
u = sys.argv[0] + "?item_id=" + url + "&mode=PLAY"
@@ -257,7 +282,7 @@ def addGUIItem(url, details, extraData, display_options, folder=True):
listItemName = details.get('title', i18n('unknown'))
# calculate percentage
- cappedPercentage = None
+ cappedPercentage = 0
if (extraData.get('resumetime') != None and int(extraData.get('resumetime')) > 0):
duration = float(extraData.get('duration'))
if (duration > 0):
@@ -270,10 +295,6 @@ def addGUIItem(url, details, extraData, display_options, folder=True):
watched = int(extraData.get('WatchedEpisodes'))
percentage = int((float(watched) / float(totalItems)) * 100.0)
cappedPercentage = percentage
- if (cappedPercentage == 0):
- cappedPercentage = None
- if (cappedPercentage == 100):
- cappedPercentage = None
countsAdded = False
addCounts = display_options.get("addCounts", True)
@@ -282,7 +303,10 @@ def addGUIItem(url, details, extraData, display_options, folder=True):
listItemName = listItemName + " (" + extraData.get('UnWatchedEpisodes') + ")"
addResumePercent = display_options.get("addResumePercent", True)
- if (countsAdded == False and addResumePercent and details.get('title') != None and cappedPercentage != None):
+ if (countsAdded == False
+ and addResumePercent
+ and details.get('title') != None
+ and cappedPercentage not in [0, 100]):
listItemName = listItemName + " (" + str(cappedPercentage) + "%)"
subtitle_available = display_options.get("addSubtitleAvailable", False)
@@ -300,7 +324,7 @@ def addGUIItem(url, details, extraData, display_options, folder=True):
log.debug("Setting thumbnail as " + thumbPath)
# calculate percentage
- if (cappedPercentage != None):
+ if (cappedPercentage != 0):
list_item.setProperty("complete_percentage", str(cappedPercentage))
# For all end items
@@ -312,7 +336,8 @@ def addGUIItem(url, details, extraData, display_options, folder=True):
# StartPercent
- artTypes = ['thumb', 'poster', 'fanart', 'clearlogo', 'discart', 'banner', 'clearart', 'landscape', 'tvshow.poster']
+ artTypes = ['thumb', 'poster', 'fanart', 'clearlogo', 'discart', 'banner', 'clearart',
+ 'landscape', 'tvshow.poster', 'tvshow.clearart', 'tvshow.banner', 'tvshow.landscape']
artLinks = {}
for artType in artTypes:
artLinks[artType] = extraData.get(artType, '')
@@ -352,6 +377,8 @@ def addGUIItem(url, details, extraData, display_options, folder=True):
videoInfoLabels["director"] = extraData.get('director')
videoInfoLabels["writer"] = extraData.get('writer')
videoInfoLabels["year"] = extraData.get('year')
+ videoInfoLabels["premiered"] = extraData.get('premieredate')
+ videoInfoLabels["dateadded"] = extraData.get('dateadded')
videoInfoLabels["studio"] = extraData.get('studio')
videoInfoLabels["genre"] = extraData.get('genre')
@@ -477,6 +504,7 @@ def setSort(pluginhandle, viewType):
xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_SORT_TITLE_IGNORE_THE)
xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_YEAR)
+ xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_DATEADDED)
xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_GENRE)
xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_UNSORTED)
xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_NONE)
@@ -539,6 +567,15 @@ def getContent(url, params):
xbmcplugin.endOfDirectory(pluginhandle, cacheToDisc=False)
+ # if the view master addon is available then run the script
+ try:
+ view_addon = xbmcaddon.Addon("script.viewmaster")
+ if view_addon is not None:
+ xbmc.executebuiltin('RunScript(' + xbmc.translatePath(
+ "special://home/addons/script.viewmaster/default.py") + ',' + viewType + ')')
+ except:
+ pass
+
if (progress != None):
progress.update(100, i18n('done'))
progress.close()
@@ -596,7 +633,10 @@ def processDirectory(results, progress, params):
item_count = len(result)
current_item = 1
-
+ first_season_item = None
+ total_unwatched = 0
+ total_episodes = 0
+ total_watched = 0
for item in result:
if (progress != None):
@@ -609,16 +649,27 @@ def processDirectory(results, progress, params):
item_type = str(item.get("Type")).encode('utf-8')
- tempEpisode = item.get("IndexNumber")
- if tempEpisode is not None:
- if tempEpisode < 10:
- tempEpisode = "0" + str(tempEpisode)
+ if item_type == "Season" and first_season_item is None:
+ first_season_item = item
+
+ # set the episode number
+ tempEpisode = ""
+ if item_type == "Episode":
+ tempEpisode = item.get("IndexNumber")
+ if tempEpisode is not None:
+ if tempEpisode < 10:
+ tempEpisode = "0" + str(tempEpisode)
+ else:
+ tempEpisode = str(tempEpisode)
else:
- tempEpisode = str(tempEpisode)
- else:
- tempEpisode = ""
+ tempEpisode = ""
- tempSeason = item.get("ParentIndexNumber")
+ # set the season number
+ tempSeason = None
+ if item_type == "Episode":
+ tempSeason = item.get("ParentIndexNumber")
+ elif item_type == "Season":
+ tempSeason = item.get("IndexNumber")
if tempSeason is not None:
if tempSeason < 10:
tempSeason = "0" + str(tempSeason)
@@ -664,6 +715,12 @@ def processDirectory(results, progress, params):
tokens = (item.get("PremiereDate")).split("T")
premiere_date = tokens[0]
+ try:
+ date_added = item['DateCreated']
+ date_added = date_added.split('.')[0].replace('T', " ")
+ except KeyError:
+ date_added = ""
+
# add the premiered date for Upcoming TV
if item.get("LocationType") == "Virtual":
airtime = item.get("AirTime")
@@ -797,6 +854,9 @@ def processDirectory(results, progress, params):
WatchedEpisodes = 0 if userData.get("UnplayedItemCount") == None else TotalEpisodes - userData.get("UnplayedItemCount")
UnWatchedEpisodes = 0 if userData.get("UnplayedItemCount") == None else userData.get("UnplayedItemCount")
NumEpisodes = TotalEpisodes
+ total_unwatched += UnWatchedEpisodes
+ total_episodes += TotalEpisodes
+ total_watched += WatchedEpisodes
art = getArt(item, server)
# Populate the extraData list
@@ -809,12 +869,16 @@ def processDirectory(results, progress, params):
'clearart': art['clearart'],
'landscape': art['landscape'],
'tvshow.poster': art['tvshow.poster'],
+ 'tvshow.clearart': art['tvshow.clearart'],
+ 'tvshow.banner': art['tvshow.banner'],
+ 'tvshow.landscape': art['tvshow.landscape'],
'id': id,
'mpaa': item.get("OfficialRating"),
'rating': item.get("CommunityRating"),
'criticrating': item.get("CriticRating"),
'year': production_year,
'premieredate': premiere_date,
+ 'dateadded': date_added,
'locationtype': item.get("LocationType"),
'studio': studio,
'genre': genre,
@@ -839,6 +903,7 @@ def processDirectory(results, progress, params):
'WatchedEpisodes': str(WatchedEpisodes),
'UnWatchedEpisodes': str(UnWatchedEpisodes),
'NumEpisodes': str(NumEpisodes),
+ 'OriginalTitle': item.get("Name").encode('utf-8'),
'itemtype': item_type,
'SubtitleLang': subtitle_lang,
'SubtitleAvailable': subtitle_available}
@@ -869,165 +934,95 @@ def processDirectory(results, progress, params):
u = id
dirItems.append(addGUIItem(u, details, extraData, display_options, folder=False))
- return dirItems
-
-def getWigetContent(handle, params):
- log.debug("getWigetContent Called" + str(params))
- server = downloadUtils.getServer()
-
- type = params.get("type")
- if (type == None):
- log.error("getWigetContent type not set")
- return
-
- itemsUrl = ("{server}/emby/Users/{userid}/Items"
- "?Limit=20"
- "&format=json"
- "&ImageTypeLimit=1"
- "&IsMissing=False")
-
- if (type == "recent_movies"):
- xbmcplugin.setContent(handle, 'movies')
- itemsUrl += ("&Recursive=true"
- "&SortBy=DateCreated"
- "&SortOrder=Descending"
- "&Filters=IsUnplayed,IsNotFolder"
- "&IsVirtualUnaired=false"
- "&IsMissing=False"
- "&IncludeItemTypes=Movie")
- elif (type == "inprogress_movies"):
- xbmcplugin.setContent(handle, 'movies')
- itemsUrl += ("&Recursive=true"
- "&SortBy=DatePlayed"
- "&SortOrder=Descending"
- "&Filters=IsResumable"
- "&IsVirtualUnaired=false"
- "&IsMissing=False"
- "&IncludeItemTypes=Movie")
- elif (type == "random_movies"):
- xbmcplugin.setContent(handle, 'movies')
- itemsUrl += ("&Recursive=true"
- "&SortBy=Random"
- "&SortOrder=Descending"
- "&Filters=IsUnplayed,IsNotFolder"
- "&IsVirtualUnaired=false"
- "&IsMissing=False"
- "&IncludeItemTypes=Movie")
- elif (type == "recent_episodes"):
- xbmcplugin.setContent(handle, 'episodes')
- itemsUrl += ("&Recursive=true"
- "&SortBy=DateCreated"
- "&SortOrder=Descending"
- "&Filters=IsUnplayed,IsNotFolder"
- "&IsVirtualUnaired=false"
- "&IsMissing=False"
- "&IncludeItemTypes=Episode")
- elif (type == "inprogress_episodes"):
- xbmcplugin.setContent(handle, 'episodes')
- itemsUrl += ("&Recursive=true"
- "&SortBy=DatePlayed"
- "&SortOrder=Descending"
- "&Filters=IsResumable"
- "&IsVirtualUnaired=false"
- "&IsMissing=False"
- "&IncludeItemTypes=Episode")
- elif (type == "nextup_episodes"):
- xbmcplugin.setContent(handle, 'episodes')
- itemsUrl = ("{server}/emby/Shows/NextUp"
- "?Limit=20"
- "&userid={userid}"
- "&Recursive=true"
- "&format=json"
- "&ImageTypeLimit=1")
-
- log.debug("WIDGET_DATE_URL: " + itemsUrl)
-
- # get the items
- jsonData = downloadUtils.downloadUrl(itemsUrl, suppress=False, popup=1)
- log.debug("Recent(Items) jsonData: " + jsonData)
- result = json.loads(jsonData)
-
- if result is None:
- return []
-
- result = result.get("Items")
- if (result == None):
- result = []
-
- itemCount = 1
- listItems = []
- for item in result:
- item_id = item.get("Id")
- name = item.get("Name")
- episodeDetails = ""
- log.debug("WIDGET_DATE_NAME: " + name)
-
- title = item.get("Name")
- tvshowtitle = ""
-
- if (item.get("Type") == "Episode" and item.get("SeriesName") != None):
-
- eppNumber = "X"
- tempEpisodeNumber = "0"
- if (item.get("IndexNumber") != None):
- eppNumber = item.get("IndexNumber")
- if eppNumber < 10:
- tempEpisodeNumber = "0" + str(eppNumber)
- else:
- tempEpisodeNumber = str(eppNumber)
-
- seasonNumber = item.get("ParentIndexNumber")
- if seasonNumber < 10:
- tempSeasonNumber = "0" + str(seasonNumber)
- else:
- tempSeasonNumber = str(seasonNumber)
-
- episodeDetails = "S" + tempSeasonNumber + "E" + tempEpisodeNumber
- name = item.get("SeriesName") + " " + episodeDetails
- tvshowtitle = episodeDetails
- title = item.get("SeriesName")
-
- art = getArt(item, server, widget=True)
-
- if kodi_version > 17:
- list_item = xbmcgui.ListItem(label=name, iconImage=art['thumb'], offscreen=True)
- else:
- list_item = xbmcgui.ListItem(label=name, iconImage=art['thumb'])
-
- # list_item.setLabel2(episodeDetails)
- list_item.setInfo(type="Video", infoLabels={"title": title, "tvshowtitle": tvshowtitle})
- list_item.setProperty('fanart_image', art['fanart']) # back compat
- list_item.setProperty('discart', art['discart']) # not avail to setArt
- list_item.setArt(art)
- # add count
- list_item.setProperty("item_index", str(itemCount))
- itemCount = itemCount + 1
-
- list_item.setProperty('IsPlayable', 'true')
-
- totalTime = str(int(float(item.get("RunTimeTicks", "0")) / (10000000 * 60)))
- list_item.setProperty('TotalTime', str(totalTime))
-
- # add progress percent
- userData = item.get("UserData")
- if (userData != None):
- playBackTicks = float(userData.get("PlaybackPositionTicks"))
- if (playBackTicks != None and playBackTicks > 0):
- runTimeTicks = float(item.get("RunTimeTicks", "0"))
- if (runTimeTicks > 0):
- playBackPos = int(((playBackTicks / 1000) / 10000) / 60)
- list_item.setProperty('ResumeTime', str(playBackPos))
-
- percentage = int((playBackTicks / runTimeTicks) * 100.0)
- list_item.setProperty("complete_percentage", str(percentage))
-
- playurl = "plugin://plugin.video.embycon/?item_id=" + item_id + '&mode=PLAY'
+ # add the all episodes item
+ if first_season_item is not None:
+ series_url = ('{server}/emby/Users/{userid}/items' +
+ '?ParentId=' + str(first_season_item.get("SeriesId")).encode('utf-8') +
+ '&IsVirtualUnAired=false' +
+ '&IsMissing=false' +
+ '&Fields=' + detailsString +
+ '&Recursive=true' +
+ '&IncludeItemTypes=Episode' +
+ '&format=json')
+ played = 0
+ overlay = "7"
+ if total_unwatched == 0:
+ played = 1
+ overlay = "6"
+ details = {'title': i18n('all'),
+ 'Overlay': overlay,
+ 'playcount': str(played)
+ }
+ art = getArt(first_season_item, server)
+ # Populate the extraData list
+ extraData = {'thumb': art['tvshow.poster'],
+ 'fanart': art['fanart'],
+ 'poster': art['tvshow.poster'],
+ 'banner': art['tvshow.banner'],
+ 'clearlogo': art['clearlogo'],
+ 'discart': art['discart'],
+ 'clearart': art['clearart'],
+ 'landscape': art['landscape'],
+ 'tvshow.poster': art['tvshow.poster'],
+ 'tvshow.clearart': art['tvshow.clearart'],
+ 'tvshow.banner': art['tvshow.banner'],
+ 'tvshow.landscape': art['tvshow.landscape'],
+ 'itemtype': 'Episodes',
+ 'UnWatchedEpisodes': str(total_unwatched),
+ 'TotalEpisodes': str(total_episodes),
+ 'WatchedEpisodes': str(total_watched),
+ 'playcount': str(played),
+ 'mode': 'GET_CONTENT',
+ 'name_format': 'Episode|episode_name_format'}
+ dirItems.append(addGUIItem(series_url, details, extraData, {}, folder=True))
- itemTupple = (playurl, list_item, False)
- listItems.append(itemTupple)
+ return dirItems
- xbmcplugin.addDirectoryItems(handle, listItems)
- xbmcplugin.endOfDirectory(handle, cacheToDisc=False)
+def showMenu(params):
+ log.debug("showMenu(): " + str(params))
+
+ action_items = []
+ li = xbmcgui.ListItem("Play")
+ li.setProperty('menu_id', 'play')
+ action_items.append(li)
+ li = xbmcgui.ListItem("Force Transcode")
+ li.setProperty('menu_id', 'transcode')
+ action_items.append(li)
+ li = xbmcgui.ListItem("Mark Watched")
+ li.setProperty('menu_id', 'mark_watched')
+ action_items.append(li)
+ li = xbmcgui.ListItem("Mark Unwatched")
+ li.setProperty('menu_id', 'mark_unwatched')
+ action_items.append(li)
+ li = xbmcgui.ListItem("Delete")
+ li.setProperty('menu_id', 'delete')
+ action_items.append(li)
+
+ action_menu = ActionMenu("ActionMenu.xml", PLUGINPATH, "default", "720p")
+ action_menu.setActionItems(action_items)
+ action_menu.doModal()
+ selected_action_item = action_menu.getActionItem()
+ selected_action = ""
+ if selected_action_item is not None:
+ selected_action = selected_action_item.getProperty('menu_id')
+ log.debug("Menu Action Selected: " + str(selected_action_item))
+ del action_menu
+
+ if selected_action == "play":
+ log.debug("Play Item")
+ PLAY(params)
+ elif selected_action == "transcode":
+ params['force_transcode'] = 'true'
+ PLAY(params)
+ elif selected_action == "mark_watched":
+ markWatched(params["item_id"])
+ xbmc.executebuiltin("XBMC.ReloadSkin()")
+ elif selected_action == "mark_unwatched":
+ markUnwatched(params["item_id"])
+ xbmc.executebuiltin("XBMC.ReloadSkin()")
+ elif selected_action == "delete":
+ delete(params["item_id"])
+ xbmc.executebuiltin("XBMC.ReloadSkin()")
def showContent(pluginName, handle, params):
@@ -1067,28 +1062,6 @@ def showParentContent(pluginName, handle, params):
log.debug("showParentContent Content Url : " + str(contentUrl))
getContent(contentUrl, params)
-def checkService():
- home_window = HomeWindow()
- time_stamp = home_window.getProperty("Service_Timestamp")
- loops = 0
- while not time_stamp and not xbmc.Monitor().abortRequested():
- loops = loops + 1
- if loops == 100:
- log.error("EmbyCon Service Not Running, no time stamp, exiting")
- xbmcgui.Dialog().ok(i18n('error'), i18n('service_not_running'), i18n('restart_kodi'))
- sys.exit()
- xbmc.sleep(200)
- time_stamp = home_window.getProperty("Service_Timestamp")
-
- log.debug("EmbyCon Service Timestamp: " + time_stamp)
- log.debug("EmbyCon Current Timestamp: " + str(int(time.time())))
-
- if ((int(time_stamp) + 240) < int(time.time())):
- log.error("EmbyCon Service Not Running, time stamp to old, exiting")
- xbmcgui.Dialog().ok(i18n('error'), i18n('service_not_running'), i18n('restart_kodi'))
- sys.exit()
-
-
def search(handle, params):
log.debug('search Called: ' + str(params))
item_type = params.get('item_type')
@@ -1308,6 +1281,8 @@ def PLAY(params):
# set all the playback info, this will be picked up by the service
# the service will then start the playback
+ xbmc.Player().stop()
+
play_info = {}
play_info["item_id"] = item_id
play_info["auto_resume"] = str(auto_resume)
@@ -1317,3 +1292,5 @@ def PLAY(params):
home_window = HomeWindow()
home_window.setProperty("item_id", item_id)
home_window.setProperty("play_item_message", play_data)
+
+ #xbmcgui.Dialog().notification("EmbyCon", "Starting Playback")
diff --git a/plugin.video.embycon/resources/lib/menu_functions.py b/plugin.video.embycon/resources/lib/menu_functions.py
index 6fc0838..4e9ca0f 100644
--- a/plugin.video.embycon/resources/lib/menu_functions.py
+++ b/plugin.video.embycon/resources/lib/menu_functions.py
@@ -20,7 +20,7 @@ downloadUtils = DownloadUtils()
__addon__ = xbmcaddon.Addon(id='plugin.video.embycon')
-def showGenreList():
+def showGenreList(item_type=None):
log.debug("== ENTER: showGenreList() ==")
server = downloadUtils.getServer()
@@ -29,8 +29,20 @@ def showGenreList():
detailsString = getDetailsString()
+ kodi_type = "Movies"
+ emby_type = "Movie"
+ if item_type is not None and item_type == "series":
+ emby_type = "Series"
+ kodi_type = "tvshows"
+
try:
- jsonData = downloadUtils.downloadUrl("{server}/emby/Genres?SortBy=SortName&SortOrder=Ascending&IncludeTypes=Movie&Recursive=true&UserId={userid}&format=json")
+ jsonData = downloadUtils.downloadUrl("{server}/emby/Genres?" +
+ "SortBy=SortName" +
+ "&SortOrder=Ascending" +
+ "&IncludeItemTypes=" + emby_type +
+ "&Recursive=true" +
+ "&UserId={userid}" +
+ "&format=json")
log.debug("GENRE_LIST_DATA : " + jsonData)
except Exception, msg:
error = "Get connect : " + str(msg)
@@ -44,11 +56,11 @@ def showGenreList():
for genre in result:
item_data = {}
item_data['title'] = genre.get("Name")
- item_data['media_type'] = "Movies"
+ item_data['media_type'] = kodi_type
item_data['thumbnail'] = downloadUtils.getArtwork(genre, "Thumb", server=server)
item_data['path'] = ('{server}/emby/Users/{userid}/Items?Fields=' + detailsString +
'&Recursive=true&GenreIds=' + genre.get("Id") +
- '&IncludeItemTypes=Movie' +
+ '&IncludeItemTypes=' + emby_type +
'&ImageTypeLimit=1&format=json')
collections.append(item_data)
@@ -129,8 +141,9 @@ def displaySections():
log.debug("addMenuDirectoryItem: " + collection.get('title', i18n('unknown')) + " " + str(url))
addMenuDirectoryItem(collection.get('title', i18n('unknown')), url, thumbnail=collection.get("thumbnail"))
- addMenuDirectoryItem(i18n('movies_genre'), "plugin://plugin.video.embycon/?mode=MOVIE_GENRA")
+ addMenuDirectoryItem(i18n('movies_genre'), "plugin://plugin.video.embycon/?mode=MOVIE_GENRE")
addMenuDirectoryItem(i18n('movies_az'), "plugin://plugin.video.embycon/?mode=MOVIE_ALPHA")
+ addMenuDirectoryItem(i18n('tvshow_genre'), "plugin://plugin.video.embycon/?mode=SERIES_GENRE")
addMenuDirectoryItem(i18n('search'), "plugin://plugin.video.embycon/?mode=SEARCH")
addMenuDirectoryItem(i18n('show_clients'), "plugin://plugin.video.embycon/?mode=SHOW_SERVER_SESSIONS")
@@ -138,6 +151,7 @@ def displaySections():
addMenuDirectoryItem(i18n('detect_server'), "plugin://plugin.video.embycon/?mode=DETECT_SERVER_USER")
addMenuDirectoryItem(i18n('show_settings'), "plugin://plugin.video.embycon/?mode=SHOW_SETTINGS")
+ addMenuDirectoryItem(i18n('cache_textures'), "plugin://plugin.video.embycon/?mode=CACHE_ARTWORK")
if collections:
addMenuDirectoryItem(i18n('widgets'), "plugin://plugin.video.embycon/?mode=WIDGETS")
@@ -265,7 +279,7 @@ def getCollections(detailsString):
'&Fields=' + detailsString +
'&SortBy=DateCreated' +
'&SortOrder=Descending' +
- '&Filters=IsUnplayed,IsNotFolder' +
+ '&Filters={IsUnplayed,}IsNotFolder' +
'&Recursive=true' +
'&IncludeItemTypes=Episode' +
'&ImageTypeLimit=1' +
@@ -326,7 +340,7 @@ def getCollections(detailsString):
'&Fields=' + detailsString +
'&SortBy=DateCreated' +
'&SortOrder=Descending' +
- '&Filters=IsUnplayed,IsNotFolder' +
+ '&Filters={IsUnplayed,}IsNotFolder' +
'&ImageTypeLimit=1' +
'&format=json'),
'media_type': collection_type})
@@ -377,7 +391,7 @@ def getCollections(detailsString):
'&SortBy=DateCreated' +
'&Fields=' + detailsString +
'&SortOrder=Descending' +
- '&Filters=IsUnplayed,IsNotFolder' +
+ '&Filters={IsUnplayed,}IsNotFolder' +
'&IncludeItemTypes=Movie' +
'&ImageTypeLimit=1' +
'&format=json')
@@ -451,7 +465,7 @@ def getCollections(detailsString):
'&SortBy=DateCreated' +
'&Fields=' + detailsString +
'&SortOrder=Descending' +
- '&Filters=IsUnplayed' +
+ '&Filters={IsUnplayed}' +
'&IsVirtualUnaired=false' +
'&IsMissing=False' +
'&IncludeItemTypes=Episode' +
@@ -483,7 +497,7 @@ def getCollections(detailsString):
'&SortBy=DateCreated' +
'&Fields=' + detailsString +
'&SortOrder=Descending' +
- '&Filters=IsUnplayed,IsNotFolder' +
+ '&Filters={IsUnplayed,}IsNotFolder' +
'&IsVirtualUnaired=false' +
'&IsMissing=False' +
'&IncludeItemTypes=Episode' +
diff --git a/plugin.video.embycon/resources/lib/play_utils.py b/plugin.video.embycon/resources/lib/play_utils.py
index f7cba7c..e6455c5 100644
--- a/plugin.video.embycon/resources/lib/play_utils.py
+++ b/plugin.video.embycon/resources/lib/play_utils.py
@@ -7,11 +7,12 @@ import xbmcaddon
from datetime import timedelta
import time
import json
+import hashlib
from simple_logging import SimpleLogging
from downloadutils import DownloadUtils
from resume_dialog import ResumeDialog
-from utils import PlayUtils, getArt
+from utils import PlayUtils, getArt, id_generator
from kodi_utils import HomeWindow
from translation import i18n
from json_rpc import json_rpc
@@ -30,7 +31,6 @@ def playFile(play_info):
settings = xbmcaddon.Addon('plugin.video.embycon')
addon_path = settings.getAddonInfo('path')
- playback_type = settings.getSetting("playback_type")
jump_back_amount = int(settings.getSetting("jump_back_amount"))
server = downloadUtils.getServer()
@@ -38,6 +38,7 @@ def playFile(play_info):
jsonData = downloadUtils.downloadUrl("{server}/emby/Users/{userid}/Items/" + id + "?format=json",
suppress=False, popup=1)
result = json.loads(jsonData)
+ log.debug("Playfile item info: " + str(result))
seekTime = 0
auto_resume = int(auto_resume)
@@ -81,6 +82,8 @@ def playFile(play_info):
listitem_props = []
playurl = None
+ play_session_id = id_generator()
+ log.debug("play_session_id: %s" % play_session_id)
# check if strm file, path will contain contain strm contents
if result.get('MediaSources'):
@@ -89,18 +92,19 @@ def playFile(play_info):
playurl, listitem_props = PlayUtils().getStrmDetails(result)
if not playurl:
- playurl = PlayUtils().getPlayUrl(id, result, force_transcode)
+ playurl, playback_type = PlayUtils().getPlayUrl(id, result, force_transcode, play_session_id)
log.debug("Play URL: " + playurl + " ListItem Properties: " + str(listitem_props))
playback_type_string = "DirectPlay"
- if playback_type == "2" or force_transcode:
+ if playback_type == "2":
playback_type_string = "Transcode"
elif playback_type == "1":
playback_type_string = "DirectStream"
home_window = HomeWindow()
home_window.setProperty("PlaybackType_" + id, playback_type_string)
+ home_window.setProperty("PlaySessionId_" + id, play_session_id)
# add the playback type into the overview
if result.get("Overview", None) is not None:
@@ -108,9 +112,30 @@ def playFile(play_info):
else:
result["Overview"] = playback_type_string
- list_item = xbmcgui.ListItem(label=result.get("Name", i18n('missing_title')), path=playurl)
+ item_title = result.get("Name", i18n('missing_title'))
+ add_episode_number = settings.getSetting('addEpisodeNumber') == 'true'
+ if result.get("Type") == "Episode" and add_episode_number:
+ episode_num = result.get("IndexNumber")
+ if episode_num is not None:
+ if episode_num < 10:
+ episode_num = "0" + str(episode_num)
+ else:
+ episode_num = str(episode_num)
+ else:
+ episode_num = ""
+ item_title = episode_num + " - " + item_title
+
+ list_item = xbmcgui.ListItem(label=item_title)
- list_item = setListItemProps(id, list_item, result, server, listitem_props)
+ # if transcoding then prompt for audio and subtitle
+ if playback_type == "2":
+ playurl = audioSubsPref(playurl, list_item, result)
+ log.debug("New playurl for transcoding : " + playurl)
+ elif playback_type == "1":
+ externalSubs(result, list_item)
+
+ list_item.setPath(playurl)
+ list_item = setListItemProps(id, list_item, result, server, listitem_props, item_title)
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
playlist.clear()
@@ -138,7 +163,7 @@ def playFile(play_info):
xbmc.sleep(100)
# xbmc.Player().play()
-def setListItemProps(id, listItem, result, server, extra_props):
+def setListItemProps(id, listItem, result, server, extra_props, title):
# set up item and item info
thumbID = id
eppNum = -1
@@ -152,13 +177,14 @@ def setListItemProps(id, listItem, result, server, extra_props):
listItem.setProperty('IsPlayable', 'true')
listItem.setProperty('IsFolder', 'false')
+ listItem.setProperty('id', result.get("Id"))
for prop in extra_props:
listItem.setProperty(prop[0], prop[1])
# play info
details = {
- 'title': result.get("Name", i18n('missing_title')),
+ 'title': title,
'plot': result.get("Overview")
}
@@ -171,3 +197,135 @@ def setListItemProps(id, listItem, result, server, extra_props):
listItem.setInfo("Video", infoLabels=details)
return listItem
+
+# For transcoding only
+# Present the list of audio and subtitles to select from
+# for external streamable subtitles add the URL to the Kodi item and let Kodi handle it
+# else ask for the subtitles to be burnt in when transcoding
+def audioSubsPref(url, list_item, emby_item):
+
+ dialog = xbmcgui.Dialog()
+ audioStreamsList = {}
+ audioStreams = []
+ audioStreamsChannelsList = {}
+ subtitleStreamsList = {}
+ subtitleStreams = ['No subtitles']
+ downloadableStreams = []
+ selectAudioIndex = ""
+ selectSubsIndex = ""
+ playurlprefs = "%s" % url
+
+ try:
+ mediasources = emby_item['MediaSources'][0]
+ mediastreams = mediasources['MediaStreams']
+ except (TypeError, KeyError, IndexError):
+ return
+
+ for stream in mediastreams:
+ # Since Emby returns all possible tracks together, have to sort them.
+ index = stream['Index']
+
+ if 'Audio' in stream['Type']:
+ codec = stream['Codec']
+ channelLayout = stream.get('ChannelLayout', "")
+
+ try:
+ track = "%s - %s - %s %s" % (index, stream['Language'], codec, channelLayout)
+ except:
+ track = "%s - %s %s" % (index, codec, channelLayout)
+
+ audioStreamsChannelsList[index] = stream['Channels']
+ audioStreamsList[track] = index
+ audioStreams.append(track)
+
+ elif 'Subtitle' in stream['Type']:
+ try:
+ track = "%s - %s" % (index, stream['Language'])
+ except:
+ track = "%s - %s" % (index, stream['Codec'])
+
+ default = stream['IsDefault']
+ forced = stream['IsForced']
+ downloadable = stream['IsTextSubtitleStream'] and stream['IsExternal'] and stream['SupportsExternalStream']
+
+ if default:
+ track = "%s - Default" % track
+ if forced:
+ track = "%s - Forced" % track
+ if downloadable:
+ downloadableStreams.append(index)
+
+ subtitleStreamsList[track] = index
+ subtitleStreams.append(track)
+
+ if len(audioStreams) > 1:
+ resp = dialog.select(i18n('select_audio_stream'), audioStreams)
+ if resp > -1:
+ # User selected audio
+ selected = audioStreams[resp]
+ selectAudioIndex = audioStreamsList[selected]
+ playurlprefs += "&AudioStreamIndex=%s" % selectAudioIndex
+ else: # User backed out of selection
+ playurlprefs += "&AudioStreamIndex=%s" % mediasources['DefaultAudioStreamIndex']
+ else: # There's only one audiotrack.
+ selectAudioIndex = audioStreamsList[audioStreams[0]]
+ playurlprefs += "&AudioStreamIndex=%s" % selectAudioIndex
+
+ if len(subtitleStreams) > 1:
+ resp = dialog.select(i18n('select_subtitle'), subtitleStreams)
+ if resp == 0:
+ # User selected no subtitles
+ pass
+ elif resp > -1:
+ # User selected subtitles
+ selected = subtitleStreams[resp]
+ selectSubsIndex = subtitleStreamsList[selected]
+
+ # Load subtitles in the listitem if downloadable
+ if selectSubsIndex in downloadableStreams:
+
+ itemid = emby_item['Id']
+ url = [("%s/Videos/%s/%s/Subtitles/%s/Stream.srt"
+ % (downloadUtils.getServer(), itemid, itemid, selectSubsIndex))]
+ log.debug("Streaming subtitles url: %s %s" % (selectSubsIndex, url))
+ list_item.setSubtitles(url)
+ else:
+ # Burn subtitles
+ playurlprefs += "&SubtitleStreamIndex=%s" % selectSubsIndex
+
+ else: # User backed out of selection
+ playurlprefs += "&SubtitleStreamIndex=%s" % mediasources.get('DefaultSubtitleStreamIndex', "")
+
+ # Get number of channels for selected audio track
+ audioChannels = audioStreamsChannelsList.get(selectAudioIndex, 0)
+ if audioChannels > 2:
+ playurlprefs += "&AudioBitrate=384000"
+ else:
+ playurlprefs += "&AudioBitrate=192000"
+
+ return playurlprefs
+
+# direct stream, set any available subtitle streams
+def externalSubs(emby_item, list_item):
+
+ externalsubs = []
+ itemid = emby_item['Id']
+ try:
+ mediastreams = emby_item['MediaSources'][0]['MediaStreams']
+ except (TypeError, KeyError, IndexError):
+ return
+
+ for stream in mediastreams:
+
+ if (stream['Type'] == "Subtitle"
+ and stream['IsExternal']
+ and stream['IsTextSubtitleStream']
+ and stream['SupportsExternalStream']):
+
+ index = stream['Index']
+ url = ("%s/Videos/%s/%s/Subtitles/%s/Stream.%s"
+ % (downloadUtils.getServer(), itemid, itemid, index, stream['Codec']))
+
+ externalsubs.append(url)
+
+ list_item.setSubtitles(externalsubs) \ No newline at end of file
diff --git a/plugin.video.embycon/resources/lib/translation.py b/plugin.video.embycon/resources/lib/translation.py
index f0c2214..4df1142 100644
--- a/plugin.video.embycon/resources/lib/translation.py
+++ b/plugin.video.embycon/resources/lib/translation.py
@@ -50,9 +50,7 @@ STRINGS = {
'series': 30233,
'seasons': 30234,
'episodes': 30235,
- 'save': 30236,
'start_from_beginning': 30237,
- 'default_sort': 30238,
'next_page': 30245,
'search': 30246,
'widgets': 30247,
@@ -97,5 +95,21 @@ STRINGS = {
'_unwatched': 30285,
'movies_unwatched': 30286,
'tvshows_latest' : 30287,
- '_latest' : 30288
+ '_latest' : 30288,
+ 'tvshow_genre': 30289,
+ 'all': 30290,
+ 'select_audio_stream': 30291,
+ 'select_subtitle': 30292,
+ 'cache_textures': 30293,
+ 'notice': 30294,
+ 'http_control': 30295,
+ 'delete': 30296,
+ 'delete_existing': 30297,
+ 'deleting_textures': 30298,
+ 'cache_all_textures_title': 30299,
+ 'cache_all_textures': 30300,
+ 'caching_textures': 30301,
+ 'existing_textures': 30302,
+ 'missing_textures': 30303,
+ 'loaded_textures': 30304
}
diff --git a/plugin.video.embycon/resources/lib/utils.py b/plugin.video.embycon/resources/lib/utils.py
index 05a1094..b91aa59 100644
--- a/plugin.video.embycon/resources/lib/utils.py
+++ b/plugin.video.embycon/resources/lib/utils.py
@@ -1,11 +1,23 @@
# Gnu General Public License - see LICENSE.TXT
import xbmcaddon
+import xbmcgui
+import xbmcplugin
+import xbmc
import re
import encodings
+import string
+import random
+import urllib
+import json
+import httplib
+import base64
+import sys
from downloadutils import DownloadUtils
from simple_logging import SimpleLogging
from clientinfo import ClientInformation
+from json_rpc import json_rpc
+from translation import i18n
# define our global download utils
downloadUtils = DownloadUtils()
@@ -14,7 +26,7 @@ log = SimpleLogging(__name__)
###########################################################################
class PlayUtils():
- def getPlayUrl(self, id, result, force_transcode):
+ def getPlayUrl(self, id, result, force_transcode, play_session_id):
log.debug("getPlayUrl")
addonSettings = xbmcaddon.Addon(id='plugin.video.embycon')
playback_type = addonSettings.getSetting("playback_type")
@@ -23,15 +35,34 @@ class PlayUtils():
if force_transcode:
log.debug("playback_type: FORCED_TRANSCODE")
playurl = None
+ log.debug("play_session_id: " + play_session_id)
+
+ is_h265 = False
+ streams = result.get("MediaStreams", [])
+ for stream in streams:
+ if stream.get("Type", "") == "Video" and stream.get("Codec", "") in ["hevc", "h265"]:
+ is_h265 = True
+ break
+ if is_h265:
+ log.debug("H265_IS_TRUE")
+ h265_action = addonSettings.getSetting("h265_action")
+ if h265_action == "1":
+ log.debug("H265 override play action: setting to Direct Streaming")
+ playback_type = "1"
+ elif h265_action == "2":
+ log.debug("H265 override play action: setting to Transcode Streaming")
+ playback_type = "2"
+
+ if force_transcode:
+ playback_type = "2"
# transcode
- if playback_type == "2" or force_transcode:
+ if playback_type == "2":
playback_bitrate = addonSettings.getSetting("playback_bitrate")
log.debug("playback_bitrate: " + playback_bitrate)
- width_options = ["640", "720", "1024", "1280", "1440", "1600", "1920", "2600", "4096"]
- playback_max_width = width_options[int(addonSettings.getSetting("playback_max_width"))]
+ playback_max_width = addonSettings.getSetting("playback_max_width")
playback_video_force_8 = addonSettings.getSetting("playback_video_force_8") == "true"
clientInfo = ClientInformation()
@@ -40,8 +71,8 @@ class PlayUtils():
user_token = downloadUtils.authenticate()
playurl = (
- "%s/emby/Videos/%s/master.m3u8?MediaSourceId=%s&VideoCodec=h264&AudioCodec=ac3&MaxAudioChannels=6&deviceId=%s&VideoBitrate=%s"
- % (server, id, id, deviceId, bitrate))
+ "%s/emby/Videos/%s/master.m3u8?MediaSourceId=%s&PlaySessionId=%s&VideoCodec=h264&AudioCodec=ac3&MaxAudioChannels=6&deviceId=%s&VideoBitrate=%s"
+ % (server, id, id, play_session_id, deviceId, bitrate))
playurl = playurl + "&maxWidth=" + playback_max_width
@@ -73,12 +104,12 @@ class PlayUtils():
# do direct http streaming playback
elif playback_type == "1":
- playurl = "%s/emby/Videos/%s/stream?static=true" % (server, id)
+ playurl = "%s/emby/Videos/%s/stream?static=true&PlaySessionId=%s" % (server, id, play_session_id)
user_token = downloadUtils.authenticate()
playurl = playurl + "&api_key=" + user_token
log.debug("Playback URL: " + playurl)
- return playurl.encode('utf-8')
+ return playurl.encode('utf-8'), playback_type
def getStrmDetails(self, result):
playurl = None
@@ -112,7 +143,7 @@ def getDetailsString():
include_people = addonSettings.getSetting("include_people") == "true"
include_overview = addonSettings.getSetting("include_overview") == "true"
- detailsString = "EpisodeCount,SeasonCount,Path,Genres,Studios,CumulativeRunTimeTicks,Etag"
+ detailsString = "DateCreated,EpisodeCount,SeasonCount,Path,Genres,Studios,CumulativeRunTimeTicks,Etag"
if include_media:
detailsString += ",MediaStreams"
@@ -151,7 +182,10 @@ def getArt(item, server, widget=False):
'clearart': '',
'discart': '',
'landscape': '',
- 'tvshow.poster': ''
+ 'tvshow.poster': '',
+ 'tvshow.clearart': '',
+ 'tvshow.banner': '',
+ 'tvshow.landscape': ''
}
item_id = item.get("Id")
@@ -164,10 +198,20 @@ def getArt(item, server, widget=False):
else:
art['thumb'] = downloadUtils.getArtwork(item, "Primary", server=server)
+ if item.get("Type") == "Episode" or item.get("Type") == "Season":
+ art['tvshow.poster'] = downloadUtils.getArtwork(item, "Primary", parent=True, server=server)
+ art['tvshow.clearart'] = downloadUtils.getArtwork(item, "Logo", parent=True, server=server)
+ art['tvshow.banner'] = downloadUtils.getArtwork(item, "Banner", parent=True, server=server)
+ art['tvshow.landscape'] = downloadUtils.getArtwork(item, "Thumb", parent=True, server=server)
+ elif item.get("Type") == "Series":
+ art['tvshow.poster'] = downloadUtils.getArtwork(item, "Primary", parent=False, server=server)
+ art['tvshow.clearart'] = downloadUtils.getArtwork(item, "Logo", parent=False, server=server)
+ art['tvshow.banner'] = downloadUtils.getArtwork(item, "Banner", parent=False, server=server)
+ art['tvshow.landscape'] = downloadUtils.getArtwork(item, "Thumb", parent=False, server=server)
+
if item.get("Type") == "Episode":
art['thumb'] = art['thumb'] if art['thumb'] else downloadUtils.getArtwork(item, "Thumb", server=server)
art['landscape'] = art['thumb'] if art['thumb'] else downloadUtils.getArtwork(item, "Thumb", parent=True, server=server)
- art['tvshow.poster'] = downloadUtils.getArtwork(item, "Primary", parent=True, server=server)
else:
art['poster'] = art['thumb']
@@ -189,3 +233,168 @@ def getArt(item, server, widget=False):
art['discart'] = downloadUtils.getArtwork(item, "Disc", server=server)
return art
+
+
+def id_generator(size=6, chars=string.ascii_uppercase + string.digits):
+ return ''.join(random.choice(chars) for _ in range(size))
+
+
+def cache_artwork():
+ log.debug("cache_artwork")
+
+ xbmcplugin.endOfDirectory(int(sys.argv[1]), cacheToDisc=False)
+
+ # is the web server enabled
+ web_query = {"setting": "services.webserver"}
+ result = json_rpc('Settings.GetSettingValue').execute(web_query)
+ xbmc_webserver_enabled = result['result']['value']
+ if not xbmc_webserver_enabled:
+ xbmcgui.Dialog().ok(i18n('notice'), i18n('http_control'))
+ return
+
+ # get the port
+ web_port = {"setting": "services.webserverport"}
+ result = json_rpc('Settings.GetSettingValue').execute(web_port)
+ xbmc_port = result['result']['value']
+ log.debug("xbmc_port: " + str(xbmc_port))
+
+ # get the user
+ web_user = {"setting": "services.webserverusername"}
+ result = json_rpc('Settings.GetSettingValue').execute(web_user)
+ xbmc_username = result['result']['value']
+ log.debug("xbmc_username: " + str(xbmc_username))
+
+ # get the password
+ web_pass = {"setting": "services.webserverpassword"}
+ result = json_rpc('Settings.GetSettingValue').execute(web_pass)
+ xbmc_password = result['result']['value']
+
+ # ask to delete all textures
+ question_result = xbmcgui.Dialog().yesno(i18n('delete'), i18n('delete_existing'))
+ if question_result:
+ pdialog = xbmcgui.DialogProgress()
+ pdialog.create(i18n('deleting_textures'), "")
+ index = 0
+
+ json_result = json_rpc('Textures.GetTextures').execute()
+ textures = json_result.get("result", {}).get("textures", [])
+ log.debug("texture ids: " + str(textures))
+ total = len(textures)
+ for texture in textures:
+ texture_id = texture["textureid"]
+ params = {"textureid": int(texture_id)}
+ json_result = json_rpc('Textures.RemoveTexture').execute(params)
+ percentage = int((float(index) / float(total)) * 100)
+ message = "%s of %s" % (index, total)
+ pdialog.update(percentage, "%s" % (message))
+
+ index += 1
+ if pdialog.iscanceled():
+ break
+
+ del textures
+ del pdialog
+
+ question_result = xbmcgui.Dialog().yesno(i18n('cache_all_textures_title'), i18n('cache_all_textures'))
+ if not question_result:
+ return
+
+ params = {"properties": ["url"]}
+ json_result = json_rpc('Textures.GetTextures').execute(params)
+ textures = json_result.get("result", {}).get("textures", [])
+
+ texture_urls = set()
+ for texture in textures:
+ url = texture.get("url")
+ url = urllib.unquote(url)
+ url = url.replace("image://", "")
+ url = url[0:-1]
+ texture_urls.add(url)
+
+ del textures
+ del json_result
+
+ url = ('{server}/emby/Users/{userid}/Items?' +
+ '&Recursive=true' +
+ '&IncludeItemTypes=Movie,Series,Episode,BoxSet' +
+ '&ImageTypeLimit=1' +
+ '&format=json')
+
+ results = downloadUtils.downloadUrl(url, method="GET")
+ if results is None:
+ results = []
+ else:
+ results = json.loads(results)
+
+ if isinstance(results, dict):
+ results = results.get("Items")
+
+ server = downloadUtils.getServer()
+ missing_texture_urls = set()
+
+ image_types = ["thumb", "poster", "banner", "clearlogo", "tvshow.poster", "tvshow.banner", "tvshow.landscape"]
+ for item in results:
+ art = getArt(item, server)
+ for image_type in image_types:
+ image_url = art[image_type]
+ if image_url not in texture_urls and not image_url.endswith("&Tag=") and len(image_url) > 0:
+ missing_texture_urls.add(image_url)
+
+ log.debug("texture_urls:" + str(texture_urls))
+ log.debug("missing_texture_urls: " + str(missing_texture_urls))
+ log.debug("Number of existing textures: %s" % len(texture_urls))
+ log.debug("Number of missing textures: %s" % len(missing_texture_urls))
+
+ kodi_http_server = "localhost:" + str(xbmc_port)
+ headers = {}
+ if xbmc_password:
+ auth = "%s:%s" % (xbmc_username, xbmc_password)
+ headers = {'Authorization': 'Basic %s' % base64.b64encode(auth)}
+
+ pdialog = xbmcgui.DialogProgress()
+ pdialog.create(i18n('caching_textures'), "")
+ total = len(missing_texture_urls)
+ index = 1
+
+ count_done = 0
+ for get_url in missing_texture_urls:
+ log.debug("texture_url:" + get_url)
+ url = double_urlencode(get_url)
+ kodi_texture_url = ("/image/image://%s" % url)
+ log.debug("kodi_texture_url: " + kodi_texture_url)
+
+ percentage = int((float(index) / float(total)) * 100)
+ message = "%s of %s" % (index, total)
+ pdialog.update(percentage, "%s" % (message))
+
+ conn = httplib.HTTPConnection(kodi_http_server, timeout=20)
+ conn.request(method="GET", url=kodi_texture_url, headers=headers)
+ data = conn.getresponse()
+ if data.status == 200:
+ count_done += 1
+ log.debug("Get Image Result: " + str(data.status))
+
+ index += 1
+ if pdialog.iscanceled():
+ break
+
+ pdialog.close()
+ del pdialog
+
+ report_text = i18n('existing_textures') + str(len(texture_urls)) + "\n"
+ report_text += i18n('missing_textures') + str(len(missing_texture_urls)) + "\n"
+ report_text += i18n('loaded_textures') + str(count_done)
+ xbmcgui.Dialog().ok(i18n('done'), report_text)
+
+
+def double_urlencode(text):
+ text = single_urlencode(text)
+ text = single_urlencode(text)
+ return text
+
+
+def single_urlencode(text):
+ # urlencode needs a utf- string
+ text = urllib.urlencode({'blahblahblah': text.encode('utf-8')})
+ text = text[13:]
+ return text.decode('utf-8') #return the result again as unicode
diff --git a/plugin.video.embycon/resources/lib/widgets.py b/plugin.video.embycon/resources/lib/widgets.py
new file mode 100644
index 0000000..c3098d4
--- /dev/null
+++ b/plugin.video.embycon/resources/lib/widgets.py
@@ -0,0 +1,398 @@
+
+import xbmcaddon
+import xbmcplugin
+import xbmcgui
+import xbmc
+import json
+import urllib
+import hashlib
+
+from downloadutils import DownloadUtils
+from utils import getArt
+from datamanager import DataManager
+from simple_logging import SimpleLogging
+from kodi_utils import HomeWindow
+
+log = SimpleLogging(__name__)
+downloadUtils = DownloadUtils()
+dataManager = DataManager()
+kodi_version = int(xbmc.getInfoLabel('System.BuildVersion')[:2])
+
+def checkForNewContent():
+ log.debug("checkForNewContent Called")
+
+ added_url = ('{server}/emby/Users/{userid}/Items' +
+ '?Recursive=true' +
+ '&limit=1' +
+ '&Fields=DateCreated,Etag' +
+ '&SortBy=DateCreated' +
+ '&SortOrder=Descending' +
+ '&IncludeItemTypes=Movie,Episode' +
+ '&ImageTypeLimit=0' +
+ '&format=json')
+
+ added_result = downloadUtils.downloadUrl(added_url, suppress=True)
+ result = json.loads(added_result)
+ log.debug("LATEST_ADDED_ITEM:" + str(result))
+
+ last_added_date = ""
+ if result is not None:
+ items = result.get("Items", [])
+ if len(items) > 0:
+ item = items[0]
+ last_added_date = item.get("Etag", "")
+ log.debug("last_added_date: " + last_added_date)
+
+ played_url = ('{server}/emby/Users/{userid}/Items' +
+ '?Recursive=true' +
+ '&limit=1' +
+ '&Fields=DateCreated,Etag' +
+ '&SortBy=DatePlayed' +
+ '&SortOrder=Descending' +
+ '&IncludeItemTypes=Movie,Episode' +
+ '&ImageTypeLimit=0' +
+ '&format=json')
+
+ played_result = downloadUtils.downloadUrl(played_url, suppress=True)
+ result = json.loads(played_result)
+ log.debug("LATEST_PLAYED_ITEM:" + str(result))
+
+ last_played_date = ""
+ if result is not None:
+ items = result.get("Items", [])
+ if len(items) > 0:
+ item = items[0]
+ last_played_date = item.get("Etag", "")
+ log.debug("last_played_date: " + last_played_date)
+
+ home_window = HomeWindow()
+ current_widget_hash = home_window.getProperty("embycon_widget_reload")
+ log.debug("Current Widget Hash: " + str(current_widget_hash))
+
+ m = hashlib.md5()
+ m.update(last_played_date + last_added_date)
+ new_widget_hash = m.hexdigest()
+ log.debug("New Widget Hash: " + str(new_widget_hash))
+
+ if current_widget_hash != new_widget_hash:
+ home_window.setProperty("embycon_widget_reload", new_widget_hash)
+ log.debug("Setting New Widget Hash: " + str(new_widget_hash))
+
+
+def getWidgetUrlContent(handle, params):
+ log.debug("getWidgetUrlContent Called" + str(params))
+
+ request = params["url"]
+ request = urllib.unquote(request)
+ request = "{server}/emby/" + request + "&ImageTypeLimit=1&format=json"
+ log.debug("getWidgetUrlContent URL:" + request)
+
+ select_action = params.get("action", None)
+
+ listItems = populateWidgetItems(request, override_select_action=select_action)
+
+ xbmcplugin.addDirectoryItems(handle, listItems)
+ xbmcplugin.endOfDirectory(handle, cacheToDisc=False)
+
+
+def getSuggestions(handle, params):
+ log.debug("getSuggestions Called" + str(params))
+
+ itemsUrl = ("{server}/emby/Movies/Recommendations" +
+ "?userId={userid}" +
+ "&categoryLimit=1" +
+ "&ItemLimit=8" +
+ "&format=json" +
+ "&ImageTypeLimit=1" +
+ "&IsMissing=False")
+
+ listItems = populateWidgetItems(itemsUrl)
+
+ xbmcplugin.addDirectoryItems(handle, listItems)
+ xbmcplugin.endOfDirectory(handle, cacheToDisc=False)
+
+def getWidgetContentNextUp(handle, params):
+ log.debug("getWidgetContentNextUp Called" + str(params))
+
+ itemsUrl = ("{server}/emby/Shows/NextUp?SeriesId=" + params["id"] +
+ "&userId={userid}" +
+ "&Limit={ItemLimit}" +
+ "&format=json" +
+ "&ImageTypeLimit=1" +
+ "&IsMissing=False")
+
+ listItems = populateWidgetItems(itemsUrl)
+
+ xbmcplugin.addDirectoryItems(handle, listItems)
+ xbmcplugin.endOfDirectory(handle, cacheToDisc=False)
+
+
+def getWidgetContentSimilar(handle, params):
+ log.debug("getWisgetContentSimilarMovies Called" + str(params))
+
+ itemsUrl = ("{server}/emby/Items/" + params["id"] + "/Similar"
+ "?userId={userid}" +
+ "&Limit={ItemLimit}" +
+ "&format=json" +
+ "&ImageTypeLimit=1" +
+ "&IsMissing=False" +
+ "&fields=PrimaryImageAspectRatio,UserData,CanDelete")
+
+ listItems = populateWidgetItems(itemsUrl)
+
+ xbmcplugin.addDirectoryItems(handle, listItems)
+ xbmcplugin.endOfDirectory(handle, cacheToDisc=False)
+
+
+def getWidgetContentCast(handle, params):
+ log.debug("getWigetContentCast Called" + str(params))
+ server = downloadUtils.getServer()
+
+ id = params["id"]
+ jsonData = downloadUtils.downloadUrl("{server}/emby/Users/{userid}/Items/" + id + "?format=json",
+ suppress=False, popup=1)
+ result = json.loads(jsonData)
+ log.debug("ItemInfo: " + str(result))
+
+ listItems = []
+ people = result.get("People")
+ if (people != None):
+ for person in people:
+ #if (person.get("Type") == "Director"):
+ # director = director + person.get("Name") + ' '
+ #if (person.get("Type") == "Writing"):
+ # writer = person.get("Name")
+ #if (person.get("Type") == "Writer"):
+ # writer = person.get("Name")
+ if (person.get("Type") == "Actor"):
+ person_name = person.get("Name")
+ person_role = person.get("Role")
+ person_id = person.get("Id")
+ person_tag = person.get("PrimaryImageTag")
+ person_thumbnail = downloadUtils.imageUrl(person_id, "Primary", 0, 400, 400, person_tag, server=server)
+
+ if kodi_version > 17:
+ list_item = xbmcgui.ListItem(label=person_name, iconImage=person_thumbnail, offscreen=True)
+ else:
+ list_item = xbmcgui.ListItem(label=person_name, iconImage=person_thumbnail)
+
+ artLinks = {}
+ artLinks["thumb"] = person_thumbnail
+ artLinks["poster"] = person_thumbnail
+ list_item.setArt(artLinks)
+
+ if person_role:
+ list_item.setLabel2(person_role)
+
+ itemTupple = ("", list_item, False)
+ listItems.append(itemTupple)
+
+ xbmcplugin.addDirectoryItems(handle, listItems)
+ xbmcplugin.endOfDirectory(handle, cacheToDisc=False)
+
+
+def populateWidgetItems(itemsUrl, override_select_action=None):
+
+ server = downloadUtils.getServer()
+ settings = xbmcaddon.Addon(id='plugin.video.embycon')
+ select_action = settings.getSetting("widget_select_action")
+
+ if override_select_action is not None:
+ select_action = str(override_select_action)
+
+ log.debug("WIDGET_DATE_URL: " + itemsUrl)
+
+ # get the items
+ jsonData = downloadUtils.downloadUrl(itemsUrl, suppress=False, popup=1)
+ log.debug("Widget(Items) jsonData: " + jsonData)
+ result = json.loads(jsonData)
+
+ if result is not None and isinstance(result, dict) and result.get("Items") is not None:
+ simmilarTo = result.get("BaselineItemName", None)
+ result = result.get("Items")
+ elif result is not None and isinstance(result, list) and len(result) > 0:
+ simmilarTo = result[0].get("BaselineItemName", None)
+ result = result[0].get("Items")
+ else:
+ result = []
+
+ itemCount = 1
+ listItems = []
+ for item in result:
+ item_id = item.get("Id")
+ name = item.get("Name")
+ episodeDetails = ""
+ log.debug("WIDGET_DATE_NAME: " + name)
+
+ title = item.get("Name")
+ tvshowtitle = ""
+
+ if (item.get("Type") == "Episode" and item.get("SeriesName") != None):
+
+ eppNumber = "X"
+ tempEpisodeNumber = "0"
+ if (item.get("IndexNumber") != None):
+ eppNumber = item.get("IndexNumber")
+ if eppNumber < 10:
+ tempEpisodeNumber = "0" + str(eppNumber)
+ else:
+ tempEpisodeNumber = str(eppNumber)
+
+ seasonNumber = item.get("ParentIndexNumber")
+ if seasonNumber < 10:
+ tempSeasonNumber = "0" + str(seasonNumber)
+ else:
+ tempSeasonNumber = str(seasonNumber)
+
+ episodeDetails = "S" + tempSeasonNumber + "E" + tempEpisodeNumber
+ name = item.get("SeriesName") + " " + episodeDetails
+ tvshowtitle = episodeDetails
+ title = item.get("SeriesName")
+
+ art = getArt(item, server, widget=True)
+
+ if kodi_version > 17:
+ list_item = xbmcgui.ListItem(label=name, iconImage=art['thumb'], offscreen=True)
+ else:
+ list_item = xbmcgui.ListItem(label=name, iconImage=art['thumb'])
+
+ # list_item.setLabel2(episodeDetails)
+
+ production_year = item.get("ProductionYear")
+ if not production_year and item.get("PremiereDate"):
+ production_year = int(item.get("PremiereDate")[:4])
+
+ overlay = "0"
+ playCount = "0"
+
+ # add progress percent
+ userData = item.get("UserData")
+ if (userData != None):
+ if userData.get("Played") == True:
+ playCount = "1"
+ overlay = "5"
+ else:
+ overlay = "6"
+
+ playBackTicks = float(userData.get("PlaybackPositionTicks"))
+ if (playBackTicks != None and playBackTicks > 0):
+ runTimeTicks = float(item.get("RunTimeTicks", "0"))
+ if (runTimeTicks > 0):
+ playBackPos = int(((playBackTicks / 1000) / 10000) / 60)
+ list_item.setProperty('ResumeTime', str(playBackPos))
+
+ percentage = int((playBackTicks / runTimeTicks) * 100.0)
+ list_item.setProperty("complete_percentage", str(percentage))
+
+ video_info_label = {"title": title,
+ "tvshowtitle": tvshowtitle,
+ "year": production_year,
+ "Overlay": overlay,
+ "playcount": playCount}
+
+ list_item.setInfo(type="Video", infoLabels=video_info_label)
+ list_item.setProperty('fanart_image', art['fanart']) # back compat
+ list_item.setProperty('discart', art['discart']) # not avail to setArt
+ list_item.setArt(art)
+ # add count
+ list_item.setProperty("item_index", str(itemCount))
+ itemCount = itemCount + 1
+
+ list_item.setProperty('IsPlayable', 'true')
+
+ totalTime = str(int(float(item.get("RunTimeTicks", "0")) / (10000000 * 60)))
+ list_item.setProperty('TotalTime', str(totalTime))
+
+ list_item.setProperty('id', item_id)
+
+ if simmilarTo is not None:
+ list_item.setProperty('suggested_from_watching', simmilarTo)
+
+ if select_action == "1":
+ playurl = "plugin://plugin.video.embycon/?item_id=" + item_id + '&mode=PLAY'
+ elif select_action == "0":
+ playurl = "plugin://plugin.video.embycon/?item_id=" + item_id + '&mode=SHOW_MENU'
+
+ itemTupple = (playurl, list_item, False)
+ listItems.append(itemTupple)
+
+ return listItems
+
+
+def getWidgetContent(handle, params):
+ log.debug("getWigetContent Called" + str(params))
+
+ type = params.get("type")
+ if (type == None):
+ log.error("getWigetContent type not set")
+ return
+
+ itemsUrl = ("{server}/emby/Users/{userid}/Items" +
+ "?Limit={ItemLimit}" +
+ "&format=json" +
+ "&ImageTypeLimit=1" +
+ "&IsMissing=False")
+
+ if (type == "recent_movies"):
+ xbmcplugin.setContent(handle, 'movies')
+ itemsUrl += ("&Recursive=true" +
+ "&SortBy=DateCreated" +
+ "&SortOrder=Descending" +
+ "&Filters={IsUnplayed,}IsNotFolder" +
+ "&IsVirtualUnaired=false" +
+ "&IsMissing=False" +
+ "&IncludeItemTypes=Movie")
+ elif (type == "inprogress_movies"):
+ xbmcplugin.setContent(handle, 'movies')
+ itemsUrl += ("&Recursive=true" +
+ "&SortBy=DatePlayed" +
+ "&SortOrder=Descending" +
+ "&Filters=IsResumable" +
+ "&IsVirtualUnaired=false" +
+ "&IsMissing=False" +
+ "&IncludeItemTypes=Movie")
+ elif (type == "random_movies"):
+ xbmcplugin.setContent(handle, 'movies')
+ watched = params.get("watched", "") == "true"
+ if watched:
+ itemsUrl += "&Filters=IsPlayed,IsNotFolder"
+ else:
+ itemsUrl += "&Filters={IsUnplayed,}IsNotFolder"
+ itemsUrl += ("&Recursive=true" +
+ "&SortBy=Random" +
+ "&SortOrder=Descending" +
+ "&IsVirtualUnaired=false" +
+ "&IsMissing=False" +
+ "&IncludeItemTypes=Movie")
+ elif (type == "recent_episodes"):
+ xbmcplugin.setContent(handle, 'episodes')
+ itemsUrl += ("&Recursive=true" +
+ "&SortBy=DateCreated" +
+ "&SortOrder=Descending" +
+ "&Filters={IsUnplayed,}IsNotFolder" +
+ "&IsVirtualUnaired=false" +
+ "&IsMissing=False" +
+ "&IncludeItemTypes=Episode")
+ elif (type == "inprogress_episodes"):
+ xbmcplugin.setContent(handle, 'episodes')
+ itemsUrl += ("&Recursive=true" +
+ "&SortBy=DatePlayed" +
+ "&SortOrder=Descending" +
+ "&Filters=IsResumable" +
+ "&IsVirtualUnaired=false" +
+ "&IsMissing=False" +
+ "&IncludeItemTypes=Episode")
+ elif (type == "nextup_episodes"):
+ xbmcplugin.setContent(handle, 'episodes')
+ itemsUrl = ("{server}/emby/Shows/NextUp" +
+ "?Limit={ItemLimit}"
+ "&userid={userid}" +
+ "&Recursive=true" +
+ "&format=json" +
+ "&ImageTypeLimit=1")
+
+ listItems = populateWidgetItems(itemsUrl)
+
+ xbmcplugin.addDirectoryItems(handle, listItems)
+ xbmcplugin.endOfDirectory(handle, cacheToDisc=False)
+
diff --git a/plugin.video.embycon/resources/settings.xml b/plugin.video.embycon/resources/settings.xml
index 4bb7a5a..301caf6 100644
--- a/plugin.video.embycon/resources/settings.xml
+++ b/plugin.video.embycon/resources/settings.xml
@@ -13,7 +13,7 @@
<setting id="deviceName" type="text" label="30016" default="EmbyCon" visible="true" enable="true" />
</category>
<category label="30207">
- <setting id="playback_type" type="enum" label="30206" lvalues="30209|30210|30211" default="1" />
+ <setting id="playback_type" type="select" label="30206" lvalues="30209|30210|30211" default="1" />
<setting label="30209" type="lsep"/>
<setting type="sep" />
<setting id="smbusername" type="text" label="30007" default="" enable="true" visible="true"/>
@@ -21,13 +21,17 @@
<setting label="30211" type="lsep"/>
<setting type="sep" />
<setting id="playback_bitrate" type="slider" label="30208" default="6000" range="400,100,10000" option="int" visible="true"/>
- <setting id="playback_max_width" type="enum" label="30212" lvalues="640x|720x|1024x|1280x|1440x|1600x|1920x|2600x|4096x" default="6" visible="true"/>
+ <setting id="playback_max_width" type="select" label="30212" values="640|720|1024|1280|1440|1600|1920|2600|4096" default="1920" visible="true"/>
<setting id="playback_video_force_8" type="bool" label="30213" default="false" visible="true" enable="true"/>
+ <setting label="30238" type="lsep"/>
+ <setting type="sep" />
+ <setting id="h265_action" type="select" label="30236" lvalues="30129|30210|30211" default="0" />
</category>
<category label="30214">
<setting label="30215" type="lsep"/>
<setting type="sep" />
<setting id="promptPlayNextEpisodePercentage" type="slider" label="30218" default="100" range="5,1,100" option="int" visible="true"/>
+ <setting id="promptPlayNextEpisodePercentage_prompt" type="bool" label="30219" default="true" visible="true" enable="true" />
<setting id="promptDeleteEpisodePercentage" type="slider" label="30217" default="100" range="5,1,100" option="int" visible="true"/>
<setting id="promptDeleteMoviePercentage" type="slider" label="30220" default="100" range="5,1,100" option="int" visible="true"/>
<setting label="30121" type="lsep"/>
@@ -46,6 +50,8 @@
<setting id="include_people" type="bool" label="30183" default="false" visible="true" enable="true" />
<setting id="flatten_single_season" type="bool" label="30020" default="true" visible="true" enable="true" />
<setting id="show_x_filtered_items" type="slider" label="30018" default="20" range="5,1,100" option="int" visible="true"/>
+ <setting id="show_latest_unplayed" type="bool" label="30027" default="false" visible="true" enable="true" />
+ <setting id="widget_select_action" type="enum" label="30026" lvalues="menu|play" default="0" visible="true"/>
<setting id="episode_name_format" type="text" default="{SeriesName} - s{SeasonIndex}e{EpisodeIndex} - {ItemName}" label="30019" />
</category>
<category label="30022"> <!-- Advanced -->
diff --git a/plugin.video.embycon/resources/skins/default/720p/ActionMenu.xml b/plugin.video.embycon/resources/skins/default/720p/ActionMenu.xml
new file mode 100644
index 0000000..11daa26
--- /dev/null
+++ b/plugin.video.embycon/resources/skins/default/720p/ActionMenu.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<window id="3301" type="dialog">
+ <defaultcontrol always="true">3000</defaultcontrol>
+ <zorder>2</zorder>
+ <coordinates>
+ <system>1</system>
+ <left>450</left>
+ <top>200</top>
+ </coordinates>
+ <controls>
+
+ <control type="image" id="3010">
+ <left>0</left>
+ <top>0</top>
+ <width>380</width>
+ <height>300</height>
+ <texture border="40">bg.png</texture>
+ </control>
+
+ <control type="list" id="3000">
+ <left>10</left>
+ <top>10</top>
+ <width>360</width>
+ <!--<height>400</height>-->
+ <height max="780">auto</height>
+ <itemlayout width="360" height="50">
+ <control type="image">
+ <left>0</left>
+ <top>0</top>
+ <width>360</width>
+ <height>45</height>
+ <texture border="1" colordiffuse="ff161616">white.png</texture>
+ </control>
+ <control type="textbox">
+ <width>360</width>
+ <left>0</left>
+ <top>5</top>
+ <height>45</height>
+ <label>$INFO[ListItem.Label]</label>
+ <textcolor>99FFFFFF</textcolor>
+ <font>font14</font>
+ <align>center</align>
+ </control>
+ </itemlayout>
+ <focusedlayout width="360" height="50">
+ <control type="image">
+ <left>0</left>
+ <top>0</top>
+ <width>360</width>
+ <height>45</height>
+ <texture border="1" colordiffuse="ff525252">white.png</texture>
+ </control>
+ <control type="textbox">
+ <width>360</width>
+ <left>0</left>
+ <top>5</top>
+ <height>45</height>
+ <label>$INFO[ListItem.Label]</label>
+ <textcolor>FFFFFFFF</textcolor>
+ <font>font14</font>
+ <align>center</align>
+ </control>
+ </focusedlayout>
+ </control>
+
+ </controls>
+</window> \ No newline at end of file
diff --git a/plugin.video.embycon/resources/skins/default/720p/ResumeDialog.xml b/plugin.video.embycon/resources/skins/default/720p/ResumeDialog.xml
index 9ff6bad..9f1116a 100644
--- a/plugin.video.embycon/resources/skins/default/720p/ResumeDialog.xml
+++ b/plugin.video.embycon/resources/skins/default/720p/ResumeDialog.xml
@@ -7,7 +7,6 @@
<left>450</left>
<top>280</top>
</coordinates>
- <include>dialogeffect</include>
<controls>
<control type="image">
diff --git a/plugin.video.embycon/resources/skins/skin.estuary/xml/Home-17.1.xml b/plugin.video.embycon/resources/skins/skin.estuary/xml/Home-17.1.xml
index ef46639..cb9b540 100644
--- a/plugin.video.embycon/resources/skins/skin.estuary/xml/Home-17.1.xml
+++ b/plugin.video.embycon/resources/skins/skin.estuary/xml/Home-17.1.xml
@@ -52,19 +52,19 @@
<control type="grouplist" id="3001">
<include>WidgetGroupListCommon</include>
<include content="WidgetListPoster" condition="true">
- <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&type=recent_movies"/>
+ <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&amp;type=recent_movies&amp;reload=$INFO[Window(Home).Property(plugin.video.embycon-embycon_widget_reload)]"/>
<param name="widget_header" value="Recently Added"/>
<param name="widget_target" value="videos"/>
<param name="list_id" value="3800"/>
</include>
<include content="WidgetListPoster" condition="true">
- <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&type=inprogress_movies"/>
+ <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&amp;type=inprogress_movies&amp;reload=$INFO[Window(Home).Property(plugin.video.embycon-embycon_widget_reload)]"/>
<param name="widget_header" value="In Progress"/>
<param name="widget_target" value="videos"/>
<param name="list_id" value="3900"/>
</include>
<include content="WidgetListPoster" condition="true">
- <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&type=random_movies"/>
+ <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&amp;type=random_movies&amp;reload=$INFO[Window(Home).Property(plugin.video.embycon-embycon_widget_reload)]"/>
<param name="widget_header" value="Random"/>
<param name="widget_target" value="videos"/>
<param name="list_id" value="3100"/>
@@ -79,19 +79,19 @@
<control type="grouplist" id="4001">
<include>WidgetGroupListCommon</include>
<include content="WidgetListEpisodes" condition="true">
- <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&type=recent_episodes"/>
+ <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&amp;type=recent_episodes&amp;reload=$INFO[Window(Home).Property(plugin.video.embycon-embycon_widget_reload)]"/>
<param name="widget_header" value="Recently Added"/>
<param name="widget_target" value="videos"/>
<param name="list_id" value="4900"/>
</include>
<include content="WidgetListEpisodes" condition="true">
- <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&type=inprogress_episodes"/>
+ <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&amp;type=inprogress_episodes&amp;reload=$INFO[Window(Home).Property(plugin.video.embycon-embycon_widget_reload)]"/>
<param name="widget_header" value="In Progress"/>
<param name="widget_target" value="videos"/>
<param name="list_id" value="4100"/>
</include>
<include content="WidgetListEpisodes" condition="true">
- <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&type=nextup_episodes"/>
+ <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&amp;type=nextup_episodes&amp;reload=$INFO[Window(Home).Property(plugin.video.embycon-embycon_widget_reload)]"/>
<param name="widget_header" value="Next Up"/>
<param name="widget_target" value="videos"/>
<param name="list_id" value="4200"/>
diff --git a/plugin.video.embycon/resources/skins/skin.estuary/xml/Home-17.3-elec.xml b/plugin.video.embycon/resources/skins/skin.estuary/xml/Home-17.3-elec.xml
new file mode 100644
index 0000000..cb996ed
--- /dev/null
+++ b/plugin.video.embycon/resources/skins/skin.estuary/xml/Home-17.3-elec.xml
@@ -0,0 +1,1064 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<window>
+ <onunload>ClearProperty(first_load_done, 10000)</onunload>
+ <defaultcontrol>9000</defaultcontrol>
+ <backgroundcolor>background</backgroundcolor>
+ <controls>
+ <control type="button" id="20000">
+ <include>HiddenObject</include>
+ <animation effect="fade" time="300" start="100" end="0">Focus</animation>
+ <onfocus>SetFocus(2000)</onfocus>
+ <onclick>noop</onclick>
+ <visible allowhiddenfocus="true">Control.HasFocus(20000)</visible>
+ </control>
+ <control type="button" id="20001">
+ <include>HiddenObject</include>
+ <animation effect="fade" time="300" start="100" end="0">Focus</animation>
+ <onfocus>SetFocus(2000)</onfocus>
+ <onclick>noop</onclick>
+ <visible allowhiddenfocus="true">Control.HasFocus(20001)</visible>
+ </control>
+ <include>DefaultBackground</include>
+ <control type="multiimage">
+ <depth>DepthBackground</depth>
+ <include>FullScreenDimensions</include>
+ <aspectratio>scale</aspectratio>
+ <fadetime>600</fadetime>
+ <animation effect="zoom" center="auto" end="102,102" time="0" condition="Integer.IsGreater(System.StereoscopicMode,0)">conditional</animation>
+ <animation effect="fade" start="0" end="100" time="400">WindowOpen</animation>
+ <animation effect="fade" start="100" end="0" time="300">WindowClose</animation>
+ <animation effect="fade" time="400">VisibleChange</animation>
+ <imagepath background="true" colordiffuse="bg_overlay">$VAR[HomeFanartVar]</imagepath>
+ <visible>!Player.HasMedia</visible>
+ </control>
+ <control type="group">
+ <animation effect="fade" start="100" end="0" time="200" tween="sine" condition="$EXP[infodialog_active]">Conditional</animation>
+ <control type="group" id="2000">
+ <left>462</left>
+ <animation type="Conditional" condition="Control.IsVisible(20000)" reversible="false">
+ <effect type="slide" end="0,20" time="60" tween="sine" />
+ <effect type="slide" end="0,-20" time="180" tween="sine" delay="80" />
+ </animation>
+ <animation type="Conditional" condition="Control.IsVisible(20001)" reversible="false">
+ <effect type="slide" end="0,-20" time="60" tween="sine" />
+ <effect type="slide" end="0,20" time="180" tween="sine" delay="80" />
+ </animation>
+ <include>OpenClose_Right</include>
+ <!-- Start of Emby Widget Items -->
+ <control type="group" id="3000">
+ <visible>String.IsEqual(Container(9000).ListItem.Property(id),emby_movies)</visible>
+ <include content="Visible_Right_Delayed">
+ <param name="id" value="emby_movies"/>
+ </include>
+ <control type="grouplist" id="3001">
+ <include>WidgetGroupListCommon</include>
+ <include content="WidgetListPoster" condition="true">
+ <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&amp;type=recent_movies&amp;reload=$INFO[Window(Home).Property(plugin.video.embycon-embycon_widget_reload)]"/>
+ <param name="widget_header" value="Recently Added"/>
+ <param name="widget_target" value="videos"/>
+ <param name="list_id" value="3800"/>
+ </include>
+ <include content="WidgetListPoster" condition="true">
+ <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&amp;type=inprogress_movies&amp;reload=$INFO[Window(Home).Property(plugin.video.embycon-embycon_widget_reload)]"/>
+ <param name="widget_header" value="In Progress"/>
+ <param name="widget_target" value="videos"/>
+ <param name="list_id" value="3900"/>
+ </include>
+ <include content="WidgetListPoster" condition="true">
+ <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&amp;type=random_movies&amp;reload=$INFO[Window(Home).Property(plugin.video.embycon-embycon_widget_reload)]"/>
+ <param name="widget_header" value="Random"/>
+ <param name="widget_target" value="videos"/>
+ <param name="list_id" value="3100"/>
+ </include>
+ </control>
+ </control>
+ <control type="group" id="4000">
+ <visible>String.IsEqual(Container(9000).ListItem.Property(id),emby_tvshows)</visible>
+ <include content="Visible_Right_Delayed">
+ <param name="id" value="emby_tvshows"/>
+ </include>
+ <control type="grouplist" id="4001">
+ <include>WidgetGroupListCommon</include>
+ <include content="WidgetListEpisodes" condition="true">
+ <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&amp;type=recent_episodes&amp;reload=$INFO[Window(Home).Property(plugin.video.embycon-embycon_widget_reload)]"/>
+ <param name="widget_header" value="Recently Added"/>
+ <param name="widget_target" value="videos"/>
+ <param name="list_id" value="4900"/>
+ </include>
+ <include content="WidgetListEpisodes" condition="true">
+ <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&amp;type=inprogress_episodes&amp;reload=$INFO[Window(Home).Property(plugin.video.embycon-embycon_widget_reload)]"/>
+ <param name="widget_header" value="In Progress"/>
+ <param name="widget_target" value="videos"/>
+ <param name="list_id" value="4100"/>
+ </include>
+ <include content="WidgetListEpisodes" condition="true">
+ <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&amp;type=nextup_episodes&amp;reload=$INFO[Window(Home).Property(plugin.video.embycon-embycon_widget_reload)]"/>
+ <param name="widget_header" value="Next Up"/>
+ <param name="widget_target" value="videos"/>
+ <param name="list_id" value="4200"/>
+ </include>
+ </control>
+ </control>
+ <!-- End of Emby Widget Items -->
+ <control type="group" id="5000">
+ <visible>String.IsEqual(Container(9000).ListItem.Property(id),movies)</visible>
+ <include content="Visible_Right_Delayed">
+ <param name="id" value="movies"/>
+ </include>
+ <control type="grouplist" id="5001">
+ <include>WidgetGroupListCommon</include>
+ <include content="WidgetListCategories" condition="Library.HasContent(movies)">
+ <param name="content_path" value="library://video/movies/"/>
+ <param name="widget_header" value="$LOCALIZE[31148]"/>
+ <param name="widget_target" value="videos"/>
+ <param name="list_id" value="5900"/>
+ </include>
+ <include content="WidgetListPoster" condition="Library.HasContent(movies)">
+ <param name="content_path" value="special://skin/playlists/inprogress_movies.xsp"/>
+ <param name="widget_header" value="$LOCALIZE[31010]"/>
+ <param name="widget_target" value="videos"/>
+ <param name="list_id" value="5100"/>
+ </include>
+ <include content="WidgetListPoster" condition="Library.HasContent(movies)">
+ <param name="content_path" value="special://skin/playlists/recent_unwatched_movies.xsp"/>
+ <param name="widget_header" value="$LOCALIZE[20386]"/>
+ <param name="widget_target" value="videos"/>
+ <param name="list_id" value="5200"/>
+ </include>
+ <include content="WidgetListPoster" condition="Library.HasContent(movies)">
+ <param name="content_path" value="special://skin/playlists/unwatched_movies.xsp"/>
+ <param name="widget_header" value="$LOCALIZE[31007]"/>
+ <param name="widget_target" value="videos"/>
+ <param name="list_id" value="5300"/>
+ </include>
+ <include content="WidgetListPoster" condition="Library.HasContent(movies)">
+ <param name="content_path" value="special://skin/playlists/random_movies.xsp"/>
+ <param name="widget_header" value="$LOCALIZE[31006]"/>
+ <param name="widget_target" value="videos"/>
+ <param name="list_id" value="5400"/>
+ </include>
+ <include content="WidgetListCategories" condition="Library.HasContent(movies)">
+ <param name="content_path" value="videodb://movies/genres/"/>
+ <param name="widget_header" value="$LOCALIZE[135]"/>
+ <param name="widget_target" value="videos"/>
+ <param name="list_id" value="5500"/>
+ <param name="icon" value="$VAR[WidgetGenreIconVar]"/>
+ <param name="icon_height" value="70"/>
+ </include>
+ <include content="WidgetListPoster" condition="Library.HasContent(movies)">
+ <param name="content_path" value="videodb://movies/sets/"/>
+ <param name="widget_header" value="$LOCALIZE[31075]"/>
+ <param name="widget_target" value="videos"/>
+ <param name="sortby" value="random"/>
+ <param name="list_id" value="5600"/>
+ </include>
+ </control>
+ <include content="ImageWidget" condition="!Library.HasContent(movies)">
+ <param name="text_label" value="$LOCALIZE[31104]" />
+ <param name="button_label" value="$LOCALIZE[31110]" />
+ <param name="button_onclick" value="ActivateWindow(videos,files,return)"/>
+ <param name="button_id" value="5500"/>
+ <param name="button2_onclick" value="Skin.SetBool(HomeMenuNoMovieButton)"/>
+ </include>
+ </control>
+ <control type="group" id="6000">
+ <visible>String.IsEqual(Container(9000).ListItem.Property(id),tvshows)</visible>
+ <include content="Visible_Right_Delayed">
+ <param name="id" value="tvshows"/>
+ </include>
+ <control type="grouplist" id="6001">
+ <include>WidgetGroupListCommon</include>
+ <include content="WidgetListCategories" condition="Library.HasContent(tvshows)">
+ <param name="content_path" value="library://video/tvshows/"/>
+ <param name="widget_header" value="$LOCALIZE[31148]"/>
+ <param name="widget_target" value="videos"/>
+ <param name="list_id" value="6900"/>
+ </include>
+ <include content="WidgetListPoster" condition="Library.HasContent(tvshows)">
+ <param name="content_path" value="videodb://inprogresstvshows"/>
+ <param name="sortby" value="lastplayed"/>
+ <param name="sortorder" value="descending"/>
+ <param name="widget_header" value="$LOCALIZE[626]"/>
+ <param name="widget_target" value="videos"/>
+ <param name="list_id" value="6100"/>
+ </include>
+ <include content="WidgetListEpisodes" condition="Library.HasContent(tvshows)">
+ <param name="content_path" value="special://skin/playlists/recent_unwatched_episodes.xsp"/>
+ <param name="widget_header" value="$LOCALIZE[20387]"/>
+ <param name="widget_target" value="videos"/>
+ <param name="list_id" value="6200"/>
+ </include>
+ <include content="WidgetListPoster" condition="Library.HasContent(tvshows)">
+ <param name="content_path" value="special://skin/playlists/unwatched_tvshows.xsp"/>
+ <param name="widget_header" value="$LOCALIZE[31122]"/>
+ <param name="widget_target" value="videos"/>
+ <param name="list_id" value="6300"/>
+ </include>
+ <include content="WidgetListCategories" condition="Library.HasContent(tvshows)">
+ <param name="content_path" value="videodb://tvshows/genres/"/>
+ <param name="widget_header" value="$LOCALIZE[135]"/>
+ <param name="widget_target" value="videos"/>
+ <param name="list_id" value="6400"/>
+ <param name="icon" value="$VAR[WidgetGenreIconVar]"/>
+ <param name="icon_height" value="70"/>
+ </include>
+ <include content="WidgetListCategories" condition="Library.HasContent(tvshows)">
+ <param name="content_path" value="videodb://tvshows/studios/"/>
+ <param name="widget_header" value="$LOCALIZE[20388]"/>
+ <param name="widget_target" value="videos"/>
+ <param name="list_id" value="6500"/>
+ <param name="icon" value="$VAR[WidgetStudioIconVar]"/>
+ <param name="icon_height" value="70"/>
+ </include>
+ </control>
+ <include content="ImageWidget" condition="!Library.HasContent(tvshows)">
+ <param name="text_label" value="$LOCALIZE[31104]" />
+ <param name="button_label" value="$LOCALIZE[31110]" />
+ <param name="button_onclick" value="ActivateWindow(videos,files,return)"/>
+ <param name="button_id" value="6400"/>
+ <param name="button2_onclick" value="Skin.SetBool(HomeMenuNoTVShowButton)"/>
+ </include>
+ </control>
+ <control type="group" id="7000">
+ <visible>String.IsEqual(Container(9000).ListItem.Property(id),music)</visible>
+ <include content="Visible_Right_Delayed">
+ <param name="id" value="music"/>
+ </include>
+ <control type="grouplist" id="7001">
+ <include>WidgetGroupListCommon</include>
+ <include content="WidgetListCategories" condition="Library.HasContent(music)">
+ <param name="content_path" value="library://music/"/>
+ <param name="widget_header" value="$LOCALIZE[31148]"/>
+ <param name="widget_target" value="music"/>
+ <param name="list_id" value="7900"/>
+ </include>
+ <include content="WidgetListSquare" condition="Library.HasContent(music)">
+ <param name="content_path" value="musicdb://recentlyplayedalbums"/>
+ <param name="widget_header" value="$LOCALIZE[517]"/>
+ <param name="widget_target" value="music"/>
+ <param name="list_id" value="7100"/>
+ <param name="fallback_icon" value="DefaultMusicAlbums.png"/>
+ </include>
+ <include content="WidgetListSquare" condition="Library.HasContent(music)">
+ <param name="content_path" value="musicdb://recentlyaddedalbums/"/>
+ <param name="widget_header" value="$LOCALIZE[359]"/>
+ <param name="widget_target" value="music"/>
+ <param name="list_id" value="7200"/>
+ <param name="fallback_icon" value="DefaultMusicAlbums.png"/>
+ </include>
+ <include content="WidgetListSquare" condition="Library.HasContent(music)">
+ <param name="content_path" value="special://skin/playlists/random_albums.xsp"/>
+ <param name="widget_header" value="$LOCALIZE[31012]"/>
+ <param name="widget_target" value="music"/>
+ <param name="list_id" value="7300"/>
+ <param name="fallback_icon" value="DefaultMusicAlbums.png"/>
+ </include>
+ <include content="WidgetListSquare" condition="Library.HasContent(music)">
+ <param name="content_path" value="special://skin/playlists/random_artists.xsp"/>
+ <param name="widget_header" value="$LOCALIZE[31013]"/>
+ <param name="widget_target" value="music"/>
+ <param name="list_id" value="7400"/>
+ <param name="fallback_icon" value="DefaultMusicArtists.png"/>
+ </include>
+ <include content="WidgetListSquare" condition="Library.HasContent(music)">
+ <param name="content_path" value="special://skin/playlists/unplayed_albums.xsp"/>
+ <param name="widget_header" value="$LOCALIZE[31014]"/>
+ <param name="widget_target" value="music"/>
+ <param name="list_id" value="7500"/>
+ <param name="fallback_icon" value="DefaultMusicAlbums.png"/>
+ </include>
+ <include content="WidgetListSquare" condition="Library.HasContent(music)">
+ <param name="content_path" value="special://skin/playlists/mostplayed_albums.xsp"/>
+ <param name="widget_header" value="$LOCALIZE[31011]"/>
+ <param name="widget_target" value="music"/>
+ <param name="list_id" value="7600"/>
+ <param name="fallback_icon" value="DefaultMusicAlbums.png"/>
+ <param name="sortby" value="playcount"/>
+ <param name="sortorder" value="descending"/>
+ </include>
+ </control>
+ <include content="ImageWidget" condition="!Library.HasContent(music)">
+ <param name="text_label" value="$LOCALIZE[31104]" />
+ <param name="button_label" value="$LOCALIZE[31110]" />
+ <param name="button_onclick" value="ActivateWindow(music,files)"/>
+ <param name="button_id" value="7600"/>
+ <param name="button2_onclick" value="Skin.SetBool(HomeMenuNoMusicButton)"/>
+ </include>
+ </control>
+ <control type="group" id="8000">
+ <visible>String.IsEqual(Container(9000).ListItem.Property(id),addons)</visible>
+ <include content="Visible_Right_Delayed">
+ <param name="id" value="addons"/>
+ </include>
+ <control type="grouplist" id="8001">
+ <include>WidgetGroupListCommon</include>
+ <include content="WidgetListCategories">
+ <param name="widget_header" value="$LOCALIZE[31148]"/>
+ <param name="list_id" value="8900"/>
+ <param name="visible" value="Integer.IsGreater(Container(8100).NumItems,0) | Integer.IsGreater(Container(8200).NumItems,0) | Integer.IsGreater(Container(8300).NumItems,0) | Integer.IsGreater(Container(8400).NumItems,0) | Integer.IsGreater(Container(8500).NumItems,0)"/>
+ <param name="addon_submenu" value="true"/>
+ </include>
+ <include content="WidgetListSquare">
+ <param name="content_path" value="addons://sources/video/"/>
+ <param name="widget_header" value="$LOCALIZE[1037]"/>
+ <param name="widget_target" value="videos"/>
+ <param name="sortby" value="lastused"/>
+ <param name="sortorder" value="descending"/>
+ <param name="list_id" value="8100"/>
+ <param name="fallback_icon" value="DefaultAddon.png"/>
+ </include>
+ <include content="WidgetListSquare">
+ <param name="content_path" value="addons://sources/audio/"/>
+ <param name="widget_header" value="$LOCALIZE[1038]"/>
+ <param name="widget_target" value="music"/>
+ <param name="sortby" value="lastused"/>
+ <param name="sortorder" value="descending"/>
+ <param name="list_id" value="8200"/>
+ <param name="fallback_icon" value="DefaultAddon.png"/>
+ </include>
+ <include content="WidgetListSquare">
+ <param name="content_path" value="addons://sources/executable/"/>
+ <param name="widget_header" value="$LOCALIZE[1043]"/>
+ <param name="widget_target" value="programs"/>
+ <param name="sortby" value="lastused"/>
+ <param name="sortorder" value="descending"/>
+ <param name="list_id" value="8300"/>
+ <param name="fallback_icon" value="DefaultAddon.png"/>
+ </include>
+ <include content="WidgetListSquare" condition="System.Platform.Android">
+ <param name="content_path" value="androidapp://sources/apps/"/>
+ <param name="widget_header" value="$LOCALIZE[20244]"/>
+ <param name="widget_target" value="programs"/>
+ <param name="sortby" value="lastused"/>
+ <param name="sortorder" value="descending"/>
+ <param name="list_id" value="8400"/>
+ <param name="fallback_icon" value="DefaultAddon.png"/>
+ </include>
+ <include content="WidgetListSquare">
+ <param name="content_path" value="addons://sources/image/"/>
+ <param name="widget_header" value="$LOCALIZE[1039]"/>
+ <param name="widget_target" value="pictures"/>
+ <param name="sortby" value="lastused"/>
+ <param name="sortorder" value="descending"/>
+ <param name="list_id" value="8500"/>
+ </include>
+ </control>
+ <include content="ImageWidget">
+ <param name="text_label" value="$LOCALIZE[31119]" />
+ <param name="button_label" value="$LOCALIZE[31118]" />
+ <param name="button_onclick" value="ActivateWindow(addonbrowser)"/>
+ <param name="button_id" value="8600"/>
+ <param name="visible" value="!Integer.IsGreater(Container(8001).NumItems,0)"/>
+ <param name="button2_onclick" value="Skin.SetBool(HomeMenuNoProgramsButton)"/>
+ </include>
+ </control>
+ <control type="group" id="11000">
+ <visible>String.IsEqual(Container(9000).ListItem.Property(id),video)</visible>
+ <include content="Visible_Right_Delayed">
+ <param name="id" value="video"/>
+ </include>
+ <control type="grouplist" id="11001">
+ <include>WidgetGroupListCommon</include>
+ <include content="WidgetListCategories">
+ <param name="content_path" value="library://video/"/>
+ <param name="widget_header" value="$LOCALIZE[31148]"/>
+ <param name="widget_target" value="videos"/>
+ <param name="list_id" value="11900"/>
+ </include>
+ <include content="WidgetListCategories">
+ <param name="content_path" value="sources://video/"/>
+ <param name="widget_header" value="$LOCALIZE[20094]"/>
+ <param name="widget_target" value="videos"/>
+ <param name="list_id" value="11100"/>
+ </include>
+ <include content="WidgetListCategories">
+ <param name="content_path" value="special://videoplaylists/"/>
+ <param name="widget_header" value="$LOCALIZE[136]"/>
+ <param name="widget_target" value="videos"/>
+ <param name="list_id" value="11200"/>
+ <param name="icon" value="DefaultPlaylist.png"/>
+ </include>
+ </control>
+ <include content="ImageWidget">
+ <param name="text_label" value="$LOCALIZE[31105]" />
+ <param name="button_label" value="$LOCALIZE[31110]" />
+ <param name="button_onclick" value="ActivateWindow(videos,root)"/>
+ <param name="button_id" value="11300"/>
+ <param name="visible" value="!Integer.IsGreater(Container(11001).NumItems,0)"/>
+ <param name="button2_onclick" value="Skin.SetBool(HomeMenuNoVideosButton)"/>
+ </include>
+ </control>
+ <control type="group" id="12000">
+ <visible>String.IsEqual(Container(9000).ListItem.Property(id),livetv)</visible>
+ <include content="Visible_Right_Delayed">
+ <param name="id" value="livetv"/>
+ </include>
+ <control type="grouplist" id="12001">
+ <include>WidgetGroupListCommon</include>
+ <control type="grouplist" id="12855">
+ <height>390</height>
+ <left>0</left>
+ <right>0</right>
+ <top>36</top>
+ <orientation>horizontal</orientation>
+ <visible>PVR.IsRecordingTV | PVR.HasNonRecordingTVTimer</visible>
+ <align>center</align>
+ <control type="group">
+ <width>674</width>
+ <visible>PVR.IsRecordingTV</visible>
+ <include content="PVRWidget">
+ <param name="icon" value="$INFO[PVR.TVNowRecordingChannelIcon]" />
+ <param name="header" value="$LOCALIZE[19158]" />
+ <param name="label1" value="$INFO[PVR.TVNowRecordingDateTime]" />
+ <param name="label2" value="$INFO[PVR.TVNowRecordingTitle][CR][COLOR=grey]$INFO[PVR.TVNowRecordingChannel][/COLOR]" />
+ </include>
+ </control>
+ <control type="group">
+ <width>674</width>
+ <visible>PVR.HasNonRecordingTVTimer</visible>
+ <include content="PVRWidget">
+ <param name="icon" value="$INFO[PVR.TVNextRecordingChannelIcon]" />
+ <param name="header" value="$LOCALIZE[19157]" />
+ <param name="label1" value="$INFO[PVR.TVNextRecordingDateTime]" />
+ <param name="label2" value="$INFO[PVR.TVNextRecordingTitle][CR][COLOR=grey]$INFO[PVR.TVNextRecordingChannel][/COLOR]" />
+ </include>
+ </control>
+ </control>
+ <include content="WidgetListCategories" condition="System.HasPVRAddon">
+ <param name="widget_header" value="$LOCALIZE[31148]"/>
+ <param name="list_id" value="12900"/>
+ <param name="pvr_submenu" value="true"/>
+ <param name="pvr_type" value="TV"/>
+ </include>
+ <include content="WidgetListChannels" condition="System.HasPVRAddon">
+ <param name="content_path" value="pvr://channels/tv/*?view=lastplayed"/>
+ <param name="sortby" value="lastplayed"/>
+ <param name="sortorder" value="descending"/>
+ <param name="widget_header" value="$LOCALIZE[31016]"/>
+ <param name="widget_target" value="pvr"/>
+ <param name="list_id" value="12200"/>
+ </include>
+ <include content="WidgetListChannels" condition="System.HasPVRAddon">
+ <param name="content_path" value="pvr://recordings/tv/active?view=flat"/>
+ <param name="sortby" value="date"/>
+ <param name="sortorder" value="descending"/>
+ <param name="widget_header" value="$LOCALIZE[31015]"/>
+ <param name="widget_target" value="pvr"/>
+ <param name="list_id" value="12300"/>
+ <param name="label" value="$INFO[ListItem.ChannelName]"/>
+ <param name="label2" value="$INFO[ListItem.Title]$INFO[ListItem.EpisodeName, (,)]"/>
+ </include>
+ </control>
+ <include content="ImageWidget" condition="!System.HasPVRAddon">
+ <param name="text_label" value="$LOCALIZE[31143]" />
+ <param name="button_label" value="$LOCALIZE[31144]" />
+ <param name="button_onclick" value="ActivateWindow(addonbrowser,addons://user/xbmc.pvrclient,return)"/>
+ <param name="button_id" value="12400"/>
+ <param name="button2_onclick" value="Skin.SetBool(HomeMenuNoTVButton)"/>
+ </include>
+ </control>
+ <control type="group" id="13000">
+ <visible>String.IsEqual(Container(9000).ListItem.Property(id),radio)</visible>
+ <include content="Visible_Right_Delayed">
+ <param name="id" value="radio"/>
+ </include>
+ <control type="grouplist" id="13001">
+ <include>WidgetGroupListCommon</include>
+ <control type="grouplist" id="13855">
+ <height>390</height>
+ <left>25</left>
+ <top>36</top>
+ <orientation>horizontal</orientation>
+ <align>right</align>
+ <width>1360</width>
+ <visible>PVR.IsRecordingRadio | PVR.HasNonRecordingRadioTimer</visible>
+ <control type="group">
+ <width>680</width>
+ <visible>PVR.IsRecordingRadio</visible>
+ <include content="PVRWidget">
+ <param name="icon" value="$INFO[PVR.RadioNowRecordingChannelIcon]" />
+ <param name="header" value="$LOCALIZE[19158]" />
+ <param name="label1" value="$INFO[PVR.RadioNowRecordingDateTime]" />
+ <param name="label2" value="$INFO[PVR.RadioNowRecordingTitle][CR][COLOR=grey]$INFO[PVR.RadioNowRecordingChannel][/COLOR]" />
+ </include>
+ </control>
+ <control type="group">
+ <visible>PVR.HasNonRecordingRadioTimer</visible>
+ <width>680</width>
+ <include content="PVRWidget">
+ <param name="icon" value="$INFO[PVR.RadioNextRecordingChannelIcon]" />
+ <param name="header" value="$LOCALIZE[19157]" />
+ <param name="label1" value="$INFO[PVR.RadioNextRecordingDateTime]" />
+ <param name="label2" value="$INFO[PVR.RadioNextRecordingTitle][CR][COLOR=grey]$INFO[PVR.RadioNextRecordingChannel][/COLOR]" />
+ </include>
+ </control>
+ </control>
+ <include content="WidgetListCategories" condition="System.HasPVRAddon">
+ <param name="widget_header" value="$LOCALIZE[31148]"/>
+ <param name="list_id" value="13900"/>
+ <param name="pvr_submenu" value="true"/>
+ <param name="pvr_type" value="Radio"/>
+ </include>
+ <include content="WidgetListChannels" condition="System.HasPVRAddon">
+ <param name="content_path" value="pvr://channels/radio/*?view=lastplayed"/>
+ <param name="sortby" value="lastplayed"/>
+ <param name="sortorder" value="descending"/>
+ <param name="widget_header" value="$LOCALIZE[31018]"/>
+ <param name="widget_target" value="files"/>
+ <param name="list_id" value="13200"/>
+ </include>
+ <include content="WidgetListChannels" condition="System.HasPVRAddon">
+ <param name="content_path" value="pvr://recordings/radio/active?view=flat"/>
+ <param name="sortby" value="date"/>
+ <param name="sortorder" value="descending"/>
+ <param name="widget_header" value="$LOCALIZE[31015]"/>
+ <param name="widget_target" value="pvr"/>
+ <param name="list_id" value="13300"/>
+ <param name="label" value="$INFO[ListItem.ChannelName]"/>
+ <param name="label2" value="$INFO[ListItem.Title]$INFO[ListItem.EpisodeName, (,)]"/>
+ </include>
+ </control>
+ <include content="ImageWidget" condition="!System.HasPVRAddon">
+ <param name="text_label" value="$LOCALIZE[31143]" />
+ <param name="button_label" value="$LOCALIZE[31144]" />
+ <param name="button_onclick" value="ActivateWindow(addonbrowser,addons://user/xbmc.pvrclient,return)"/>
+ <param name="button_id" value="13400"/>
+ <param name="button2_onclick" value="Skin.SetBool(HomeMenuNoRadioButton)"/>
+ </include>
+ </control>
+ <control type="group" id="14000">
+ <visible>String.IsEqual(Container(9000).ListItem.Property(id),favorites)</visible>
+ <include content="Visible_Right_Delayed">
+ <param name="id" value="favorites"/>
+ </include>
+ <control type="panel" id="14100">
+ <left>65</left>
+ <top>0</top>
+ <right>0</right>
+ <bottom>0</bottom>
+ <onleft>9000</onleft>
+ <onright>9000</onright>
+ <onup>14100</onup>
+ <ondown>14100</ondown>
+ <onclick>$INFO[ListItem.FileNameAndPath]</onclick>
+ <preloaditems>2</preloaditems>
+ <scrolltime tween="cubic" easing="out">500</scrolltime>
+ <orientation>vertical</orientation>
+ <visible>Integer.IsGreater(Container(14100).NumItems,0) | Container(14100).IsUpdating</visible>
+ <itemlayout width="330" height="396">
+ <control type="group">
+ <top>130</top>
+ <include content="InfoWallMusicLayout">
+ <param name="fallback_image" value="DefaultFavourites.png" />
+ <param name="focused" value="false" />
+ </include>
+ </control>
+ </itemlayout>
+ <focusedlayout width="330" height="396">
+ <control type="group">
+ <depth>DepthContentPopout</depth>
+ <top>130</top>
+ <animation effect="zoom" start="100" end="110" time="200" tween="sine" easing="inout" center="170,320">Focus</animation>
+ <animation effect="zoom" start="110" end="100" time="200" tween="sine" easing="inout" center="170,320">UnFocus</animation>
+ <include content="InfoWallMusicLayout">
+ <param name="fallback_image" value="DefaultFavourites.png" />
+ <param name="focused" value="true" />
+ </include>
+ </control>
+ </focusedlayout>
+ <content>favourites://</content>
+ </control>
+ <include content="ImageWidget">
+ <param name="text_label" value="$LOCALIZE[31025]" />
+ <param name="button_label" value="$LOCALIZE[31116]" />
+ <param name="button_onclick" value=""/>
+ <param name="button_id" value="5500"/>
+ <param name="visible" value="!Integer.IsGreater(Container(14100).NumItems,0) + !Container(14100).IsUpdating"/>
+ <param name="visible_1" value="false"/>
+ <param name="button2_onclick" value="Skin.SetBool(HomeMenuNoFavButton)"/>
+ </include>
+ </control>
+ <control type="group" id="15000">
+ <visible>String.IsEqual(Container(9000).ListItem.Property(id),weather)</visible>
+ <include content="Visible_Right_Delayed">
+ <param name="id" value="weather"/>
+ </include>
+ <control type="grouplist" id="15001">
+ <include>WidgetGroupListCommon</include>
+ <control type="group" id="16678">
+ <description>Weather info</description>
+ <left>68</left>
+ <right>70</right>
+ <top>102</top>
+ <height>300</height>
+ <visible>!String.IsEmpty(Weather.plugin)</visible>
+ <control type="image">
+ <bottom>90</bottom>
+ <width>100%</width>
+ <texture border="21">dialogs/dialog-bg.png</texture>
+ </control>
+ <control type="label">
+ <left>840</left>
+ <top>60</top>
+ <aligny>center</aligny>
+ <height>24</height>
+ <right>60</right>
+ <align>right</align>
+ <font>font30_title</font>
+ <label>$INFO[Weather.Location]</label>
+ </control>
+ <control type="label">
+ <left>840</left>
+ <top>120</top>
+ <aligny>center</aligny>
+ <height>24</height>
+ <right>60</right>
+ <align>right</align>
+ <font>font14</font>
+ <label>$INFO[Weather.Conditions,, ∙ ]$INFO[Weather.Temperature]</label>
+ </control>
+ <control type="grouplist">
+ <top>50</top>
+ <left>50</left>
+ <right>20</right>
+ <orientation>horizontal</orientation>
+ <align>left</align>
+ <itemgap>-110</itemgap>
+ <include content="WeatherIcon" condition="!String.IsEmpty(Weather.Plugin)">
+ <param name="label" value="Window(weather).Property(Current.Wind)" />
+ <param name="texture" value="icons/weather/wind.png" />
+ <param name="header" value="404" />
+ </include>
+ <include content="WeatherIcon" condition="!String.IsEmpty(Weather.Plugin)">
+ <param name="label" value="Window(weather).Property(Current.Humidity)" />
+ <param name="texture" value="icons/weather/humidity.png" />
+ <param name="header" value="406" />
+ </include>
+ <include content="WeatherIcon" condition="!String.IsEmpty(Weather.Plugin)">
+ <param name="label" value="Window(weather).Property(Current.Precipitation)" />
+ <param name="texture" value="icons/weather/rain.png" />
+ <param name="header" value="33021" />
+ </include>
+ <include content="WeatherIcon" condition="!String.IsEmpty(Weather.Plugin)">
+ <param name="label" value="Window(weather).Property(Today.Sunrise)" />
+ <param name="texture" value="icons/weather/sunrise.png" />
+ <param name="header" value="405" />
+ </include>
+ <include content="WeatherIcon" condition="!String.IsEmpty(Weather.Plugin)">
+ <param name="label" value="Window(weather).Property(Today.Sunset)" />
+ <param name="texture" value="icons/weather/sunset.png" />
+ <param name="header" value="403" />
+ </include>
+ </control>
+ </control>
+ <include content="WeatherWidget" condition="!String.IsEmpty(Weather.Plugin)">
+ <param name="content_include" value="DailyItems" />
+ <param name="list_id" value="15200" />
+ <param name="widget_header" value="$LOCALIZE[31019]"/>
+ <param name="visible" value="!String.IsEmpty(Window(weather).Property(Daily.IsFetched))" />
+ </include>
+ <include content="WeatherWidget" condition="!String.IsEmpty(Weather.Plugin)">
+ <param name="content_include" value="HourlyItems" />
+ <param name="list_id" value="15100" />
+ <param name="widget_header" value="$LOCALIZE[33036]"/>
+ <param name="visible" value="!String.IsEmpty(Window(weather).Property(Hourly.IsFetched))" />
+ </include>
+ </control>
+ <include content="ImageWidget" condition="String.IsEmpty(Weather.plugin)">
+ <param name="text_label" value="$LOCALIZE[31120]" />
+ <param name="button_label" value="$LOCALIZE[31121]" />
+ <param name="button_onclick" value="ActivateWindow(servicesettings,weather)"/>
+ <param name="button_id" value="15300"/>
+ <param name="button2_onclick" value="Skin.SetBool(HomeMenuNoWeatherButton)"/>
+ </include>
+ </control>
+ <control type="group" id="16000">
+ <visible>String.IsEqual(Container(9000).ListItem.Property(id),musicvideos)</visible>
+ <include content="Visible_Right_Delayed">
+ <param name="id" value="musicvideos"/>
+ </include>
+ <control type="grouplist" id="16001">
+ <include>WidgetGroupListCommon</include>
+ <include content="WidgetListCategories" condition="Library.HasContent(musicvideos)">
+ <param name="content_path" value="library://music/musicvideos/"/>
+ <param name="widget_header" value="$LOCALIZE[31148]"/>
+ <param name="widget_target" value="videos"/>
+ <param name="list_id" value="16900"/>
+ </include>
+ <include content="WidgetListEpisodes" condition="Library.HasContent(musicvideos)">
+ <param name="content_path" value="videodb://recentlyaddedmusicvideos/"/>
+ <param name="widget_header" value="$LOCALIZE[20390]"/>
+ <param name="widget_target" value="videos"/>
+ <param name="main_label" value="$INFO[ListItem.Label]" />
+ <param name="sub_label" value="$INFO[ListItem.Artist]" />
+ <param name="thumb_label" value="$INFO[ListItem.Year]" />
+ <param name="fallback_image" value="DefaultMusicSongs.png" />
+ <param name="list_id" value="16300"/>
+ </include>
+ <include content="WidgetListEpisodes" condition="Library.HasContent(musicvideos)">
+ <param name="content_path" value="special://skin/playlists/unwatched_musicvideos.xsp"/>
+ <param name="widget_header" value="$LOCALIZE[31151]"/>
+ <param name="widget_target" value="videos"/>
+ <param name="main_label" value="$INFO[ListItem.Label]" />
+ <param name="sub_label" value="$INFO[ListItem.Artist]" />
+ <param name="thumb_label" value="$INFO[ListItem.Year]" />
+ <param name="fallback_image" value="DefaultMusicSongs.png" />
+ <param name="list_id" value="16400"/>
+ </include>
+ <include content="WidgetListSquare" condition="Library.HasContent(musicvideos)">
+ <param name="content_path" value="special://skin/playlists/random_musicvideo_artists.xsp"/>
+ <param name="widget_header" value="$LOCALIZE[31013]"/>
+ <param name="widget_target" value="music"/>
+ <param name="list_id" value="16200"/>
+ <param name="widget_limit" value="10"/>
+ </include>
+ <include content="WidgetListEpisodes" condition="Library.HasContent(musicvideos)">
+ <param name="content_path" value="special://skin/playlists/random_musicvideos.xsp"/>
+ <param name="widget_header" value="$LOCALIZE[31152]"/>
+ <param name="widget_target" value="videos"/>
+ <param name="main_label" value="$INFO[ListItem.Label]" />
+ <param name="sub_label" value="$INFO[ListItem.Artist]" />
+ <param name="thumb_label" value="$INFO[ListItem.Year]" />
+ <param name="fallback_image" value="DefaultMusicSongs.png" />
+ <param name="list_id" value="16500"/>
+ </include>
+ <include content="WidgetListCategories" condition="Library.HasContent(musicvideos)">
+ <param name="content_path" value="videodb://musicvideos/studios/"/>
+ <param name="widget_header" value="$LOCALIZE[20388]"/>
+ <param name="widget_target" value="music"/>
+ <param name="list_id" value="16600"/>
+ <param name="icon" value="$VAR[WidgetStudioIconVar]"/>
+ <param name="icon_height" value="70"/>
+ </include>
+ </control>
+ <include content="ImageWidget" condition="!Library.HasContent(musicvideos)">
+ <param name="text_label" value="$LOCALIZE[31104]" />
+ <param name="button_label" value="$LOCALIZE[31110]" />
+ <param name="button_onclick" value="ActivateWindow(videos,files,return)"/>
+ <param name="button_id" value="16800"/>
+ <param name="button2_onclick" value="Skin.SetBool(HomeMenuNoMusicVideoButton)"/>
+ </include>
+ </control>
+ <control type="group" id="4000">
+ <visible>String.IsEqual(Container(9000).ListItem.Property(id),pictures)</visible>
+ <include content="Visible_Right_Delayed">
+ <param name="id" value="pictures"/>
+ </include>
+ <control type="grouplist" id="4001">
+ <include>WidgetGroupListCommon</include>
+ <include content="WidgetListCategories" condition="!Skin.HasSetting(HomeMenuNoPicturesButton)">
+ <param name="content_path" value="sources://pictures/"/>
+ <param name="widget_header" value="$LOCALIZE[20094]"/>
+ <param name="widget_target" value="pictures"/>
+ <param name="list_id" value="4100"/>
+ </include>
+ </control>
+ </control>
+ <control type="group" id="21000">
+ <visible>String.IsEqual(Container(9000).ListItem.Property(id),disc)</visible>
+ <include content="Visible_Right_Delayed">
+ <param name="id" value="disc"/>
+ </include>
+ <include content="ImageWidget">
+ <param name="text_label" value="$INFO[System.DVDLabel]" />
+ <param name="button_label" value="$LOCALIZE[341]" />
+ <param name="button_onclick" value="PlayDisc"/>
+ <param name="button_id" value="21100"/>
+ <param name="visible" value="true"/>
+ <param name="button2_label" value="$LOCALIZE[13391]"/>
+ <param name="button2_onclick" value="EjectTray()"/>
+ </include>
+ </control>
+ </control>
+ <control type="group">
+ <depth>DepthContentPanel</depth>
+ <include>OpenClose_Left</include>
+ <include content="ContentPanel">
+ <param name="width" value="522" />
+ </include>
+ <control type="fixedlist" id="9000">
+ <left>0</left>
+ <top>240</top>
+ <width>462</width>
+ <bottom>-10</bottom>
+ <movement>6</movement>
+ <focusposition>1</focusposition>
+ <onfocus>ClearProperty(listposition,home)</onfocus>
+ <onright>SetFocus($INFO[Container(9000).ListItem.Property(menu_id)])</onright>
+ <onup>700</onup>
+ <ondown>700</ondown>
+ <scrolltime tween="cubic" easing="out">500</scrolltime>
+ <focusedlayout height="95">
+ <control type="group">
+ <animation effect="fade" start="100" end="0" time="0">UnFocus</animation>
+ <control type="image">
+ <left>0</left>
+ <top>0</top>
+ <width>462</width>
+ <height>95</height>
+ <texture colordiffuse="button_focus">lists/focus.png</texture>
+ <animation effect="fade" start="100" end="0" time="0" condition="[!Control.HasFocus(9000) + !ControlGroup(700).HasFocus] | System.HasModalDialog">Conditional</animation>
+ </control>
+ <control type="image">
+ <left>-3</left>
+ <top>1</top>
+ <width>95</width>
+ <height>95</height>
+ <texture colordiffuse="button_focus">$INFO[ListItem.Art(thumb)]</texture>
+ <animation effect="fade" start="0" end="100" time="300" reversible="false">Focus</animation>
+ </control>
+ <control type="image">
+ <left>0</left>
+ <top>0</top>
+ <width>95</width>
+ <height>95</height>
+ <texture colordiffuse="51FFFFFF">colors/black.png</texture>
+ <animation effect="fade" start="100" end="0" time="0" condition="[!Control.HasFocus(9000) + !ControlGroup(700).HasFocus] | System.HasModalDialog">Conditional</animation>
+ </control>
+ </control>
+ <control type="image">
+ <left>-3</left>
+ <top>1</top>
+ <width>95</width>
+ <height>95</height>
+ <texture>$INFO[ListItem.Art(thumb)]</texture>
+ </control>
+ <control type="label">
+ <left>104</left>
+ <top>0</top>
+ <height>95</height>
+ <width>560</width>
+ <aligny>center</aligny>
+ <font>font37</font>
+ <label>$INFO[ListItem.Label]</label>
+ <shadowcolor>text_shadow</shadowcolor>
+ </control>
+ </focusedlayout>
+ <itemlayout height="95">
+ <control type="image">
+ <left>-3</left>
+ <top>1</top>
+ <width>95</width>
+ <height>95</height>
+ <texture colordiffuse="44FFFFFF">$INFO[ListItem.Art(thumb)]</texture>
+ </control>
+ <control type="label">
+ <left>104</left>
+ <top>0</top>
+ <height>95</height>
+ <width>560</width>
+ <aligny>center</aligny>
+ <font>font37</font>
+ <label>$INFO[ListItem.Label]</label>
+ <shadowcolor>text_shadow</shadowcolor>
+ </control>
+ </itemlayout>
+ <content>
+ <!-- Start Emby Menu Items -->
+ <item>
+ <label>Emby Movies</label>
+ <onclick condition="String.IsEmpty(Window(Home).Property(first_load_done))">ActivateWindow(Videos,videodb://movies/titles/,return)</onclick>
+ <onclick>ActivateWindow(Videos,plugin://plugin.video.embycon/?mode=SHOW_CONTENT&amp;item_type=Movie&amp;media_type=movies,return)</onclick>
+ <onclick>SetProperty(first_load_done, done, 10000)</onclick>
+ <property name="menu_id">$NUMBER[3000]</property>
+ <thumb>icons/sidemenu/movies.png</thumb>
+ <property name="id">emby_movies</property>
+ </item>
+ <item>
+ <label>Emby TV Shows</label>
+ <onclick condition="String.IsEmpty(Window(Home).Property(first_load_done))">ActivateWindow(Videos,videodb://movies/titles/,return)</onclick>
+ <onclick>ActivateWindow(Videos,plugin://plugin.video.embycon/?mode=SHOW_CONTENT&amp;item_type=Series&amp;media_type=tvshows,return)</onclick>
+ <onclick>SetProperty(first_load_done, done, 10000)</onclick>
+ <property name="menu_id">$NUMBER[4000]</property>
+ <thumb>icons/sidemenu/tv.png</thumb>
+ <property name="id">emby_tvshows</property>
+ </item>
+ <!-- End Emby Menu Items -->
+ <item>
+ <label>$LOCALIZE[342]</label>
+ <onclick condition="Library.HasContent(movies)">ActivateWindow(Videos,videodb://movies/titles/,return)</onclick>
+ <onclick condition="!Library.HasContent(movies)">ActivateWindow(Videos,sources://video/,return)</onclick>
+ <property name="menu_id">$NUMBER[5000]</property>
+ <thumb>icons/sidemenu/movies.png</thumb>
+ <property name="id">movies</property>
+ <visible>!Skin.HasSetting(HomeMenuNoMovieButton)</visible>
+ </item>
+ <item>
+ <label>$LOCALIZE[20343]</label>
+ <onclick condition="Library.HasContent(tvshows)">ActivateWindow(Videos,videodb://tvshows/titles/,return)</onclick>
+ <onclick condition="!Library.HasContent(tvshows)">ActivateWindow(Videos,sources://video/,return)</onclick>
+ <property name="menu_id">$NUMBER[6000]</property>
+ <thumb>icons/sidemenu/tv.png</thumb>
+ <property name="id">tvshows</property>
+ <visible>!Skin.HasSetting(HomeMenuNoTVShowButton)</visible>
+ </item>
+ <item>
+ <label>$LOCALIZE[2]</label>
+ <onclick>ActivateWindow(Music,root,return)</onclick>
+ <property name="menu_id">$NUMBER[7000]</property>
+ <thumb>icons/sidemenu/music.png</thumb>
+ <property name="id">music</property>
+ <visible>!Skin.HasSetting(HomeMenuNoMusicButton)</visible>
+ </item>
+ <item>
+ <label>$LOCALIZE[427]</label>
+ <onclick>PlayDisc</onclick>
+ <property name="menu_id">$NUMBER[21000]</property>
+ <thumb>icons/sidemenu/disc.png</thumb>
+ <property name="id">disc</property>
+ <visible>System.HasMediaDVD</visible>
+ </item>
+ <item>
+ <label>$LOCALIZE[20389]</label>
+ <property name="menu_id">$NUMBER[16000]</property>
+ <onclick>ActivateWindow(Videos,musicvideos,return)</onclick>
+ <thumb>icons/sidemenu/musicvideos.png</thumb>
+ <property name="id">musicvideos</property>
+ <visible>!Skin.HasSetting(HomeMenuNoMusicVideoButton)</visible>
+ </item>
+ <item>
+ <label>$LOCALIZE[19020]</label>
+ <property name="menu_id">$NUMBER[12000]</property>
+ <onclick>ActivateWindow(TVChannels)</onclick>
+ <thumb>icons/sidemenu/livetv.png</thumb>
+ <property name="id">livetv</property>
+ <visible>!Skin.HasSetting(HomeMenuNoTVButton)</visible>
+ </item>
+ <item>
+ <label>$LOCALIZE[19021]</label>
+ <property name="menu_id">$NUMBER[13000]</property>
+ <onclick>ActivateWindow(RadioChannels)</onclick>
+ <thumb>icons/sidemenu/radio.png</thumb>
+ <property name="id">radio</property>
+ <visible>!Skin.HasSetting(HomeMenuNoRadioButton)</visible>
+ </item>
+ <item>
+ <label>$LOCALIZE[24001]</label>
+ <property name="menu_id">$NUMBER[8000]</property>
+ <onclick>ActivateWindow(1100)</onclick>
+ <thumb>icons/sidemenu/addons.png</thumb>
+ <property name="id">addons</property>
+ <visible>!Skin.HasSetting(HomeMenuNoProgramsButton)</visible>
+ </item>
+ <item>
+ <label>$LOCALIZE[1]</label>
+ <onclick>ActivateWindow(Pictures)</onclick>
+ <property name="menu_id">$NUMBER[4000]</property>
+ <thumb>icons/sidemenu/pictures.png</thumb>
+ <property name="id">pictures</property>
+ <visible>!Skin.HasSetting(HomeMenuNoPicturesButton)</visible>
+ </item>
+ <item>
+ <label>$LOCALIZE[3]</label>
+ <onclick>ActivateWindow(Videos,root)</onclick>
+ <property name="menu_id">$NUMBER[11000]</property>
+ <thumb>icons/sidemenu/videos.png</thumb>
+ <property name="id">video</property>
+ <visible>!Skin.HasSetting(HomeMenuNoVideosButton)</visible>
+ </item>
+ <item>
+ <label>$LOCALIZE[10134]</label>
+ <onclick>ActivateWindow(favourites)</onclick>
+ <property name="menu_id">$NUMBER[14000]</property>
+ <thumb>icons/sidemenu/favourites.png</thumb>
+ <property name="id">favorites</property>
+ <visible>!Skin.HasSetting(HomeMenuNoFavButton)</visible>
+ </item>
+ <item>
+ <label>$LOCALIZE[8]</label>
+ <onclick condition="!String.IsEmpty(Weather.Plugin)">ActivateWindow(Weather)</onclick>
+ <onclick condition="String.IsEmpty(Weather.Plugin)">ReplaceWindow(servicesettings,weather)</onclick>
+ <property name="menu_id">$NUMBER[15000]</property>
+ <thumb>icons/sidemenu/weather.png</thumb>
+ <property name="id">weather</property>
+ <visible>!Skin.HasSetting(HomeMenuNoWeatherButton)</visible>
+ </item>
+ </content>
+ </control>
+ <control type="grouplist" id="700">
+ <orientation>horizontal</orientation>
+ <itemgap>0</itemgap>
+ <left>-8</left>
+ <width>480</width>
+ <height>110</height>
+ <top>100</top>
+ <onup>SetFocus(9000)</onup>
+ <onup>PageDown</onup>
+ <onup>PageDown</onup>
+ <ondown>SetFocus(9000)</ondown>
+ <ondown>PageUp</ondown>
+ <ondown>PageUp</ondown>
+ <onright>2000</onright>
+ <align>justify</align>
+ <include content="IconButton">
+ <param name="control_id" value="804" />
+ <param name="onclick" value="ActivateWindow(shutdownmenu)" />
+ <param name="icon" value="icons/power.png" />
+ <param name="label" value="$LOCALIZE[33060]" />
+ </include>
+ <include content="IconButton">
+ <param name="control_id" value="802" />
+ <param name="onclick" value="ActivateWindow(settings)" />
+ <param name="icon" value="icons/settings.png" />
+ <param name="label" value="$LOCALIZE[21417]" />
+ </include>
+ <include content="IconButton">
+ <param name="control_id" value="801" />
+ <param name="onclick" value="ActivateWindow(1107)" />
+ <param name="icon" value="icons/search.png" />
+ <param name="label" value="$LOCALIZE[137]" />
+ </include>
+ <include content="IconButton">
+ <param name="control_id" value="803" />
+ <param name="onclick" value="Fullscreen" />
+ <param name="icon" value="icons/now-playing/fullscreen.png" />
+ <param name="label" value="$LOCALIZE[31000]" />
+ <param name="visible" value="Player.HasMedia" />
+ </include>
+ </control>
+ </control>
+ <include>BottomBar</include>
+ <include content="TopBar">
+ <param name="breadcrumbs_label" value="" />
+ </include>
+ <control type="group">
+ <depth>DepthBars</depth>
+ <animation effect="slide" end="0,-90" time="300" tween="sine" easing="inout" condition="$EXP[infodialog_active]">conditional</animation>
+ <animation effect="fade" start="0" end="100" time="300">WindowOpen</animation>
+ <animation effect="fade" start="100" end="0" time="200">WindowClose</animation>
+ <top>30</top>
+ <left>90</left>
+ <control type="image">
+ <aspectratio>keep</aspectratio>
+ <width>56</width>
+ <height>56</height>
+ <texture colordiffuse="button_focus">icons/logo.png</texture>
+ </control>
+ <control type="image">
+ <left>40</left>
+ <top>10</top>
+ <aspectratio>keep</aspectratio>
+ <width>192</width>
+ <height>36</height>
+ <texture>icons/logo-text.png</texture>
+ </control>
+ </control>
+ <control type="rss">
+ <animation effect="slide" end="0,90" time="300" tween="sine" easing="inout" condition="$EXP[infodialog_active]">conditional</animation>
+ <animation effect="fade" start="0" end="100" time="400">WindowOpen</animation>
+ <animation effect="fade" start="100" end="0" time="300">WindowClose</animation>
+ <left>0</left>
+ <bottom>0</bottom>
+ <height>39</height>
+ <width>100%</width>
+ <font>font12</font>
+ <urlset>1</urlset>
+ <hitrect x="-100" y="0" w="1" h="1" />
+ <titlecolor>button_focus</titlecolor>
+ <textcolor>button_focus</textcolor>
+ <shadowcolor>text_shadow</shadowcolor>
+ <headlinecolor>FFC0C0C0</headlinecolor>
+ </control>
+ </control>
+ </controls>
+</window>
diff --git a/plugin.video.embycon/resources/skins/skin.estuary/xml/Home-17.3.xml b/plugin.video.embycon/resources/skins/skin.estuary/xml/Home-17.3.xml
index f12f5c5..8c73c20 100644
--- a/plugin.video.embycon/resources/skins/skin.estuary/xml/Home-17.3.xml
+++ b/plugin.video.embycon/resources/skins/skin.estuary/xml/Home-17.3.xml
@@ -52,19 +52,19 @@
<control type="grouplist" id="3001">
<include>WidgetGroupListCommon</include>
<include content="WidgetListPoster" condition="true">
- <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&type=recent_movies"/>
+ <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&amp;type=recent_movies&amp;reload=$INFO[Window(Home).Property(plugin.video.embycon-embycon_widget_reload)]"/>
<param name="widget_header" value="Recently Added"/>
<param name="widget_target" value="videos"/>
<param name="list_id" value="3800"/>
</include>
<include content="WidgetListPoster" condition="true">
- <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&type=inprogress_movies"/>
+ <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&amp;type=inprogress_movies&amp;reload=$INFO[Window(Home).Property(plugin.video.embycon-embycon_widget_reload)]"/>
<param name="widget_header" value="In Progress"/>
<param name="widget_target" value="videos"/>
<param name="list_id" value="3900"/>
</include>
<include content="WidgetListPoster" condition="true">
- <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&type=random_movies"/>
+ <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&amp;type=random_movies&amp;reload=$INFO[Window(Home).Property(plugin.video.embycon-embycon_widget_reload)]"/>
<param name="widget_header" value="Random"/>
<param name="widget_target" value="videos"/>
<param name="list_id" value="3100"/>
@@ -79,19 +79,19 @@
<control type="grouplist" id="4001">
<include>WidgetGroupListCommon</include>
<include content="WidgetListEpisodes" condition="true">
- <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&type=recent_episodes"/>
+ <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&amp;type=recent_episodes&amp;reload=$INFO[Window(Home).Property(plugin.video.embycon-embycon_widget_reload)]"/>
<param name="widget_header" value="Recently Added"/>
<param name="widget_target" value="videos"/>
<param name="list_id" value="4900"/>
</include>
<include content="WidgetListEpisodes" condition="true">
- <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&type=inprogress_episodes"/>
+ <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&amp;type=inprogress_episodes&amp;reload=$INFO[Window(Home).Property(plugin.video.embycon-embycon_widget_reload)]"/>
<param name="widget_header" value="In Progress"/>
<param name="widget_target" value="videos"/>
<param name="list_id" value="4100"/>
</include>
<include content="WidgetListEpisodes" condition="true">
- <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&type=nextup_episodes"/>
+ <param name="content_path" value="plugin://plugin.video.embycon?mode=WIDGET_CONTENT&amp;type=nextup_episodes&amp;reload=$INFO[Window(Home).Property(plugin.video.embycon-embycon_widget_reload)]"/>
<param name="widget_header" value="Next Up"/>
<param name="widget_target" value="videos"/>
<param name="list_id" value="4200"/>
@@ -856,14 +856,16 @@
<!-- Start Emby Menu Items -->
<item>
<label>Emby Movies</label>
- <onclick>RunAddon(plugin.video.embycon, /?mode=SHOW_CONTENT&amp;item_type=Movie&amp;media_type=movies)</onclick>
+ <onclick>ActivateWindow(Videos,plugin://plugin.video.embycon/?mode=SHOW_CONTENT&amp;item_type=Movie&amp;media_type=movies,return)</onclick>
+ <!--<onclick>RunAddon(plugin.video.embycon, /?mode=SHOW_CONTENT&amp;item_type=Movie&amp;media_type=movies)</onclick>-->
<property name="menu_id">$NUMBER[3000]</property>
<thumb>icons/sidemenu/movies.png</thumb>
<property name="id">emby_movies</property>
</item>
<item>
<label>Emby TV Shows</label>
- <onclick>RunAddon(plugin.video.embycon, /?mode=SHOW_CONTENT&amp;item_type=Series&amp;media_type=tvshows)</onclick>
+ <onclick>ActivateWindow(Videos,plugin://plugin.video.embycon/?mode=SHOW_CONTENT&amp;item_type=Series&amp;media_type=tvshows,return)</onclick>
+ <!--<onclick>RunAddon(plugin.video.embycon, /?mode=SHOW_CONTENT&amp;item_type=Series&amp;media_type=tvshows)</onclick>-->
<property name="menu_id">$NUMBER[4000]</property>
<thumb>icons/sidemenu/tv.png</thumb>
<property name="id">emby_tvshows</property>
diff --git a/plugin.video.embycon/service.py b/plugin.video.embycon/service.py
index 2a71d93..60b1575 100644
--- a/plugin.video.embycon/service.py
+++ b/plugin.video.embycon/service.py
@@ -6,12 +6,14 @@ import xbmcaddon
import xbmcgui
import time
import json
+import traceback
from resources.lib.downloadutils import DownloadUtils
from resources.lib.simple_logging import SimpleLogging
from resources.lib.play_utils import playFile
from resources.lib.kodi_utils import HomeWindow
from resources.lib.translation import i18n
+from resources.lib.widgets import checkForNewContent
# clear user and token when logging in
home_window = HomeWindow()
@@ -55,6 +57,7 @@ def sendProgress():
ticks = int(play_time * 10000000)
paused = play_data.get("paused", False)
playback_type = play_data.get("playback_type")
+ play_session_id = play_data.get("play_session_id")
postdata = {
'QueueableMediaTypes': "Video",
@@ -64,7 +67,8 @@ def sendProgress():
'PositionTicks': ticks,
'IsPaused': paused,
'IsMuted': False,
- 'PlayMethod': playback_type
+ 'PlayMethod': playback_type,
+ 'PlaySessionId': play_session_id
}
log.debug("Sending POST progress started: %s." % postdata)
@@ -77,6 +81,7 @@ def promptForStopActions(item_id, current_possition):
settings = xbmcaddon.Addon(id='plugin.video.embycon')
prompt_next_percentage = int(settings.getSetting('promptPlayNextEpisodePercentage'))
+ play_prompt = settings.getSetting('promptPlayNextEpisodePercentage_prompt') == "true"
prompt_delete_episode_percentage = int(settings.getSetting('promptDeleteEpisodePercentage'))
prompt_delete_movie_percentage = int(settings.getSetting('promptDeleteMoviePercentage'))
@@ -151,8 +156,14 @@ def promptForStopActions(item_id, current_possition):
item_list = items_result.get("Items", [])
for item in item_list:
index = item.get("IndexNumber", -1)
- if index > item_index: # find the next episode in the season
- resp = xbmcgui.Dialog().yesno(i18n("play_next_title"), i18n("play_next_question"), autoclose=10000)
+ if index == item_index + 1: # find the very next episode in the season
+
+ resp = True
+ if play_prompt:
+ #next_epp_name = str(index) + " of " + str(item_list[-1].get("IndexNumber", -1)) + " - " + item.get("Name", "n/a")
+ next_epp_name = ("%02d - " % (index,)) + item.get("Name", "n/a")
+ resp = xbmcgui.Dialog().yesno(i18n("play_next_title"), i18n("play_next_question"), next_epp_name, autoclose=10000)
+
if resp:
next_item_id = item.get("Id")
log.debug("Playing Next Episode: %s" % next_item_id)
@@ -218,6 +229,7 @@ class Service(xbmc.Player):
home_window = HomeWindow()
emby_item_id = home_window.getProperty("item_id")
playback_type = home_window.getProperty("PlaybackType_" + emby_item_id)
+ play_session_id = home_window.getProperty("PlaySessionId_" + emby_item_id)
# if we could not find the ID of the current item then return
if emby_item_id is None or len(emby_item_id) == 0:
@@ -229,7 +241,8 @@ class Service(xbmc.Player):
'CanSeek': True,
'ItemId': emby_item_id,
'MediaSourceId': emby_item_id,
- 'PlayMethod': playback_type
+ 'PlayMethod': playback_type,
+ 'PlaySessionId': play_session_id
}
log.debug("Sending POST play started: %s." % postdata)
@@ -241,6 +254,7 @@ class Service(xbmc.Player):
data["item_id"] = emby_item_id
data["paused"] = False
data["playback_type"] = playback_type
+ data["play_session_id"] = play_session_id
self.played_information[current_playing_file] = data
log.debug("ADDING_FILE : " + current_playing_file)
@@ -287,9 +301,9 @@ class Service(xbmc.Player):
monitor = Service()
-last_progress_update = time.time()
-download_utils.checkVersion()
home_window = HomeWindow()
+last_progress_update = time.time()
+last_content_check = time.time()
# monitor.abortRequested() is causes issues, it currently triggers for all addon cancelations which causes
# the service to exit when a user cancels an addon load action. This is a bug in Kodi.
@@ -297,28 +311,32 @@ home_window = HomeWindow()
while not xbmc.abortRequested:
- if xbmc.Player().isPlaying():
-
- try:
+ try:
+ if xbmc.Player().isPlaying():
+ # if playing every 10 seconds updated the server with progress
if (time.time() - last_progress_update) > 10:
last_progress_update = time.time()
sendProgress()
+ else:
+ # if we have a play item them trigger playback
+ play_data = home_window.getProperty("play_item_message")
+ if play_data:
+ home_window.clearProperty("play_item_message")
+ play_info = json.loads(play_data)
+ playFile(play_info)
+
+ # if not playing every 60 seonds check for new widget content
+ if (time.time() - last_content_check) > 60:
+ last_content_check = time.time()
+ checkForNewContent()
+
+ except Exception as error:
+ log.error("Exception in Playback Monitor : " + str(error))
+ log.error(traceback.format_exc())
- except Exception as error:
- log.error("Exception in Playback Monitor : " + str(error))
-
- else:
- play_data = home_window.getProperty("play_item_message")
- if play_data:
- home_window.clearProperty("play_item_message")
- play_info = json.loads(play_data)
- playFile(play_info)
-
- home_window.setProperty("Service_Timestamp", str(int(time.time())))
xbmc.sleep(1000)
# clear user and token when loggin off
-home_window.clearProperty("Service_Timestamp")
home_window.clearProperty("userid")
home_window.clearProperty("AccessToken")
home_window.clearProperty("Params")
diff --git a/plugin.video.fitnessblenderv2/LICENSE b/plugin.video.fitnessblenderv2/LICENSE
new file mode 100644
index 0000000..bc5da6a
--- /dev/null
+++ b/plugin.video.fitnessblenderv2/LICENSE
@@ -0,0 +1,692 @@
+Copyright (c) 2017 Dangelus <dangelus@kodi.tv>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY 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 <http://www.gnu.org/licenses/>
+
+
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ {one line to give the program's name and a brief idea of what it does.}
+ Copyright (C) {year} {name of author}
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ {project} Copyright (C) {year} {fullname}
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+
diff --git a/plugin.video.fitnessblenderv2/README.md b/plugin.video.fitnessblenderv2/README.md
new file mode 100644
index 0000000..d4a3a8c
--- /dev/null
+++ b/plugin.video.fitnessblenderv2/README.md
@@ -0,0 +1,8 @@
+# plugin.video.fitnessblender
+
+![logo](https://github.com/dangelus1138/plugin.video.fitnessblenderv2/raw/master/resources/images/banner.png)
+
+Kodi add-on for the Youtube channel of Fitness Blender https://www.fitnessblender.com/
+
+Fitness Blender provides free full length workout videos, workout routines, healthy recipes and more.
+
diff --git a/plugin.video.fitnessblenderv2/addon.xml b/plugin.video.fitnessblenderv2/addon.xml
new file mode 100644
index 0000000..16c64ec
--- /dev/null
+++ b/plugin.video.fitnessblenderv2/addon.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<addon id="plugin.video.fitnessblenderv2" name="Fitness Blender" version="1.0.2" provider-name="Dangelus">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="script.module.routing" version="0.2.0"/>
+ <import addon="script.module.requests" version="2.12.4"/>
+ <import addon="plugin.video.youtube"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource" library="main.py">
+ <provides>video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <summary lang="en_GB">Fitness Blender provides free full length workout videos, workout routines, healthy recipes and more.</summary>
+ <description lang="en_GB">Fitness Blender offers over 500 free workout videos for every fitness level, and the most effective and affordable workout programs on the web. The goal is to make health and fitness attainable, affordable, and approachable.</description>
+ <language>en pt</language>
+ <platform>all</platform>
+ <license>GPL-3.0</license>
+ <forum>https://forum.kodi.tv/showthread.php?tid=321154</forum>
+ <website>https://www.fitnessblender.com/</website>
+ <email>dangelus@kodi.tv</email>
+ <source>https://github.com/dangelus1138/plugin.video.fitnessblenderv2</source>
+ <news>Fitness Blender provides free full length workout videos, workout routines, healthy recipes and more.</news>
+ <disclaimer>The author of this add-on is in no way affiliated with FitnessBlender.com</disclaimer>
+ <assets>
+ <icon>resources/images/icon.png</icon>
+ <fanart>resources/images/fanart.jpg</fanart>
+ <screenshot>resources/images/screenshot000.png</screenshot>
+ <screenshot>resources/images/screenshot001.png</screenshot>
+ <screenshot>resources/images/screenshot002.png</screenshot>
+ </assets>
+ </extension>
+</addon>
diff --git a/plugin.video.fitnessblenderv2/changelog.txt b/plugin.video.fitnessblenderv2/changelog.txt
new file mode 100644
index 0000000..00240d4
--- /dev/null
+++ b/plugin.video.fitnessblenderv2/changelog.txt
@@ -0,0 +1,6 @@
+v1.0.0
+- The first version of the addon
+v1.0.1
+- Dependency changes
+v1.0.2
+- Cosmetic changes
diff --git a/plugin.video.fitnessblenderv2/main.py b/plugin.video.fitnessblenderv2/main.py
new file mode 100644
index 0000000..9f5c945
--- /dev/null
+++ b/plugin.video.fitnessblenderv2/main.py
@@ -0,0 +1,7 @@
+# -*- coding: utf-8 -*-
+
+from resources.lib import plugin
+
+plugin.run()
+
+
diff --git a/plugin.video.fitnessblenderv2/resources/__init__.py b/plugin.video.fitnessblenderv2/resources/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.fitnessblenderv2/resources/__init__.py
diff --git a/plugin.video.fitnessblenderv2/resources/images/banner.png b/plugin.video.fitnessblenderv2/resources/images/banner.png
new file mode 100644
index 0000000..d0b102f
--- /dev/null
+++ b/plugin.video.fitnessblenderv2/resources/images/banner.png
Binary files differ
diff --git a/plugin.video.fitnessblenderv2/resources/images/fanart.jpg b/plugin.video.fitnessblenderv2/resources/images/fanart.jpg
new file mode 100644
index 0000000..0ad3947
--- /dev/null
+++ b/plugin.video.fitnessblenderv2/resources/images/fanart.jpg
Binary files differ
diff --git a/plugin.video.fitnessblenderv2/resources/images/icon.png b/plugin.video.fitnessblenderv2/resources/images/icon.png
new file mode 100644
index 0000000..e70e5e7
--- /dev/null
+++ b/plugin.video.fitnessblenderv2/resources/images/icon.png
Binary files differ
diff --git a/plugin.video.fitnessblenderv2/resources/images/screenshot000.png b/plugin.video.fitnessblenderv2/resources/images/screenshot000.png
new file mode 100644
index 0000000..ae9995a
--- /dev/null
+++ b/plugin.video.fitnessblenderv2/resources/images/screenshot000.png
Binary files differ
diff --git a/plugin.video.fitnessblenderv2/resources/images/screenshot001.png b/plugin.video.fitnessblenderv2/resources/images/screenshot001.png
new file mode 100644
index 0000000..d5ba48d
--- /dev/null
+++ b/plugin.video.fitnessblenderv2/resources/images/screenshot001.png
Binary files differ
diff --git a/plugin.video.fitnessblenderv2/resources/images/screenshot002.png b/plugin.video.fitnessblenderv2/resources/images/screenshot002.png
new file mode 100644
index 0000000..c2321fe
--- /dev/null
+++ b/plugin.video.fitnessblenderv2/resources/images/screenshot002.png
Binary files differ
diff --git a/plugin.video.fitnessblenderv2/resources/language/resource.language.en_gb/strings.po b/plugin.video.fitnessblenderv2/resources/language/resource.language.en_gb/strings.po
new file mode 100644
index 0000000..a6adc3c
--- /dev/null
+++ b/plugin.video.fitnessblenderv2/resources/language/resource.language.en_gb/strings.po
@@ -0,0 +1,53 @@
+# Kodi Media Center language file
+# Addon Name: Fitness Blender
+# Addon id: plugin.video.fitnessblender
+# Addon Provider: Dangelus
+msgid ""
+msgstr ""
+"Project-Id-Version: XBMC Addons\n"
+"Report-Msgid-Bugs-To: alanwww1@xbmc.org\n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Kodi Translation Team\n"
+"Language-Team: English (http://www.transifex.com/projects/p/xbmc-addons/language/en/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "#32000"
+msgid "All videos"
+msgstr ""
+
+msgctxt "#32001"
+msgid "Watch all uploaded videos"
+msgstr ""
+
+msgctxt "#32002"
+msgid "Videos on the next page"
+msgstr ""
+
+msgctxt "#32003"
+msgid "Could not get channel playlists"
+msgstr ""
+
+msgctxt "#32004"
+msgid "Could not get the playlist video list"
+msgstr ""
+
+msgctxt "#32005"
+msgid "Unable to get video details"
+msgstr ""
+
+msgctxt "#32006"
+msgid "Number of items per page"
+msgstr ""
+
+msgctxt "#32007"
+msgid "Enter directly in the all videos listing"
+msgstr ""
+
+msgctxt "#32008"
+msgid "Next page"
+msgstr ""
diff --git a/plugin.video.fitnessblenderv2/resources/language/resource.language.pt_pt/strings.po b/plugin.video.fitnessblenderv2/resources/language/resource.language.pt_pt/strings.po
new file mode 100644
index 0000000..db2a6b7
--- /dev/null
+++ b/plugin.video.fitnessblenderv2/resources/language/resource.language.pt_pt/strings.po
@@ -0,0 +1,57 @@
+# Kodi Media Center language file
+# Addon Name: Fitness Blender
+# Addon id: plugin.video.fitnessblender
+# Addon Provider: Dangelus
+msgid ""
+msgstr ""
+"Project-Id-Version: XBMC Addons\n"
+"Report-Msgid-Bugs-To: alanwww1@xbmc.org\n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Kodi Translation Team\n"
+"Language-Team: Portuguese (http://www.transifex.com/projects/p/xbmc-addons/language/pt/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: pt\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#This is a comment
+
+msgctxt "#32000"
+msgid "All videos"
+msgstr "Todos os vídeos"
+
+msgctxt "#32001"
+msgid "Watch all uploaded videos"
+msgstr "Veja todos os vídeos do canal"
+
+msgctxt "#32002"
+msgid "Videos on the next page"
+msgstr "Vídeos na próxima página"
+
+msgctxt "#32003"
+msgid "Could not get channel playlists"
+msgstr "Não conseguiu obter as playlists do canal"
+
+msgctxt "#32004"
+msgid "Could not get the playlist video list"
+msgstr "Não conseguiu obter a listagem de videos da playlist"
+
+msgctxt "#32005"
+msgid "Unable to get video details"
+msgstr "Não conseguiu obter os detalhes do vídeo"
+
+msgctxt "#32006"
+msgid "Number of items per page"
+msgstr "Número de items por página"
+
+msgctxt "#32007"
+msgid "Enter directly in the all videos listing"
+msgstr "Entrar directamente para a lista de todos os vídeos"
+
+msgctxt "#32008"
+msgid "Next page"
+msgstr "Próxima página"
+
+
diff --git a/plugin.video.fitnessblenderv2/resources/lib/__init__.py b/plugin.video.fitnessblenderv2/resources/lib/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.fitnessblenderv2/resources/lib/__init__.py
diff --git a/plugin.video.fitnessblenderv2/resources/lib/addonutils.py b/plugin.video.fitnessblenderv2/resources/lib/addonutils.py
new file mode 100644
index 0000000..65c82a3
--- /dev/null
+++ b/plugin.video.fitnessblenderv2/resources/lib/addonutils.py
@@ -0,0 +1,18 @@
+# -*- coding: utf-8 -*-
+import re
+
+def return_duration_as_seconds(string):
+ try:
+ totalseconds = 0
+ hours = re.findall('(\d+)H',string)
+ minutes = re.findall('(\d+)M',string)
+ seconds = re.findall('(\d+)S',string)
+ if hours:
+ totalseconds += 3600*int(hours[0])
+ if minutes:
+ totalseconds += 60*int(minutes[0])
+ if seconds:
+ totalseconds += int(seconds[0])
+ return str(totalseconds)
+ except IndexError:
+ return '0'
diff --git a/plugin.video.fitnessblenderv2/resources/lib/kodiutils.py b/plugin.video.fitnessblenderv2/resources/lib/kodiutils.py
new file mode 100644
index 0000000..1970dcf
--- /dev/null
+++ b/plugin.video.fitnessblenderv2/resources/lib/kodiutils.py
@@ -0,0 +1,85 @@
+# -*- coding: utf-8 -*-
+
+import xbmc
+import xbmcaddon
+import xbmcgui
+import xbmcplugin
+import json as json
+
+ADDON = xbmcaddon.Addon()
+ADDON_ID = ADDON.getAddonInfo("id")
+
+
+def notification(header, message, time=5000, icon=ADDON.getAddonInfo('icon'), sound=True):
+ xbmcgui.Dialog().notification(header, message, icon, time, sound)
+
+
+def show_settings():
+ ADDON.openSettings()
+
+
+def log(message,level):
+ prefix = b"[%s] " % ADDON_ID
+ formatter = prefix + b'%(name)s: %(message)s'
+ try:
+ xbmc.log(formatter, level)
+ except UnicodeEncodeError:
+ xbmc.log(formatter.encode(
+ 'utf-8', 'ignore'), level)
+
+
+def get_setting(setting):
+ return ADDON.getSetting(setting).strip().decode('utf-8')
+
+
+def set_setting(setting, value):
+ ADDON.setSetting(setting, str(value))
+
+
+def get_setting_as_bool(setting):
+ return get_setting(setting).lower() == "true"
+
+
+def get_setting_as_float(setting):
+ try:
+ return float(get_setting(setting))
+ except ValueError:
+ return 0
+
+
+def get_setting_as_int(setting):
+ try:
+ return int(get_setting_as_float(setting))
+ except ValueError:
+ return 0
+
+
+def get_string(string_id):
+ return ADDON.getLocalizedString(string_id).encode('utf-8', 'ignore')
+
+
+def kodi_json_request(params):
+ data = json.dumps(params)
+ request = xbmc.executeJSONRPC(data)
+
+ try:
+ response = json.loads(request)
+ except UnicodeDecodeError:
+ response = json.loads(request.decode('utf-8', 'ignore'))
+
+ try:
+ if 'result' in response:
+ return response['result']
+ return None
+ except KeyError:
+ log("[%s] %s" %
+ (params['method'], response['error']['message']),level=xbmc.LOGWARNING)
+ return None
+
+def add_sort_methods(handle):
+ sort_methods = [xbmcplugin.SORT_METHOD_UNSORTED, xbmcplugin.SORT_METHOD_LABEL,
+ xbmcplugin.SORT_METHOD_DATE, xbmcplugin.SORT_METHOD_DURATION,
+ xbmcplugin.SORT_METHOD_EPISODE]
+ for method in sort_methods:
+ xbmcplugin.addSortMethod(handle, sortMethod=method)
+ return \ No newline at end of file
diff --git a/plugin.video.fitnessblenderv2/resources/lib/plugin.py b/plugin.video.fitnessblenderv2/resources/lib/plugin.py
new file mode 100644
index 0000000..05422fc
--- /dev/null
+++ b/plugin.video.fitnessblenderv2/resources/lib/plugin.py
@@ -0,0 +1,62 @@
+# -*- coding: utf-8 -*-
+
+import routing
+import xbmcaddon
+import xbmcplugin
+from resources.lib import kodiutils
+from resources.lib import youtubelib
+from xbmcgui import ListItem
+from xbmcplugin import addDirectoryItem, endOfDirectory
+
+
+ADDON = xbmcaddon.Addon()
+ICON = ADDON.getAddonInfo("icon")
+FANART = ADDON.getAddonInfo("fanart")
+plugin = routing.Plugin()
+
+
+@plugin.route('/')
+def index():
+ #All videos
+ liz = ListItem("[I]%s[/I]" % (kodiutils.get_string(32000)))
+ liz.setInfo(type="video", infoLabels={"plot": kodiutils.get_string(32001)})
+ liz.setArt({"thumb": ICON, "icon": ICON, "fanart": FANART})
+ addDirectoryItem(plugin.handle, plugin.url_for(all_videos, playlist="all"), liz, True)
+ #Playlists
+ for liz in youtubelib.get_playlists():
+ addDirectoryItem(plugin.handle, plugin.url_for(all_videos, playlist=liz.getProperty("playlist_id")), liz, True)
+ xbmcplugin.setContent(plugin.handle, 'tvshows')
+ endOfDirectory(plugin.handle)
+
+
+@plugin.route('/videos')
+def all_videos():
+ #grab kwargs
+ page_num = int(plugin.args["page"][0]) if "page" in plugin.args.keys() else 1
+ token = plugin.args["token"][0] if "token" in plugin.args.keys() else ""
+ playlist = plugin.args["playlist"][0] if "playlist" in plugin.args.keys() else "all"
+ upload_playlist = youtubelib.get_upload_playlist() if playlist == "all" else playlist
+
+ for liz in youtubelib.get_videos(playlist, upload_playlist, token, page_num):
+ if liz.getProperty("type") == "youtube_video":
+ addDirectoryItem(plugin.handle, plugin.url_for(play, liz.getProperty("videoid")), liz, False)
+ elif liz.getProperty("type") == "next":
+ addDirectoryItem(plugin.handle, plugin.url_for(all_videos, playlist=playlist, page=int(liz.getProperty("page")), token=liz.getProperty("token")), liz, True)
+ kodiutils.add_sort_methods(plugin.handle)
+ xbmcplugin.setContent(plugin.handle, 'episodes')
+ endOfDirectory(plugin.handle)
+
+
+@plugin.route('/play/<videoid>')
+def play(videoid):
+ stream = 'plugin://plugin.video.youtube/play/?video_id=%s' % (videoid)
+ liz = ListItem()
+ liz.setPath(stream)
+ xbmcplugin.setResolvedUrl(plugin.handle, True, liz)
+
+
+def run():
+ if not kodiutils.get_setting_as_bool("enter_all_videos"):
+ plugin.run()
+ else:
+ plugin.redirect("/videos") \ No newline at end of file
diff --git a/plugin.video.fitnessblenderv2/resources/lib/youtubelib.py b/plugin.video.fitnessblenderv2/resources/lib/youtubelib.py
new file mode 100644
index 0000000..1e14177
--- /dev/null
+++ b/plugin.video.fitnessblenderv2/resources/lib/youtubelib.py
@@ -0,0 +1,143 @@
+# -*- coding: utf-8 -*-
+import requests
+import kodiutils
+import addonutils
+import xbmc
+import math
+import re
+import xbmcaddon
+from xbmcgui import ListItem
+
+CHANNEL_ID = kodiutils.get_setting("channel_id")
+YOUTUBE_API_KEY = kodiutils.get_setting("api_key")
+TVSHOWTITLE = "Fitness Blender"
+CAST = [TVSHOWTITLE]
+STATUS = 'in production'
+
+
+def get_playlists():
+ api_endpoint = 'https://www.googleapis.com/youtube/v3/playlists?part=snippet,contentDetails&channelId=%s&maxResults=50&key=%s' % (CHANNEL_ID,YOUTUBE_API_KEY)
+ try:
+ resp = requests.get(api_endpoint).json()
+ except ValueError:
+ kodiutils.log(kodiutils.get_string(32003), xbmc.LOGERROR)
+ if "items" in resp.keys():
+ for playlist in resp["items"]:
+ liz = ListItem(playlist["snippet"]["title"])
+ infolabels = {"plot": playlist["snippet"]["localized"]["description"]}
+ liz.setInfo(type="video", infoLabels=infolabels)
+ liz.setArt({"thumb": playlist["snippet"]["thumbnails"]["high"]["url"], "fanart": xbmcaddon.Addon().getAddonInfo("fanart")})
+ liz.setProperty("type","playlist")
+ liz.setProperty("playlist_id", playlist["id"])
+ yield liz
+
+
+def get_upload_playlist():
+ api_endpoint = 'https://www.googleapis.com/youtube/v3/channels?part=contentDetails&id=%s&key=%s' % (CHANNEL_ID,YOUTUBE_API_KEY)
+ try:
+ resp = requests.get(api_endpoint).json()
+ except ValueError:
+ kodiutils.log(kodiutils.get_string(32004), xbmc.LOGERROR)
+ return None
+ if "items" in resp.keys():
+ uploads_playlist = resp["items"][0]["contentDetails"]["relatedPlaylists"]["uploads"]
+ return uploads_playlist
+
+def get_videos(name,playlist_id,token="",page_num=1):
+ items_per_page = kodiutils.get_setting_as_int("items_per_page")
+ url_api = 'https://www.googleapis.com/youtube/v3/playlistItems?part=id,snippet,contentDetails&maxResults=%s&playlistId=%s&key=%s' \
+ % (str(items_per_page), playlist_id, YOUTUBE_API_KEY)
+ if page_num != 1:
+ url_api += "&pageToken=%s" % (token)
+
+ try:
+ resp = requests.get(url_api).json()
+ except ValueError:
+ kodiutils.log(kodiutils.get_string(32004), xbmc.LOGERROR)
+ resp = None
+
+ if resp:
+ nextpagetoken = resp["nextPageToken"] if "nextPageToken" in resp.keys() else ""
+ availablevideos = resp["pageInfo"]["totalResults"] if "pageInfo" in resp.keys() and "totalResults" in resp["pageInfo"].keys() else 1
+
+ returnedVideos = resp["items"]
+ totalpages = int(math.ceil((float(availablevideos) / items_per_page)))
+ video_ids = []
+ if returnedVideos:
+ for video in returnedVideos:
+ videoid = video["contentDetails"]["videoId"]
+ video_ids.append(videoid)
+ video_ids = ','.join(video_ids)
+ url_api = 'https://www.googleapis.com/youtube/v3/videos?part=snippet,contentDetails&id=%s&key=%s' % (video_ids,YOUTUBE_API_KEY)
+ try:
+ resp = requests.get(url_api).json()
+ except ValueError:
+ kodiutils.log(kodiutils.get_string(32005), xbmc.LOGERROR)
+ resp = None
+
+ if resp:
+ returnedVideos = resp["items"]
+
+ for video in returnedVideos:
+ title = video["snippet"]["title"]
+ plot = video["snippet"]["description"]
+ aired = video["snippet"]["publishedAt"]
+ thumb = video["snippet"]["thumbnails"]["high"]["url"]
+ videoid = video["id"]
+ # process duration
+ duration_string = video["contentDetails"]["duration"]
+ duration = addonutils.return_duration_as_seconds(duration_string)
+ try:
+ aired = re.compile('(.+?)-(.+?)-(.+?)T').findall(aired)[0]
+ date = aired[2] + '.' + aired[1] + '.' + aired[0]
+ aired = aired[0] + '-' + aired[1] + '-' + aired[2]
+ except IndexError:
+ aired = ''
+ date = ''
+
+ infolabels = {'plot': plot.encode('utf-8'), 'aired': aired, 'date': date, 'tvshowtitle': TVSHOWTITLE,
+ 'title': title.encode('utf-8'), 'originaltitle': title.encode('utf-8'), 'status': STATUS,
+ 'cast': CAST, 'duration': duration}
+
+ # Video and audio info
+ video_info = {'codec': 'avc1', 'aspect': 1.78}
+ audio_info = {'codec': 'aac', 'language': 'en'}
+ if video["contentDetails"]["definition"].lower() == 'hd':
+ video_info['width'] = 1280
+ video_info['height'] = 720
+ audio_info['channels'] = 2
+ else:
+ video_info['width'] = 854
+ video_info['height'] = 480
+ audio_info['channels'] = 1
+ if xbmcaddon.Addon(id='plugin.video.youtube').getSetting('kodion.video.quality.ask') == 'false' and xbmcaddon.Addon(
+ id='plugin.video.youtube').getSetting('kodion.video.quality') != '3' and xbmcaddon.Addon(
+ id='plugin.video.youtube').getSetting('kodion.video.quality') != '4':
+ video_info['width'] = 854
+ video_info['height'] = 480
+ audio_info['channels'] = 1
+
+ yield build_video_item(title.encode('utf-8'), thumb, videoid, infolabels, video_info, audio_info)
+
+ if totalpages > 1 and (page_num + 1) <= totalpages:
+ nextpage = ListItem("[B]%s[/B] (%s/%s)" % (kodiutils.get_string(32008), str(page_num), str(totalpages)))
+ nextpage.setProperty("type", "next")
+ nextpage.setProperty("page", str(page_num+1))
+ nextpage.setProperty("token", str(nextpagetoken))
+ nextpage.setInfo(type="video",infoLabels={"plot": kodiutils.get_string(32002)})
+ yield nextpage
+
+def build_video_item(name,thumb,videoid,info,video_info,audio_info):
+ liz=ListItem(name)
+ cm = []
+ cm.append(("Info", 'XBMC.Action(Info)'))
+ thumb = thumb if thumb else xbmcaddon.Addon().getAddonInfo("icon")
+ liz.setProperty("type", "youtube_video")
+ liz.setProperty("videoid",videoid)
+ liz.setArt({'thumb': thumb, 'fanart': xbmcaddon.Addon().getAddonInfo("fanart"), "poster": thumb})
+ liz.setInfo(type="Video", infoLabels=info)
+ liz.addStreamInfo('video', video_info)
+ liz.addStreamInfo('audio', audio_info)
+ liz.setProperty('IsPlayable', 'true')
+ liz.addContextMenuItems(cm, replaceItems=False)
+ return liz
diff --git a/plugin.video.fitnessblenderv2/resources/settings.xml b/plugin.video.fitnessblenderv2/resources/settings.xml
new file mode 100644
index 0000000..42f7e61
--- /dev/null
+++ b/plugin.video.fitnessblenderv2/resources/settings.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<settings>
+ <setting id="enter_all_videos" type="bool" label="32007" default="false" />
+ <setting id="items_per_page" type="slider" label="32006" default="25" range="0,50" />
+ <setting id="api_key" type="text" default="AIzaSyAAsgrIGx4e4AKN0FMp5orxfwjm55PL1js" visible="false"/>
+ <setting id="channel_id" type="text" default="UCiP6wD_tYlYLYh3agzbByWQ" visible="false"/>
+</settings>
+
diff --git a/plugin.video.hak5/addon.xml b/plugin.video.hak5/addon.xml
index 7e0e995..efafba7 100644
--- a/plugin.video.hak5/addon.xml
+++ b/plugin.video.hak5/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.hak5"
name="Hak5"
- version="1.0.0"
+ version="1.0.2"
provider-name="Skipmode A1">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
@@ -14,12 +14,12 @@
</extension>
<extension point="xbmc.addon.metadata">
<summary lang="en_GB">Watch videos from hak5.com</summary>
- <description lang="en_GB">Watch videos from hak5.com. The videos are from the shows Hak5, Haktik, Threatwire, Tekthing, Pineapple University and Metasploit</description>
+ <description lang="en_GB">Watch videos from hak5.com. The videos are from the shows Hak5, Haktik, Threatwire, Tekthing and Metasploit</description>
<disclaimer lang="en_GB">For bugs, requests or general questions visit the hak5.com thread on the Kodi forum</disclaimer>
<language>en</language>
<platform>all</platform>
<license>GNU GENERAL PUBLIC LICENSE. Version 3, June 2007</license>
- <forum></forum>
+ <forum>https://forum.kodi.tv/showthread.php?tid=318316</forum>
<website>http://hak5.com</website>
<email></email>
<source>https://github.com/skipmodea1/plugin.video.hak5</source>
diff --git a/plugin.video.hak5/changelog.txt b/plugin.video.hak5/changelog.txt
index 55706c6..213d41d 100644
--- a/plugin.video.hak5/changelog.txt
+++ b/plugin.video.hak5/changelog.txt
@@ -1,2 +1,9 @@
+v1.0.2 (2017-11-12)
+Fixes due to website changes
+
+v1.0.1 (2017-10-11)
+Fixes due to website changes
+Removed Pinapple University videos
+
v1.0.0 (2017-07-09)
initial version \ No newline at end of file
diff --git a/plugin.video.hak5/resources/lib/hak5_const.py b/plugin.video.hak5/resources/lib/hak5_const.py
index 129de87..0334942 100644
--- a/plugin.video.hak5/resources/lib/hak5_const.py
+++ b/plugin.video.hak5/resources/lib/hak5_const.py
@@ -12,13 +12,12 @@ SETTINGS = xbmcaddon.Addon()
LANGUAGE = SETTINGS.getLocalizedString
IMAGES_PATH = os.path.join(xbmcaddon.Addon().getAddonInfo('path'), 'resources', 'images')
HAK5RECENTLYADDEDURL = 'http://www.hak5.org/category/episodes'
-HAK5SEASONSURLHTTP = 'http://www.hak5.org/category/episodes'
-HAK5SEASONSURLHTTPS = 'https://www.hak5.org/category/episodes'
+HAK5SEASONSURLHTTPS = 'https://www.hak5.org/shows/hak5'
HAKTIKRECENTLYADDEDURL = 'http://www.hak5.org/category/episodes/haktip/page/001'
THREATWIRERECENTLYADDEDURL = 'http://www.hak5.org/category/episodes/threatwire/page/001'
TEKTHINGRECENTLYADDEDURL = 'http://www.hak5.org/category/episodes/tekthing/page/001'
PINEAPPLEUNIVERSITYRECENTLYADDEDURL = 'http://www.hak5.org/category/episodes/pineapple-university'
METASPLOITRECENTLYADDEDURL = 'http://www.hak5.org/category/episodes/metasploit-minute/page/001'
HEADERS = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36'}
-DATE = "2017-07-09"
-VERSION = "1.0.0" \ No newline at end of file
+DATE = "2017-11-12"
+VERSION = "1.0.2" \ No newline at end of file
diff --git a/plugin.video.hak5/resources/lib/hak5_list_episodes.py b/plugin.video.hak5/resources/lib/hak5_list_episodes.py
index 5979c73..fe8192f 100644
--- a/plugin.video.hak5/resources/lib/hak5_list_episodes.py
+++ b/plugin.video.hak5/resources/lib/hak5_list_episodes.py
@@ -95,41 +95,26 @@ class Main:
# xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % (
# ADDON, VERSION, DATE, "html_source", str(html_source)), xbmc.LOGDEBUG)
- # <div id="post-8791" class="blog-item video-item post-8791 post type-post status-publish format-standard has-post-thumbnail hentry category-haktip ...
- # <div class="row ">
- # <div class="col-md-6 col-sm-6">
+ # <div id="post-8843" class="video-item post-8843 post type-post status-publish format-video has-post-thumbnail hentry category-episodes category-hak5 category-season-22 tag-darren-kitchen tag-hack-across-the-planet tag-hak-5 tag-pseudocode-for-life post_format-post-format-video">
# <div class="item-thumbnail">
- # <a href="https://www.hak5.org/episodes/season-22/hak5-2217-bushveld-b-roll-hack-across-the-planet" title="Hak5 2217 – Bushveld B-Roll – Hack Across the Planet">
- # <img width="300" height="169" src="https://www.hak5.org/wp-content/uploads/2017/07/hak5-2217-bushveld-b-roll-hack-a-300x169.jpg" ...
+ # <a href="https://www.hak5.org/episodes/hak5-2216-pseudocode-for-life-2-hack-across-the-planet">
+ # <img width="520" height="293" src="https://www.hak5.org/wp-content/uploads/2017/06/hak5-2216-pseudocode-for-life-2-520x293.jpg" class="attachment-thumb_520x293 size-thumb_520x293 wp-post-image" alt="" srcset="https://www.hak5.org/wp-content/uploads/2017/06/hak5-2216-pseudocode-for-life-2-520x293.jpg 520w, https://www.hak5.org/wp-content/uploads/2017/06/hak5-2216-pseudocode-for-life-2-150x84.jpg 150w, https://www.hak5.org/wp-content/uploads/2017/06/hak5-2216-pseudocode-for-life-2-300x169.jpg 300w, https://www.hak5.org/wp-content/uploads/2017/06/hak5-2216-pseudocode-for-life-2-1024x576.jpg 1024w, https://www.hak5.org/wp-content/uploads/2017/06/hak5-2216-pseudocode-for-life-2-260x146.jpg 260w, https://www.hak5.org/wp-content/uploads/2017/06/hak5-2216-pseudocode-for-life-2-356x200.jpg 356w, https://www.hak5.org/wp-content/uploads/2017/06/hak5-2216-pseudocode-for-life-2-370x208.jpg 370w, https://www.hak5.org/wp-content/uploads/2017/06/hak5-2216-pseudocode-for-life-2-180x101.jpg 180w, https://www.hak5.org/wp-content/uploads/2017/06/hak5-2216-pseudocode-for-life-2-130x73.jpg 130w, https://www.hak5.org/wp-content/uploads/2017/06/hak5-2216-pseudocode-for-life-2-748x421.jpg 748w, https://www.hak5.org/wp-content/uploads/2017/06/hak5-2216-pseudocode-for-life-2-624x351.jpg 624w, https://www.hak5.org/wp-content/uploads/2017/06/hak5-2216-pseudocode-for-life-2.jpg 1280w" sizes="(max-width: 520px) 100vw, 520px" /> <div class="link-overlay fa fa-play"></div>
# </a>
# </div>
- # <div class="clearfix"></div>
- # </div><!--/col6-->
- # <div class="col-md-6 col-sm-6">
- # <div class="item-head row">
- # <div class="col-md-10 col-sm-10 col-xs-9">
- # <h3><a class="maincolor2hover" href="https://www.hak5.org/episodes/season-22/hak5-2217-bushveld-b-roll-hack-across-the-planet" rel="8851"
- # title="Hak5 2217 – Bushveld B-Roll – Hack Across the Planet">Hak5 2217 &#8211; Bushveld B-Roll &#8211; Hack Across the Planet</a></h3>
- # <div class="blog-meta">
- # <span><a href="https://www.hak5.org/author/snubs" title="Posts by Shannon Morse" rel="author">Shannon Morse</a></span> |
- # <span><a href="https://www.hak5.org/category/episodes/season-22" rel="category tag">Season 22</a></span>
- # |
- # <span><a href="https://www.hak5.org/episodes/season-22/hak5-2217-bushveld-b-roll-hack-across-the-planet#respond">0 Comments</a></span>
- # </div>
- # </div>
- # <div class="col-md-2 col-sm-2 col-xs-3">
- # <div class="blog-date">
- # <span>05</span>
- # <span>Jul</span>
+ # <div class="item-head">
+ # <h3><a href="https://www.hak5.org/episodes/hak5-2216-pseudocode-for-life-2-hack-across-the-planet" rel="8843" title="Hak5 2216 – Pseudocode for Life 2 – Hack Across the Planet">Hak5 2216 &#8211; Pseudocode for Life 2 &#8211; Hack Across the Planet</a>
+ # </h3>
+ # <div class="item-info hidden">
+ # <span class="item-author"><a href="https://www.hak5.org/author/snubs" title="Posts by Shannon Morse" rel="author">Shannon Morse</a></span>
+ # <span class="item-date">June 28, 2017</span>
+ # <div class="item-meta">
+ # <span><i class="fa fa-eye"></i> 0</span> <span><i class="fa fa-comment"></i> 0</span> <span><i class="fa fa-thumbs-up"></i> 1</span>
# </div>
# </div>
# </div>
- # <div class="blog-excerpt">
- # <p>Happy 4th of July! Sign up for the London meetup at https://HackAcrossThePlanet.com &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- Shop: ...
- # <a href="https://www.hak5.org/episodes/season-22/hak5-2217-bushveld-b-roll-hack-across-the-planet" class="readmore maincolor2 bordercolor2 bgcolor2hover ...
+ # <div class="item-content hidden">
+ # <p>It&#8217;s better to regret something you have done than something you haven&#8217;t. Regular episodes resume August 2nd. UK meetups July 10-14. Sign up at https://HackAcrossThePlanet.com https://HackAcrossThePlanet.com &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- Shop: http://www.hakshop.com Support: http://www.patreon.com/threatwire Subscribe: http://www.youtube.com/hak5 Our Site: http://www.hak5.org Contact Us: http://www.twitter.com/hak5 Threat Wire RSS: https://shannonmorse.podbean.com/feed/ Threat Wire iTunes: https://itunes.apple.com/us/podcast/threat-wire/id1197048999 Help us with Translations! http://www.youtube.com/timedtext_cs_panel?tab=2&#038;c=UC3s0BtrBJpwNDaflRSoiieQ &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
# </div>
- # </div><!--/col6-->
- # </div><!--/row-->
# <div class="clearfix"></div>
# </div>
@@ -140,8 +125,8 @@ class Main:
for episode in episodes:
- xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % (
- ADDON, VERSION, DATE, "episode)", str(episode)), xbmc.LOGDEBUG)
+ # xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % (
+ # ADDON, VERSION, DATE, "episode", str(episode)), xbmc.LOGDEBUG)
video_page_url = episode.a['href']
@@ -156,7 +141,9 @@ class Main:
xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % (
ADDON, VERSION, DATE, "thumbnail_url", str(thumbnail_url)), xbmc.LOGDEBUG)
- title = episode.a['title']
+ pos_of_title_start = str(episode).find('title="') + len('title="')
+ pos_of_title_end = str(episode).find('"', pos_of_title_start)
+ title = str(episode)[pos_of_title_start:pos_of_title_end]
# Clean up title
try:
@@ -222,29 +209,33 @@ class Main:
blog_date_year = blog_date[blog_date_year_start_pos: blog_date_year_end_pos]
xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % (
- ADDON, VERSION, DATE, "blog_date_year)", str(blog_date_year)), xbmc.LOGDEBUG)
+ ADDON, VERSION, DATE, "blog_date_year", str(blog_date_year)), xbmc.LOGDEBUG)
blog_date_month_start_pos = blog_date_year_end_pos + 1
blog_date_month_end_pos = blog_date_month_start_pos + 2
blog_date_month = blog_date[blog_date_month_start_pos:blog_date_month_end_pos]
xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % (
- ADDON, VERSION, DATE, "blog_date_month)", str(blog_date_month)), xbmc.LOGDEBUG)
+ ADDON, VERSION, DATE, "blog_date_month", str(blog_date_month)), xbmc.LOGDEBUG)
# lets find the blog date day
- blog_date = episode.findAll('div', attrs={'class': re.compile("^" + 'blog-date')})
- blog_date = str(blog_date)
- blog_date_day_start_pos = blog_date.find('<span>')
- blog_date_day_end_pos = blog_date.find('</span>')
- blog_date_day = blog_date[blog_date_day_start_pos + len('<span>'):blog_date_day_end_pos]
+ blog_date = episode.findAll('span', attrs={'class': re.compile("^" + 'item-date')})
- xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % (
- ADDON, VERSION, DATE, "blog_date_day)", str(blog_date_day)), xbmc.LOGDEBUG)
+ if len(blog_date) == 0:
+ blog_date_day = '00'
+ else:
+ blog_date = str(blog_date[0].text)
+ blog_date_day_start_pos = blog_date.find(',') - 2
+ blog_date_day_end_pos = blog_date_day_start_pos + 2
+ blog_date_day = blog_date[blog_date_day_start_pos:blog_date_day_end_pos]
+
+ xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % (
+ ADDON, VERSION, DATE, "blog_date_day", str(blog_date_day)), xbmc.LOGDEBUG)
video_date = blog_date_year + '-' + blog_date_month + '-' + blog_date_day + ' 00:00:01'
xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % (
- ADDON, VERSION, DATE, "video_date)", str(video_date)), xbmc.LOGDEBUG)
+ ADDON, VERSION, DATE, "video_date", str(video_date)), xbmc.LOGDEBUG)
# Unescaping the plot
try:
@@ -252,6 +243,8 @@ class Main:
except:
plot = title
+ xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % (ADDON, VERSION, DATE, "plot", str(plot)), xbmc.LOGDEBUG)
+
add_sort_methods()
context_menu_items = []
@@ -300,6 +293,6 @@ class Main:
xbmcplugin.endOfDirectory(self.plugin_handle)
def add_sort_methods():
- sort_methods = [xbmcplugin.SORT_METHOD_UNSORTED,xbmcplugin.SORT_METHOD_LABEL,xbmcplugin.SORT_METHOD_DATE,xbmcplugin.SORT_METHOD_DURATION,xbmcplugin.SORT_METHOD_EPISODE]
- for method in sort_methods:
- xbmcplugin.addSortMethod(int(sys.argv[1]), sortMethod=method)
+ sort_methods = [xbmcplugin.SORT_METHOD_UNSORTED,xbmcplugin.SORT_METHOD_LABEL,xbmcplugin.SORT_METHOD_DATE,xbmcplugin.SORT_METHOD_DURATION,xbmcplugin.SORT_METHOD_EPISODE]
+ for method in sort_methods:
+ xbmcplugin.addSortMethod(int(sys.argv[1]), sortMethod=method) \ No newline at end of file
diff --git a/plugin.video.hak5/resources/lib/hak5_list_seasons.py b/plugin.video.hak5/resources/lib/hak5_list_seasons.py
index b0544aa..f2d37dc 100644
--- a/plugin.video.hak5/resources/lib/hak5_list_seasons.py
+++ b/plugin.video.hak5/resources/lib/hak5_list_seasons.py
@@ -72,7 +72,8 @@ class Main:
# xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % (
# ADDON, VERSION, DATE, "html_source", str(html_source)), xbmc.LOGDEBUG)
- seasons = soup.findAll('a', attrs={'href': re.compile("^" + HAK5SEASONSURLHTTPS)})
+ #<a href="https://www.hak5.org/category/episodes/season_1" data-ss1507745229="1">Season 1</a>
+ seasons = soup.findAll('a', attrs={'href': re.compile("^" + "https://www.hak5.org/category/episodes/season")})
xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % (
ADDON, VERSION, DATE, "len(seasons)", str(len(seasons))), xbmc.LOGDEBUG)
@@ -136,7 +137,8 @@ class Main:
# Finish creating a virtual folder.
xbmcplugin.endOfDirectory(self.plugin_handle)
+
def add_sort_methods():
- sort_methods = [xbmcplugin.SORT_METHOD_UNSORTED,xbmcplugin.SORT_METHOD_LABEL,xbmcplugin.SORT_METHOD_DATE,xbmcplugin.SORT_METHOD_DURATION,xbmcplugin.SORT_METHOD_EPISODE]
- for method in sort_methods:
- xbmcplugin.addSortMethod(int(sys.argv[1]), sortMethod=method) \ No newline at end of file
+ sort_methods = [xbmcplugin.SORT_METHOD_UNSORTED,xbmcplugin.SORT_METHOD_LABEL,xbmcplugin.SORT_METHOD_DATE,xbmcplugin.SORT_METHOD_DURATION,xbmcplugin.SORT_METHOD_EPISODE]
+ for method in sort_methods:
+ xbmcplugin.addSortMethod(int(sys.argv[1]), sortMethod=method) \ No newline at end of file
diff --git a/plugin.video.hak5/resources/lib/hak5_main.py b/plugin.video.hak5/resources/lib/hak5_main.py
index 49575a6..f1c2105 100644
--- a/plugin.video.hak5/resources/lib/hak5_main.py
+++ b/plugin.video.hak5/resources/lib/hak5_main.py
@@ -10,7 +10,7 @@ import xbmcgui
import xbmcplugin
import os
-from hak5_const import LANGUAGE, IMAGES_PATH, HAK5RECENTLYADDEDURL, HAK5SEASONSURLHTTP, \
+from hak5_const import LANGUAGE, IMAGES_PATH, HAK5RECENTLYADDEDURL, HAK5SEASONSURLHTTPS, \
HAKTIKRECENTLYADDEDURL, THREATWIRERECENTLYADDEDURL, TEKTHINGRECENTLYADDEDURL, PINEAPPLEUNIVERSITYRECENTLYADDEDURL, \
METASPLOITRECENTLYADDEDURL
#
@@ -39,7 +39,7 @@ class Main:
#
# Hak5 Seasons
#
- parameters = {"action": "list-seasons", "plugin_category": LANGUAGE(30302), "url": HAK5SEASONSURLHTTP,
+ parameters = {"action": "list-seasons", "plugin_category": LANGUAGE(30302), "url": HAK5SEASONSURLHTTPS,
"next_page_possible": "False"}
url = self.plugin_url + '?' + urllib.urlencode(parameters)
list_item = xbmcgui.ListItem(LANGUAGE(30302))
@@ -86,22 +86,10 @@ class Main:
xbmcplugin.addDirectoryItem(handle=self.plugin_handle, url=url, listitem=list_item, isFolder=is_folder)
#
- # Pinapple University Recently Added Episodes
- #
- parameters = {"action": "list-episodes", "plugin_category": LANGUAGE(30306), "url": PINEAPPLEUNIVERSITYRECENTLYADDEDURL,
- "next_page_possible": "False"}
- url = self.plugin_url + '?' + urllib.urlencode(parameters)
- list_item = xbmcgui.ListItem(LANGUAGE(30306))
- is_folder = True
- list_item.setArt({'fanart': os.path.join(IMAGES_PATH, 'fanart-blur.jpg')})
- list_item.setProperty('IsPlayable', 'false')
- xbmcplugin.addDirectoryItem(handle=self.plugin_handle, url=url, listitem=list_item, isFolder=is_folder)
-
- #
# Metasploit Recently Added Episodes
#
parameters = {"action": "list-episodes", "plugin_category": LANGUAGE(30307), "url": METASPLOITRECENTLYADDEDURL,
- "next_page_possible": "True"}
+ "next_page_possible": "False"}
url = self.plugin_url + '?' + urllib.urlencode(parameters)
list_item = xbmcgui.ListItem(LANGUAGE(30307))
is_folder = True
diff --git a/plugin.video.hak5/resources/lib/hak5_play.py b/plugin.video.hak5/resources/lib/hak5_play.py
index 685a992..7e0f93d 100644
--- a/plugin.video.hak5/resources/lib/hak5_play.py
+++ b/plugin.video.hak5/resources/lib/hak5_play.py
@@ -82,23 +82,18 @@ class Main:
no_url_found = True
have_valid_url = False
- # <meta property="og:url" content="https://youtu.be/K_EOLgX5Dqs"/>
+ #<iframe width="900" height="506" src="https://www.youtube.com/embed/fYdFNFTSoy4?feature=oembed&#038;wmode=opaque&#038;rel=0&#038;showinfo=0&#038;modestbranding=0"
+ # frameborder="0" gesture="media" allowfullscreen></iframe>
+
# let's extract the youtube-id
html_source = str(html_source)
- start_pos_meta_prop = html_source.find('meta property="og:url"')
- if start_pos_meta_prop > 0:
- search_for_string = '"/>'
- end_pos_meta_prop = html_source.find(search_for_string, start_pos_meta_prop)
- if end_pos_meta_prop > 0:
- # the last 3 characters are removed
- meta_prop = html_source[start_pos_meta_prop: end_pos_meta_prop]
-
- xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % (
- ADDON, VERSION, DATE, "meta_prop", str(meta_prop)), xbmc.LOGDEBUG)
-
- pos_of_last_slash = meta_prop.rfind('/')
- youtube_id = meta_prop[pos_of_last_slash + 1:]
-
+ start_pos_youtube_embed = html_source.find('youtube.com/embed/')
+ if start_pos_youtube_embed > 0:
+ start_pos_youtube_id = start_pos_youtube_embed + len('youtube.com/embed/')
+ search_for_string = '?'
+ end_pos_youtube_id = html_source.find(search_for_string, start_pos_youtube_id)
+ if end_pos_youtube_id > 0:
+ youtube_id = html_source[start_pos_youtube_id:end_pos_youtube_id]
xbmc.log("[ADDON] %s v%s (%s) debug mode, %s = %s" % (
ADDON, VERSION, DATE, "youtube_id", str(youtube_id)), xbmc.LOGDEBUG)
diff --git a/plugin.video.iplayerwww/addon.xml b/plugin.video.iplayerwww/addon.xml
index 0b7ebf7..49292f4 100644
--- a/plugin.video.iplayerwww/addon.xml
+++ b/plugin.video.iplayerwww/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.video.iplayerwww" name="iPlayer WWW" version="3.0.13" provider-name="CaptainT, Cas, ihurst, primaeval">
+<addon id="plugin.video.iplayerwww" name="iPlayer WWW" version="3.0.19" provider-name="CaptainT, Cas, ihurst, primaeval">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
<import addon="script.module.requests" version="2.7.0"/>
@@ -22,6 +22,27 @@
<fanart>resources/fanart.jpg</fanart>
</assets>
<news>
+v3.0.19
+Fixed Channel Highlights.
+
+v3.0.18
+Fixed Highlights (again).
+Fixed BBCiD login.
+Made Added and Watching more robust against some changes.
+
+v3.0.17
+Fixed Highlights.
+
+v3.0.16
+Categories now needs https.
+
+v3.0.15
+Fixed Highlights.
+
+v3.0.14
+Fix for new mediator HTML.
+Live TV now uses a timestamp to avoid problems with "Hide watched".
+
v3.0.13
Fix for full URL for some programmes.
diff --git a/plugin.video.iplayerwww/default.py b/plugin.video.iplayerwww/default.py
index 95264a8..c002c6c 100644
--- a/plugin.video.iplayerwww/default.py
+++ b/plugin.video.iplayerwww/default.py
@@ -120,6 +120,9 @@ elif mode == 105:
elif mode == 106:
Video.ListHighlights(url)
+elif mode == 198:
+ Video.ListMainHighlights(url)
+
elif mode == 107:
Video.ListWatching(logged_in)
diff --git a/plugin.video.iplayerwww/resources/lib/ipwww_common.py b/plugin.video.iplayerwww/resources/lib/ipwww_common.py
index 634cff2..56f4c0b 100644
--- a/plugin.video.iplayerwww/resources/lib/ipwww_common.py
+++ b/plugin.video.iplayerwww/resources/lib/ipwww_common.py
@@ -11,6 +11,7 @@ import cookielib
import urllib
import HTMLParser
import codecs
+import time
import xbmc
import xbmcaddon
@@ -35,7 +36,7 @@ addonid = "plugin.video.iplayerwww"
addoninfo = GetAddonInfo()
DIR_USERDATA = xbmc.translatePath(addoninfo["profile"])
cookie_jar = None
-user_agent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:51.0) Gecko/20100101 Firefox/51.0'
+user_agent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:55.0) Gecko/20100101 Firefox/55.0'
headers = {'User-Agent': user_agent}
@@ -170,7 +171,7 @@ def SignInBBCiD():
'attempts':'0'}
#Regular expression to get 'nonce' from login page
- p = re.compile('form method="post" action="([^""]*)"')
+ p = re.compile('action="([^""]*)"')
with requests.Session() as s:
resp = s.get('https://www.bbc.com/', headers=headers)
@@ -325,7 +326,8 @@ def AddMenuEntry(name, url, mode, iconimage, description, subtitles_url, aired=N
"&description=" + utf8_quote_plus(description) +
"&subtitles_url=" + utf8_quote_plus(subtitles_url) +
"&logged_in=" + str(logged_in))
-
+ if mode in (101,203,113,213):
+ listitem_url = listitem_url + "&time=" + str(time.time())
if aired:
ymd = aired.split('-')
date_string = ymd[2] + '/' + ymd[1] + '/' + ymd[0]
@@ -417,27 +419,27 @@ def CreateBaseDirectory(content_type):
live_mode = 123
AddMenuEntry(translation(30329), 'cbeebies_hd', live_mode,
xbmc.translatePath(
- 'special://home/addons/plugin.video.iplayerwww/media/cbeebies.png'
+ 'special://home/addons/plugin.video.iplayerwww/media/cbeebies_hd.png'
),
'', '')
AddMenuEntry(translation(30330), 'cbbc_hd', live_mode,
xbmc.translatePath(
- 'special://home/addons/plugin.video.iplayerwww/media/cbbc.png'
+ 'special://home/addons/plugin.video.iplayerwww/media/cbbc_hd.png'
),
'', '')
AddMenuEntry(translation(30331), 'cbeebies', 125,
xbmc.translatePath(
- 'special://home/addons/plugin.video.iplayerwww/media/cbeebies.png'
+ 'special://home/addons/plugin.video.iplayerwww/media/cbeebies_hd.png'
),
'', '')
AddMenuEntry(translation(30332), 'cbbc', 125,
xbmc.translatePath(
- 'special://home/addons/plugin.video.iplayerwww/media/cbbc.png'
+ 'special://home/addons/plugin.video.iplayerwww/media/cbbc_hd.png'
),
'', '')
AddMenuEntry(translation(30333), 'p02pnn9d', 131,
xbmc.translatePath(
- 'special://home/addons/plugin.video.iplayerwww/media/cbeebies.png'
+ 'special://home/addons/plugin.video.iplayerwww/media/cbeebies_hd.png'
),
'', '')
return
@@ -445,7 +447,7 @@ def CreateBaseDirectory(content_type):
if content_type == "video":
ShowLicenceWarning()
if ADDON.getSetting("menu_video_highlights") == 'true':
- AddMenuEntry(translation(30300), 'iplayer', 106,
+ AddMenuEntry(translation(30300), 'iplayer', 198,
xbmc.translatePath(
'special://home/addons/plugin.video.iplayerwww/media/top_rated.png'
),
@@ -566,7 +568,7 @@ def CreateBaseDirectory(content_type):
else:
ShowLicenceWarning()
if ADDON.getSetting("menu_video_highlights") == 'true':
- AddMenuEntry((translation(30323)+translation(30300)), 'iplayer', 106,
+ AddMenuEntry((translation(30323)+translation(30300)), 'iplayer', 198,
xbmc.translatePath(
'special://home/addons/plugin.video.iplayerwww/media/top_rated.png'
),
diff --git a/plugin.video.iplayerwww/resources/lib/ipwww_video.py b/plugin.video.iplayerwww/resources/lib/ipwww_video.py
index bb6b291..1a4d0fa 100644
--- a/plugin.video.iplayerwww/resources/lib/ipwww_video.py
+++ b/plugin.video.iplayerwww/resources/lib/ipwww_video.py
@@ -306,7 +306,7 @@ def ScrapeEpisodes(page_url):
for page in page_range:
if page > current_page:
- page_url = 'http://www.bbc.co.uk' + page_base_url + str(page)
+ page_url = 'https://www.bbc.co.uk' + page_base_url + str(page)
html = OpenURL(page_url)
# NOTE remove inner li to match outer li
@@ -671,7 +671,11 @@ def ScrapeMarkup(markup):
r'<a.*?href="(.*?)".*?list-item-link.*?>',
li, flags=(re.DOTALL | re.MULTILINE))
if url_match:
- main_url = url_match.group(1)
+ tmp_url = url_match.group(1)
+ if tmp_url.startswith('http'):
+ main_url = tmp_url
+ else:
+ main_url = 'https://www.bbc.co.uk' + tmp_url
name = ''
title = ''
@@ -725,7 +729,11 @@ def ScrapeMarkup(markup):
r'<a class="view-more-container.+?stat".+?href="(.*?)"',
li, flags=(re.DOTALL | re.MULTILINE))
if episodes_match:
- episodes_url = episodes_match.group(1)
+ tmp_url = episodes_match.group(1)
+ if tmp_url.startswith('http'):
+ episodes_url = tmp_url
+ else:
+ episodes_url = 'https://www.bbc.co.uk' + tmp_url
more = None
# <em class="view-more-heading">27</em>
@@ -820,15 +828,20 @@ def ListHighlights(highlights_url):
"""Creates a list of the programmes in the highlights section.
"""
- html = OpenURL('http://www.bbc.co.uk/%s' % highlights_url)
+ html = OpenURL('https://www.bbc.co.uk/%s' % highlights_url)
- inner_anchors = re.findall(r'<a.*?(?!<a).*?</a>',html,flags=(re.DOTALL | re.MULTILINE))
+ inner_anchors = re.findall(r'href="(?!<a).*?</a>',html,flags=(re.DOTALL | re.MULTILINE))
# First find all groups as we need to store some properties of groups for later reuse.
group_properties = []
# NOTE find episode count first
episode_count = dict()
+
+ # These groups seem to be no longer used, because this function is only used
+ # for Channel Highlights, no longer main Highlights.
+ # Comment the code for now and remove it in the future.
+ """
groups = [a for a in inner_anchors if re.match(
r'<a[^<]*?class="grouped-items__cta.*?data-object-type="group-list-link".*?',
a, flags=(re.DOTALL | re.MULTILINE))]
@@ -892,16 +905,17 @@ def ListHighlights(highlights_url):
AddMenuEntry('[B]%s: %s[/B] - %s %s' % (translation(30314), name, count, translation(30315)),
url, 128, '', '', '')
+ """
# New group types for Channel Highlights.
groups = [a for a in inner_anchors if re.match(
- r'<a[^<]*?class="group__title stat.*?data-object-type="group-list-link".*?',
+ r'[^<]*?class="group__title stat.*?data-object-type="group-list-link".*?',
a, flags=(re.DOTALL | re.MULTILINE))]
for group in groups:
href = ''
href_match = re.match(
- r'<a[^<]*?href="(.*?)"',
+ r'href="(.*?)"',
group, flags=(re.DOTALL | re.MULTILINE))
if href_match:
href = href_match.group(1)
@@ -931,7 +945,7 @@ def ListHighlights(highlights_url):
[position_match.group(1),
name, group_type])
group_details = [a for a in inner_anchors if re.match(
- r'<a[^<]*?class="button.*?group__cta.*?data-object-position="'+
+ r'[^<]*?class="button.*?group__cta.*?data-object-position="'+
re.escape(position_match.group(1))+
r'-ALL".*?',
a, flags=(re.DOTALL | re.MULTILINE))]
@@ -960,7 +974,7 @@ def ListHighlights(highlights_url):
episode_id = ''
# <a\n href="/iplayer/episode/b06tr74y/eastenders-24122015"
id_match = re.match(
- r'<a.*?href="/iplayer/episode/(.*?)/',
+ r'href="/iplayer/episode/(.*?)/',
listed, flags=(re.DOTALL | re.MULTILINE))
if id_match:
episode_id = id_match.group(1)
@@ -1027,11 +1041,11 @@ def ListHighlights(highlights_url):
# <a\nhref="/iplayer/episode/p036gq3z/bbc-music-introducing-from-buddhist-monk-to-rock-star"
if object_type == "editorial-promo":
id_match = re.match(
- r'<a.*?href="(.*?)"',
+ r'href="(.*?)"',
single, flags=(re.DOTALL | re.MULTILINE))
else:
id_match = re.match(
- r'<a.*?href="/iplayer/episode/(.*?)/',
+ r'href="/iplayer/episode/(.*?)/',
single, flags=(re.DOTALL | re.MULTILINE))
if id_match:
episode_id = id_match.group(1)
@@ -1131,6 +1145,113 @@ def ListHighlights(highlights_url):
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_UNSORTED)
+def ListMainHighlights(highlights_url):
+ """Creates a list of the programmes in the highlights section.
+ """
+
+ html = OpenURL('https://www.bbc.co.uk/%s' % highlights_url)
+
+ outer_anchors = re.findall(r'<section class="section(?!<a).*?</section>',
+ html, flags=(re.DOTALL | re.MULTILINE))
+
+ for group in outer_anchors:
+
+ group_type = ''
+ group_type_match = re.search(
+ r'data-section-type="(.*?)"', group, flags=(re.DOTALL | re.MULTILINE))
+ if group_type_match:
+ group_type = group_type_match.group(1)
+
+ # Skip trailers, we can't cope with them as of now.
+ if group_type == "trailers":
+ continue
+
+ inner_anchors = re.findall(r'href="(?!<a).*?</a>', group, flags=(re.DOTALL | re.MULTILINE))
+
+ group_data = []
+
+ for programme in inner_anchors:
+
+ is_group = False
+ button_match = re.search(r'View all', programme, flags=(re.DOTALL | re.MULTILINE))
+ if button_match:
+ is_group = True
+
+ url = ''
+ href_match = re.match(
+ r'href="(.*?)"', programme, flags=(re.DOTALL | re.MULTILINE))
+ if href_match:
+ href = href_match.group(1)
+ if href.startswith('http'):
+ url = href
+ else:
+ url = 'https://www.bbc.co.uk' + href
+
+ name = ''
+ if group_type == "popular":
+ name_match = re.search(
+ r'<span class="typo.+?">(.*?)</span>',
+ programme, flags=(re.DOTALL | re.MULTILINE))
+ else:
+ name_match = re.search(
+ r'item__title.+?>(.*?)</div>',
+ programme, flags=(re.DOTALL | re.MULTILINE))
+ if name_match:
+ name = name_match.group(1)
+
+ if group_type == "popular":
+ subtitle_match = re.search(
+ r'item__subtitle.+?>(.*?)</p>', programme, flags=(re.DOTALL | re.MULTILINE))
+ else:
+ subtitle_match = re.search(
+ r'primary">.*?item__description.+?>(.*?)</div>',
+ programme, flags=(re.DOTALL | re.MULTILINE))
+ if subtitle_match:
+ name = name + ' - ' + subtitle_match.group(1)
+
+ iconimage = ''
+ iconimage_match = re.search(
+ r'images/ic/.*?/(.*?)\.jpg', programme, flags=(re.DOTALL | re.MULTILINE))
+ if iconimage_match:
+ iconimage = "https://ichef.bbci.co.uk/images/ic/832x468/"+iconimage_match.group(1)+".jpg"
+
+ description = ''
+ description_match = re.search(
+ r'secondary">.*?item__description.+?>(.*?)</div>',
+ programme, flags=(re.DOTALL | re.MULTILINE))
+ if description_match:
+ description = description_match.group(1)
+
+ # If this is a group, get the "View all" text.
+ if is_group == True:
+ name_match = re.search(r'label="(.*?)"', programme, flags=(re.DOTALL | re.MULTILINE))
+ if name_match:
+ name = name_match.group(1)
+
+ # We need to postprocess the URL to get categories right
+ if group_type == "category":
+ category = ''
+ category_match = re.search(r'categories/(.*?)/', href, flags=re.DOTALL)
+ if category_match:
+ group_data.append(('[B]%s: %s[/B]' % (translation(30314), name),
+ category_match.group(1), 125))
+ else:
+ group_data.append(('[B]%s: %s[/B]' % (translation(30314), name),
+ url, 128))
+ else:
+ CheckAutoplay(name, url, iconimage, description, '')
+
+ # For whatever reason, all groups appear twice in HTML, but we only want to add unique groups.
+ unique = []
+ [unique.append(item) for item in group_data if item not in unique]
+ for name, url, mode in unique:
+ AddMenuEntry(name, url, mode, '', '', '')
+
+ xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_VIDEO_TITLE)
+ xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_DATE)
+ xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_UNSORTED)
+
+
def ListMostPopular():
"""Scrapes all episodes of the most popular page."""
ScrapeEpisodes("http://www.bbc.co.uk/iplayer/group/most-popular")
@@ -1707,7 +1828,7 @@ def ScrapeAvailableStreams(url):
stream_id_sl = []
stream_id_ad = []
- match = re.search(r'mediator.bind\((.*?), document\.getElementById\(\'tviplayer\'\)\);', html, re.DOTALL)
+ match = re.search(r'window\.mediatorDefer\=page\(document\.getElementById\(\"tviplayer\"\),(.*?)\);', html, re.DOTALL)
if match:
data = match.group(1)
json_data = json.loads(data)
diff --git a/plugin.video.itsapixelthing/LICENSE b/plugin.video.itsapixelthing/LICENSE
new file mode 100644
index 0000000..2c319de
--- /dev/null
+++ b/plugin.video.itsapixelthing/LICENSE
@@ -0,0 +1,692 @@
+Copyright (c) 2017 enen92 <enen92@kodi.tv>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY 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 <http://www.gnu.org/licenses/>
+
+
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ {one line to give the program's name and a brief idea of what it does.}
+ Copyright (C) {year} {name of author}
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ {project} Copyright (C) {year} {fullname}
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+
diff --git a/plugin.video.itsapixelthing/README.md b/plugin.video.itsapixelthing/README.md
new file mode 100644
index 0000000..1407c2c
--- /dev/null
+++ b/plugin.video.itsapixelthing/README.md
@@ -0,0 +1,18 @@
+# plugin.video.itsapixelthing
+
+[![Codacy Badge](https://api.codacy.com/project/badge/Grade/57b7bcad73f541479cdaf66e6d7c0d2c)](https://www.codacy.com/app/92enen/plugin.video.itsapixelthing?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=enen92/plugin.video.itsapixelthing&amp;utm_campaign=Badge_Grade)
+
+![logo](https://github.com/enen92/plugin.video.itsapixelthing/raw/master/resources/images/icon.png)
+
+It's a Pixel THING kodi addon. It's a Pixel THING brings back to life those awesome gems of the golden age of video games with a personal high-quality documentary style of reviews. The industry behind the evolution of gaming, the mighty home computers from the 80s, the rise of video game consoles, all this will be featured in this weekly YouTube show!
+
+### Screenshots
+
+![screen1](https://github.com/enen92/plugin.video.itsapixelthing/raw/master/resources/images/screenshot-1.png)
+
+![screen2](https://github.com/enen92/plugin.video.itsapixelthing/raw/master/resources/images/screenshot-2.png)
+
+![screen3](https://github.com/enen92/plugin.video.itsapixelthing/raw/master/resources/images/screenshot-3.png)
+
+![screen4](https://github.com/enen92/plugin.video.itsapixelthing/raw/master/resources/images/screenshot-4.png)
+
diff --git a/plugin.video.itsapixelthing/addon.xml b/plugin.video.itsapixelthing/addon.xml
new file mode 100644
index 0000000..b504cd6
--- /dev/null
+++ b/plugin.video.itsapixelthing/addon.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<addon id="plugin.video.itsapixelthing" name="It's a Pixel THING" version="1.0.0" provider-name="enen92">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="script.module.routing" version="0.2.0"/>
+ <import addon="script.module.requests" version="2.12.4"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource" library="main.py">
+ <provides>video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <summary lang="en_GB">It's a Pixel THING brings back to life those awesome gems of the golden age of video games with a personal high-quality documentary style of reviews.</summary>
+ <description lang="en_GB">It's a Pixel THING brings back to life those awesome gems of the golden age of video games with a personal high-quality documentary style of reviews.[CR] The industry behind the evolution of gaming, the mighty home computers from the 80s, the rise of video game consoles, all this will be featured in this weekly YouTube show![CR] So, stay tuned and sorry for the accent! ;)</description>
+ <language>en pt</language>
+ <platform>all</platform>
+ <license>GPL-3.0</license>
+ <forum>https://forum.kodi.tv/showthread.php?tid=319639</forum>
+ <website>https://www.youtube.com/user/ThePixelTHING</website>
+ <email>enen92@kodi.tv</email>
+ <source>https://github.com/enen92/plugin.video.itsapixelthing</source>
+ <news>The first version of the addon</news>
+ <disclaimer></disclaimer>
+ <assets>
+ <icon>resources/images/icon.png</icon>
+ <fanart>resources/images/fanart.jpg</fanart>
+ <screenshot>resources/images/screenshot-1.png</screenshot>
+ <screenshot>resources/images/screenshot-2.png</screenshot>
+ <screenshot>resources/images/screenshot-3.png</screenshot>
+ <screenshot>resources/images/screenshot-4.png</screenshot>
+ </assets>
+ </extension>
+</addon>
diff --git a/plugin.video.itsapixelthing/changelog.txt b/plugin.video.itsapixelthing/changelog.txt
new file mode 100644
index 0000000..c1c4b96
--- /dev/null
+++ b/plugin.video.itsapixelthing/changelog.txt
@@ -0,0 +1,2 @@
+v1.0.0
+- The first version of the addon \ No newline at end of file
diff --git a/plugin.video.itsapixelthing/main.py b/plugin.video.itsapixelthing/main.py
new file mode 100644
index 0000000..c438b1d
--- /dev/null
+++ b/plugin.video.itsapixelthing/main.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+
+from resources.lib import plugin
+import xbmcaddon
+
+
+plugin.run()
+
+
diff --git a/plugin.video.itsapixelthing/resources/__init__.py b/plugin.video.itsapixelthing/resources/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.itsapixelthing/resources/__init__.py
diff --git a/plugin.video.itsapixelthing/resources/images/fanart.jpg b/plugin.video.itsapixelthing/resources/images/fanart.jpg
new file mode 100644
index 0000000..a8b07c7
--- /dev/null
+++ b/plugin.video.itsapixelthing/resources/images/fanart.jpg
Binary files differ
diff --git a/plugin.video.itsapixelthing/resources/images/icon.png b/plugin.video.itsapixelthing/resources/images/icon.png
new file mode 100644
index 0000000..39c4efb
--- /dev/null
+++ b/plugin.video.itsapixelthing/resources/images/icon.png
Binary files differ
diff --git a/plugin.video.itsapixelthing/resources/images/screenshot-1.png b/plugin.video.itsapixelthing/resources/images/screenshot-1.png
new file mode 100644
index 0000000..b474bd2
--- /dev/null
+++ b/plugin.video.itsapixelthing/resources/images/screenshot-1.png
Binary files differ
diff --git a/plugin.video.itsapixelthing/resources/images/screenshot-2.png b/plugin.video.itsapixelthing/resources/images/screenshot-2.png
new file mode 100644
index 0000000..add0b18
--- /dev/null
+++ b/plugin.video.itsapixelthing/resources/images/screenshot-2.png
Binary files differ
diff --git a/plugin.video.itsapixelthing/resources/images/screenshot-3.png b/plugin.video.itsapixelthing/resources/images/screenshot-3.png
new file mode 100644
index 0000000..219bd2b
--- /dev/null
+++ b/plugin.video.itsapixelthing/resources/images/screenshot-3.png
Binary files differ
diff --git a/plugin.video.itsapixelthing/resources/images/screenshot-4.png b/plugin.video.itsapixelthing/resources/images/screenshot-4.png
new file mode 100644
index 0000000..a53652d
--- /dev/null
+++ b/plugin.video.itsapixelthing/resources/images/screenshot-4.png
Binary files differ
diff --git a/plugin.video.itsapixelthing/resources/language/resource.language.en_gb/strings.po b/plugin.video.itsapixelthing/resources/language/resource.language.en_gb/strings.po
new file mode 100644
index 0000000..cfc8717
--- /dev/null
+++ b/plugin.video.itsapixelthing/resources/language/resource.language.en_gb/strings.po
@@ -0,0 +1,53 @@
+# Kodi Media Center language file
+# Addon Name: It's a Pixel THING
+# Addon id: plugin.video.itsapixelthing
+# Addon Provider: enen92
+msgid ""
+msgstr ""
+"Project-Id-Version: XBMC Addons\n"
+"Report-Msgid-Bugs-To: alanwww1@xbmc.org\n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Kodi Translation Team\n"
+"Language-Team: English (http://www.transifex.com/projects/p/xbmc-addons/language/en/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "#32000"
+msgid "All videos"
+msgstr ""
+
+msgctxt "#32001"
+msgid "Watch all uploaded videos"
+msgstr ""
+
+msgctxt "#32002"
+msgid "Videos on the next page"
+msgstr ""
+
+msgctxt "#32003"
+msgid "Could not get channel playlists"
+msgstr ""
+
+msgctxt "#32004"
+msgid "Could not get the playlist video list"
+msgstr ""
+
+msgctxt "#32005"
+msgid "Unable to get video details"
+msgstr ""
+
+msgctxt "#32006"
+msgid "Number of items per page"
+msgstr ""
+
+msgctxt "#32007"
+msgid "Enter directly in the all videos listing"
+msgstr ""
+
+msgctxt "#32008"
+msgid "Next page"
+msgstr ""
diff --git a/plugin.video.itsapixelthing/resources/language/resource.language.pt_pt/strings.po b/plugin.video.itsapixelthing/resources/language/resource.language.pt_pt/strings.po
new file mode 100644
index 0000000..7e805a1
--- /dev/null
+++ b/plugin.video.itsapixelthing/resources/language/resource.language.pt_pt/strings.po
@@ -0,0 +1,57 @@
+# Kodi Media Center language file
+# Addon Name: It's a Pixel THING
+# Addon id: plugin.video.itsapixelthing
+# Addon Provider: enen92
+msgid ""
+msgstr ""
+"Project-Id-Version: XBMC Addons\n"
+"Report-Msgid-Bugs-To: alanwww1@xbmc.org\n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Kodi Translation Team\n"
+"Language-Team: Portuguese (http://www.transifex.com/projects/p/xbmc-addons/language/pt/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: pt\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#This is a comment
+
+msgctxt "#32000"
+msgid "All videos"
+msgstr "Todos os vídeos"
+
+msgctxt "#32001"
+msgid "Watch all uploaded videos"
+msgstr "Veja todos os vídeos do canal"
+
+msgctxt "#32002"
+msgid "Videos on the next page"
+msgstr "Vídeos na próxima página"
+
+msgctxt "#32003"
+msgid "Could not get channel playlists"
+msgstr "Não conseguiu obter as playlists do canal"
+
+msgctxt "#32004"
+msgid "Could not get the playlist video list"
+msgstr "Não conseguiu obter a listagem de videos da playlist"
+
+msgctxt "#32005"
+msgid "Unable to get video details"
+msgstr "Não conseguiu obter os detalhes do vídeo"
+
+msgctxt "#32006"
+msgid "Number of items per page"
+msgstr "Número de items por página"
+
+msgctxt "#32007"
+msgid "Enter directly in the all videos listing"
+msgstr "Entrar directamente para a lista de todos os vídeos"
+
+msgctxt "#32008"
+msgid "Next page"
+msgstr "Próxima página"
+
+
diff --git a/plugin.video.itsapixelthing/resources/lib/__init__.py b/plugin.video.itsapixelthing/resources/lib/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.itsapixelthing/resources/lib/__init__.py
diff --git a/plugin.video.itsapixelthing/resources/lib/addonutils.py b/plugin.video.itsapixelthing/resources/lib/addonutils.py
new file mode 100644
index 0000000..65c82a3
--- /dev/null
+++ b/plugin.video.itsapixelthing/resources/lib/addonutils.py
@@ -0,0 +1,18 @@
+# -*- coding: utf-8 -*-
+import re
+
+def return_duration_as_seconds(string):
+ try:
+ totalseconds = 0
+ hours = re.findall('(\d+)H',string)
+ minutes = re.findall('(\d+)M',string)
+ seconds = re.findall('(\d+)S',string)
+ if hours:
+ totalseconds += 3600*int(hours[0])
+ if minutes:
+ totalseconds += 60*int(minutes[0])
+ if seconds:
+ totalseconds += int(seconds[0])
+ return str(totalseconds)
+ except IndexError:
+ return '0'
diff --git a/plugin.video.itsapixelthing/resources/lib/kodiutils.py b/plugin.video.itsapixelthing/resources/lib/kodiutils.py
new file mode 100644
index 0000000..1970dcf
--- /dev/null
+++ b/plugin.video.itsapixelthing/resources/lib/kodiutils.py
@@ -0,0 +1,85 @@
+# -*- coding: utf-8 -*-
+
+import xbmc
+import xbmcaddon
+import xbmcgui
+import xbmcplugin
+import json as json
+
+ADDON = xbmcaddon.Addon()
+ADDON_ID = ADDON.getAddonInfo("id")
+
+
+def notification(header, message, time=5000, icon=ADDON.getAddonInfo('icon'), sound=True):
+ xbmcgui.Dialog().notification(header, message, icon, time, sound)
+
+
+def show_settings():
+ ADDON.openSettings()
+
+
+def log(message,level):
+ prefix = b"[%s] " % ADDON_ID
+ formatter = prefix + b'%(name)s: %(message)s'
+ try:
+ xbmc.log(formatter, level)
+ except UnicodeEncodeError:
+ xbmc.log(formatter.encode(
+ 'utf-8', 'ignore'), level)
+
+
+def get_setting(setting):
+ return ADDON.getSetting(setting).strip().decode('utf-8')
+
+
+def set_setting(setting, value):
+ ADDON.setSetting(setting, str(value))
+
+
+def get_setting_as_bool(setting):
+ return get_setting(setting).lower() == "true"
+
+
+def get_setting_as_float(setting):
+ try:
+ return float(get_setting(setting))
+ except ValueError:
+ return 0
+
+
+def get_setting_as_int(setting):
+ try:
+ return int(get_setting_as_float(setting))
+ except ValueError:
+ return 0
+
+
+def get_string(string_id):
+ return ADDON.getLocalizedString(string_id).encode('utf-8', 'ignore')
+
+
+def kodi_json_request(params):
+ data = json.dumps(params)
+ request = xbmc.executeJSONRPC(data)
+
+ try:
+ response = json.loads(request)
+ except UnicodeDecodeError:
+ response = json.loads(request.decode('utf-8', 'ignore'))
+
+ try:
+ if 'result' in response:
+ return response['result']
+ return None
+ except KeyError:
+ log("[%s] %s" %
+ (params['method'], response['error']['message']),level=xbmc.LOGWARNING)
+ return None
+
+def add_sort_methods(handle):
+ sort_methods = [xbmcplugin.SORT_METHOD_UNSORTED, xbmcplugin.SORT_METHOD_LABEL,
+ xbmcplugin.SORT_METHOD_DATE, xbmcplugin.SORT_METHOD_DURATION,
+ xbmcplugin.SORT_METHOD_EPISODE]
+ for method in sort_methods:
+ xbmcplugin.addSortMethod(handle, sortMethod=method)
+ return \ No newline at end of file
diff --git a/plugin.video.itsapixelthing/resources/lib/plugin.py b/plugin.video.itsapixelthing/resources/lib/plugin.py
new file mode 100644
index 0000000..33e75a6
--- /dev/null
+++ b/plugin.video.itsapixelthing/resources/lib/plugin.py
@@ -0,0 +1,62 @@
+# -*- coding: utf-8 -*-
+
+import routing
+import xbmcaddon
+import xbmcplugin
+from resources.lib import kodiutils
+from resources.lib import youtubelib
+from xbmcgui import ListItem
+from xbmcplugin import addDirectoryItem, endOfDirectory
+
+
+ADDON = xbmcaddon.Addon()
+ICON = ADDON.getAddonInfo("icon")
+FANART = ADDON.getAddonInfo("fanart")
+plugin = routing.Plugin()
+
+
+@plugin.route('/')
+def index():
+ #All videos
+ liz = ListItem("[I]%s[/I]" % (kodiutils.get_string(32000)))
+ liz.setInfo(type="video", infoLabels={"plot": kodiutils.get_string(32001)})
+ liz.setArt({"thumb": ICON, "icon": ICON, "fanart": FANART})
+ addDirectoryItem(plugin.handle, plugin.url_for(all_videos, playlist="all"), liz, True)
+ #Playlists
+ for liz in youtubelib.get_playlists():
+ addDirectoryItem(plugin.handle, plugin.url_for(all_videos, playlist=liz.getProperty("playlist_id")), liz, True)
+ xbmcplugin.setContent(plugin.handle, 'tvshows')
+ endOfDirectory(plugin.handle)
+
+
+@plugin.route('/videos')
+def all_videos():
+ #grab kwargs
+ page_num = int(plugin.args["page"][0]) if "page" in plugin.args.keys() else 1
+ token = plugin.args["token"][0] if "token" in plugin.args.keys() else ""
+ playlist = plugin.args["playlist"][0] if "playlist" in plugin.args.keys() else "all"
+ upload_playlist = youtubelib.get_upload_playlist() if playlist == "all" else playlist
+
+ for liz in youtubelib.get_videos(playlist, upload_playlist, token, page_num):
+ if liz.getProperty("type") == "youtube_video":
+ addDirectoryItem(plugin.handle, plugin.url_for(play, liz.getProperty("videoid")), liz, False)
+ elif liz.getProperty("type") == "next":
+ addDirectoryItem(plugin.handle, plugin.url_for(all_videos, playlist=playlist, page=int(liz.getProperty("page")), token=liz.getProperty("token")), liz, True)
+ kodiutils.add_sort_methods(plugin.handle)
+ xbmcplugin.setContent(plugin.handle, 'episodes')
+ endOfDirectory(plugin.handle)
+
+
+@plugin.route('/play/<videoid>')
+def play(videoid):
+ stream = 'plugin://plugin.video.youtube/play/?video_id=%s' % (videoid)
+ liz = ListItem()
+ liz.setPath(stream)
+ xbmcplugin.setResolvedUrl(plugin.handle, True, liz)
+
+
+def run():
+ if not kodiutils.get_setting_as_bool("enter_all_videos"):
+ plugin.run()
+ else:
+ plugin.redirect("/videos")
diff --git a/plugin.video.itsapixelthing/resources/lib/youtubelib.py b/plugin.video.itsapixelthing/resources/lib/youtubelib.py
new file mode 100644
index 0000000..d53f830
--- /dev/null
+++ b/plugin.video.itsapixelthing/resources/lib/youtubelib.py
@@ -0,0 +1,143 @@
+# -*- coding: utf-8 -*-
+import requests
+import kodiutils
+import addonutils
+import xbmc
+import math
+import re
+import xbmcaddon
+from xbmcgui import ListItem
+
+CHANNEL_ID = kodiutils.get_setting("channel_id")
+YOUTUBE_API_KEY = kodiutils.get_setting("api_key")
+TVSHOWTITLE = "It's a Pixel THING"
+CAST = [TVSHOWTITLE]
+STATUS = 'in production'
+
+
+def get_playlists():
+ api_endpoint = 'https://www.googleapis.com/youtube/v3/playlists?part=snippet,contentDetails&channelId=%s&maxResults=50&key=%s' % (CHANNEL_ID,YOUTUBE_API_KEY)
+ try:
+ resp = requests.get(api_endpoint).json()
+ except ValueError:
+ kodiutils.log(kodiutils.get_string(32003), xbmc.LOGERROR)
+ if "items" in resp.keys():
+ for playlist in resp["items"]:
+ liz = ListItem(playlist["snippet"]["title"])
+ infolabels = {"plot": playlist["snippet"]["localized"]["description"]}
+ liz.setInfo(type="video", infoLabels=infolabels)
+ liz.setArt({"thumb": playlist["snippet"]["thumbnails"]["high"]["url"], "fanart": xbmcaddon.Addon().getAddonInfo("fanart")})
+ liz.setProperty("type","playlist")
+ liz.setProperty("playlist_id", playlist["id"])
+ yield liz
+
+
+def get_upload_playlist():
+ api_endpoint = 'https://www.googleapis.com/youtube/v3/channels?part=contentDetails&id=%s&key=%s' % (CHANNEL_ID,YOUTUBE_API_KEY)
+ try:
+ resp = requests.get(api_endpoint).json()
+ except ValueError:
+ kodiutils.log(kodiutils.get_string(32004), xbmc.LOGERROR)
+ return None
+ if "items" in resp.keys():
+ uploads_playlist = resp["items"][0]["contentDetails"]["relatedPlaylists"]["uploads"]
+ return uploads_playlist
+
+def get_videos(name,playlist_id,token="",page_num=1):
+ items_per_page = kodiutils.get_setting_as_int("items_per_page")
+ url_api = 'https://www.googleapis.com/youtube/v3/playlistItems?part=id,snippet,contentDetails&maxResults=%s&playlistId=%s&key=%s' \
+ % (str(items_per_page), playlist_id, YOUTUBE_API_KEY)
+ if page_num != 1:
+ url_api += "&pageToken=%s" % (token)
+
+ try:
+ resp = requests.get(url_api).json()
+ except ValueError:
+ kodiutils.log(kodiutils.get_string(32004), xbmc.LOGERROR)
+ resp = None
+
+ if resp:
+ nextpagetoken = resp["nextPageToken"] if "nextPageToken" in resp.keys() else ""
+ availablevideos = resp["pageInfo"]["totalResults"] if "pageInfo" in resp.keys() and "totalResults" in resp["pageInfo"].keys() else 1
+
+ returnedVideos = resp["items"]
+ totalpages = int(math.ceil((float(availablevideos) / items_per_page)))
+ video_ids = []
+ if returnedVideos:
+ for video in returnedVideos:
+ videoid = video["contentDetails"]["videoId"]
+ video_ids.append(videoid)
+ video_ids = ','.join(video_ids)
+ url_api = 'https://www.googleapis.com/youtube/v3/videos?part=snippet,contentDetails&id=%s&key=%s' % (video_ids,YOUTUBE_API_KEY)
+ try:
+ resp = requests.get(url_api).json()
+ except ValueError:
+ kodiutils.log(kodiutils.get_string(32005), xbmc.LOGERROR)
+ resp = None
+
+ if resp:
+ returnedVideos = resp["items"]
+
+ for video in returnedVideos:
+ title = video["snippet"]["title"]
+ plot = video["snippet"]["description"]
+ aired = video["snippet"]["publishedAt"]
+ thumb = video["snippet"]["thumbnails"]["high"]["url"]
+ videoid = video["id"]
+ # process duration
+ duration_string = video["contentDetails"]["duration"]
+ duration = addonutils.return_duration_as_seconds(duration_string)
+ try:
+ aired = re.compile('(.+?)-(.+?)-(.+?)T').findall(aired)[0]
+ date = aired[2] + '.' + aired[1] + '.' + aired[0]
+ aired = aired[0] + '-' + aired[1] + '-' + aired[2]
+ except IndexError:
+ aired = ''
+ date = ''
+
+ infolabels = {'plot': plot.encode('utf-8'), 'aired': aired, 'date': date, 'tvshowtitle': TVSHOWTITLE,
+ 'title': title.encode('utf-8'), 'originaltitle': title.encode('utf-8'), 'status': STATUS,
+ 'cast': CAST, 'duration': duration}
+
+ # Video and audio info
+ video_info = {'codec': 'avc1', 'aspect': 1.78}
+ audio_info = {'codec': 'aac', 'language': 'en'}
+ if video["contentDetails"]["definition"].lower() == 'hd':
+ video_info['width'] = 1280
+ video_info['height'] = 720
+ audio_info['channels'] = 2
+ else:
+ video_info['width'] = 854
+ video_info['height'] = 480
+ audio_info['channels'] = 1
+ if xbmcaddon.Addon(id='plugin.video.youtube').getSetting('kodion.video.quality.ask') == 'false' and xbmcaddon.Addon(
+ id='plugin.video.youtube').getSetting('kodion.video.quality') != '3' and xbmcaddon.Addon(
+ id='plugin.video.youtube').getSetting('kodion.video.quality') != '4':
+ video_info['width'] = 854
+ video_info['height'] = 480
+ audio_info['channels'] = 1
+
+ yield build_video_item(title.encode('utf-8'), thumb, videoid, infolabels, video_info, audio_info)
+
+ if totalpages > 1 and (page_num + 1) <= totalpages:
+ nextpage = ListItem("[B]%s[/B] (%s/%s)" % (kodiutils.get_string(32008), str(page_num), str(totalpages)))
+ nextpage.setProperty("type", "next")
+ nextpage.setProperty("page", str(page_num+1))
+ nextpage.setProperty("token", str(nextpagetoken))
+ nextpage.setInfo(type="video",infoLabels={"plot": kodiutils.get_string(32002)})
+ yield nextpage
+
+def build_video_item(name,thumb,videoid,info,video_info,audio_info):
+ liz=ListItem(name)
+ cm = []
+ cm.append(("Info", 'XBMC.Action(Info)'))
+ thumb = thumb if thumb else xbmcaddon.Addon().getAddonInfo("icon")
+ liz.setProperty("type", "youtube_video")
+ liz.setProperty("videoid",videoid)
+ liz.setArt({'thumb': thumb, 'fanart': xbmcaddon.Addon().getAddonInfo("fanart"), "poster": thumb})
+ liz.setInfo(type="Video", infoLabels=info)
+ liz.addStreamInfo('video', video_info)
+ liz.addStreamInfo('audio', audio_info)
+ liz.setProperty('IsPlayable', 'true')
+ liz.addContextMenuItems(cm, replaceItems=False)
+ return liz \ No newline at end of file
diff --git a/plugin.video.itsapixelthing/resources/settings.xml b/plugin.video.itsapixelthing/resources/settings.xml
new file mode 100644
index 0000000..43569f3
--- /dev/null
+++ b/plugin.video.itsapixelthing/resources/settings.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<settings>
+ <setting id="enter_all_videos" type="bool" label="32007" default="false" />
+ <setting id="items_per_page" type="slider" label="32006" default="25" range="0,50" />
+ <setting id="api_key" type="text" default="AIzaSyAxaHJTQ5zgh86wk7geOwm-y0YyNMcEkSc" visible="false"/>
+ <setting id="channel_id" type="text" default="UCBmhEEQ5dCAWfCuTNrSplMw" visible="false"/>
+</settings>
+
diff --git a/plugin.video.johnlocker/LICENSE.txt b/plugin.video.johnlocker/LICENSE.txt
new file mode 100644
index 0000000..d159169
--- /dev/null
+++ b/plugin.video.johnlocker/LICENSE.txt
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/plugin.video.johnlocker/addon.py b/plugin.video.johnlocker/addon.py
new file mode 100644
index 0000000..ec446a2
--- /dev/null
+++ b/plugin.video.johnlocker/addon.py
@@ -0,0 +1,141 @@
+# -*- coding: utf-8 -*-
+# Copyright: (c) 2016 William Forde (willforde+kodi@gmail.com)
+#
+# License: GPLv2, see LICENSE for more details
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+from __future__ import unicode_literals
+from codequick import Route, Resolver, Listitem, run, utils
+
+# Base url constructor
+url_constructor = utils.urljoin_partial("http://johnlocker.com")
+
+
+@Route.register
+def root(plugin):
+ """
+ Lists all categories and link's to 'Shows', 'MsMojo' and 'All videos'.
+
+ site: http://johnlocker.com
+
+ :param Route plugin: Tools related to callback.
+ :return: A generator of listitems.
+ """
+ url = url_constructor("/us")
+ source = plugin.request.get(url)
+
+ # Add link to recent videos
+ yield Listitem.recent(recent)
+
+ # Parse the categories
+ root_elem = source.parse("ul", attrs={"id": "menu-category-items primary-menu"})
+ for elem in root_elem.iterfind("./li/a"):
+ item = Listitem()
+ item.label = elem.text
+ item.set_callback(video_list, url=elem.get("href"))
+ yield item
+
+
+@Route.register
+def recent(plugin):
+ """
+ List all recent videos from the rss feed.
+
+ :param Route plugin: Tools related to Route callbacks.
+ :return: A generator of listitems.
+ """
+ url = "http://feeds.feedburner.com/johnlockerv3"
+ source = plugin.request.get(url)
+
+ # Pars all the videos
+ root_elem = source.xml()
+ for elem in root_elem.iterfind("./channel/item"):
+ item = Listitem()
+
+ date = elem.findtext("pubDate")
+ item.info.date(date[:date.find("+") - 1], "%a, %d %b %Y %H:%M:%S")
+ item.info["genre"] = elem.findall("category")[0].text
+
+ # Split title into label and plot
+ title, _, plot = elem.findtext("title").partition("\u2013")
+ item.info["plot"] = plot.split("(", 1)[0].strip()
+ item.label = title.split("(", 1)[0].strip()
+
+ item.set_callback(play_video, url=elem.findtext("comments"))
+ yield item
+
+
+@Route.register
+def video_list(plugin, url):
+ """
+ List all videos for given url.
+
+ site: http://johnlocker.com/category/science-tech/
+
+ :param Route plugin: Tools related to Route callbacks.
+ :param unicode url: The url to a list of videos.
+ :return: A generator of listitems.
+ """
+ url = url_constructor(url)
+ source = plugin.request.get(url)
+
+ # Parse video content
+ root_elem = source.parse("main", attrs={"id": "main"})
+ for elem in root_elem.iterfind("./div/article"):
+ a_tag = elem.find(".//a[@rel='bookmark']")
+ item = Listitem()
+ item.label = a_tag.text.split("(", 1)[0].strip()
+ url = a_tag.get("href")
+
+ date = elem.find(".//time[@datetime]").get("datetime")
+ item.info.date(date[:date.find("+")], "%Y-%m-%dT%H:%M:%S")
+ item.info["count"] = elem.find(".//span[@class='entry-view']").text.split(" ", 1)[0].replace(",", "")
+
+ # Extract video source url using post id to help with search
+ post_id = elem.get("id").split("-", 1)[-1]
+ iframe_node = elem.find("./div[@id='entry-video-%s']//iframe" % post_id)
+ if iframe_node is not None:
+ url = iframe_node.get("src")
+
+ thumb = elem.find("./a/img")
+ if thumb is not None:
+ item.art["thumb"] = thumb.get("src")
+
+ item.set_callback(play_video, url=url)
+ yield item
+
+ next_page = root_elem.find(".//nav/a[@class='next page-numbers']")
+ if next_page is not None:
+ yield Listitem.next_page(url=next_page.get("href"))
+
+
+@Resolver.register
+def play_video(plugin, url):
+ """
+ Resolve video url.
+
+ site: http://johnlocker.com/science-tech/bbc-horizon-secrets-of-the-solar-system-2015-dailymotion-com/
+
+ :param Resolver plugin: Tools related to Resolver callbacks.
+ :param unicode url: The url to a video.
+ :return: A playable video url.
+ """
+ url = url_constructor(url)
+ return plugin.extract_source(url)
+
+
+if __name__ == "__main__":
+ run()
diff --git a/plugin.video.johnlocker/addon.xml b/plugin.video.johnlocker/addon.xml
new file mode 100644
index 0000000..c622f6d
--- /dev/null
+++ b/plugin.video.johnlocker/addon.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<addon id="plugin.video.johnlocker" name="JohnLocker" provider-name="willforde" version="3.0.0">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="script.module.codequick" version="0.9.0"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource" library="addon.py">
+ <provides>video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <summary lang="en_GB">JohnLocker documentary videos.</summary>
+ <description lang="en_GB">JohnLocker.com was created in 2007 with the sole purpose of spreading and promoting knowledge using documentary videos.</description>
+ <license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license>
+ <source>https://github.com/willforde/plugin.video.johnlocker</source>
+ <forum>http://forum.kodi.tv/showthread.php?tid=178796</forum>
+ <website>http://johnlocker.com</website>
+ <email>willforde+addon@gmail.com</email>
+ <platform>all</platform>
+ <language>en</language>
+ <assets>
+ <icon>resources/icon.png</icon>
+ <fanart>resources/fanart.jpg</fanart>
+ <screenshot>resources/screenshots/screenshot000.jpg</screenshot>
+ <screenshot>resources/screenshots/screenshot001.jpg</screenshot>
+ <screenshot>resources/screenshots/screenshot002.jpg</screenshot>
+ </assets>
+ <news>[upd] Upgraded to use the codequick framework.</news>
+ </extension>
+</addon>
diff --git a/plugin.video.johnlocker/resources/fanart.jpg b/plugin.video.johnlocker/resources/fanart.jpg
new file mode 100644
index 0000000..02afb9b
--- /dev/null
+++ b/plugin.video.johnlocker/resources/fanart.jpg
Binary files differ
diff --git a/plugin.video.johnlocker/resources/icon.png b/plugin.video.johnlocker/resources/icon.png
new file mode 100644
index 0000000..7686227
--- /dev/null
+++ b/plugin.video.johnlocker/resources/icon.png
Binary files differ
diff --git a/plugin.video.johnlocker/resources/screenshots/screenshot000.jpg b/plugin.video.johnlocker/resources/screenshots/screenshot000.jpg
new file mode 100644
index 0000000..2ef5a00
--- /dev/null
+++ b/plugin.video.johnlocker/resources/screenshots/screenshot000.jpg
Binary files differ
diff --git a/plugin.video.johnlocker/resources/screenshots/screenshot001.jpg b/plugin.video.johnlocker/resources/screenshots/screenshot001.jpg
new file mode 100644
index 0000000..79a558a
--- /dev/null
+++ b/plugin.video.johnlocker/resources/screenshots/screenshot001.jpg
Binary files differ
diff --git a/plugin.video.johnlocker/resources/screenshots/screenshot002.jpg b/plugin.video.johnlocker/resources/screenshots/screenshot002.jpg
new file mode 100644
index 0000000..851c2f9
--- /dev/null
+++ b/plugin.video.johnlocker/resources/screenshots/screenshot002.jpg
Binary files differ
diff --git a/plugin.video.kla.tv/LICENSE.txt b/plugin.video.kla.tv/LICENSE.txt
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/plugin.video.kla.tv/LICENSE.txt
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/plugin.video.kla.tv/addon.py b/plugin.video.kla.tv/addon.py
new file mode 100644
index 0000000..d861008
--- /dev/null
+++ b/plugin.video.kla.tv/addon.py
@@ -0,0 +1,180 @@
+# -*- coding: cp1252 -*-
+import urllib, urllib2, re, xbmcplugin, xbmcgui, json
+import xbmcaddon
+import sys
+
+from StringIO import StringIO
+import gzip
+
+# Set default encoding to 'UTF-8' instead of 'ascii'
+reload(sys)
+sys.setdefaultencoding("UTF8")
+
+addon = xbmcaddon.Addon('plugin.video.kla.tv')
+__language__ = addon.getLocalizedString
+__icon__ = addon.getAddonInfo('icon')
+__fanart__ = addon.getAddonInfo('fanart')
+
+lang_setting = max([int(addon.getSetting('LanguageID') or 0) or 0, 0])
+
+if lang_setting >= 30951:
+ lang_setting -= 30951
+
+exp_lang_codes = ['en', 'de', 'fr', 'pl']
+payload_index = {
+ "en": 2,
+ "de": 1,
+ "pl": 6,
+ "fr": 3
+}
+
+if lang_setting == 0:
+ lang_id = addon.getLocalizedString(id=30950)
+else:
+ lang_id = exp_lang_codes[lang_setting-1]
+
+payload_id = payload_index.get(lang_id, 2)
+
+
+base_headers = {
+ "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46",
+ "Accept-Encoding": "gzip"
+}
+
+page_headers = base_headers.copy()
+page_headers.update({
+ "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
+})
+
+api_headers = base_headers.copy()
+api_headers.update({
+ "Accept": "application/json, text/plain, */*",
+ "Content-Type": "application/json;charset=utf-8"
+})
+
+
+def decode_response(response):
+ if response.info().get('Content-Encoding') == "gzip":
+ buff = StringIO(response.read())
+ f = gzip.GzipFile(fileobj=buff)
+ return f.read()
+ else:
+ return response.read()
+
+
+def INDEX(url):
+ req = urllib2.Request(url, headers=api_headers)
+
+ post_args = {"mode": "action",
+ "data":
+ {"type": "loadingNextVideos",
+ "offset": 0,
+ "count": 48,
+ "category": "",
+ "sendtyp": "",
+ "langid": str(payload_id)
+ }
+ }
+
+ data = json.dumps(post_args)
+
+ content = decode_response(urllib2.urlopen(req, data=data))
+
+ video_index = json.loads(content)
+
+ data_digest = video_index.get('data', [])
+ for video in data_digest:
+ title = video.get('title', '')
+ image = 'https://www.kla.tv/{}'.format(video.get('img', ''))
+ url = "https://www.kla.tv/{}".format(video.get('longlink', '')).replace('lang=de', 'lang={}'.format(lang_id))
+ if url == 'https://www.kla.tv/':
+ continue
+ add_dir(title.encode('utf8'), url.encode('utf8'), 2, image)
+
+
+def VIDEOLINKS(url, name):
+ req = urllib2.Request(url, headers=page_headers)
+
+ response = urllib2.urlopen(req)
+
+ link = decode_response(response).replace('\n', '').replace('\t', ' ')
+ while ' ' in link:
+ link = link.replace(' ', ' ')
+ response.close()
+
+ compiled_regex = re.compile('file: "(.+?)", label: "(.+?)"')
+ value_tuples = compiled_regex.findall(link)
+
+ for entry in value_tuples:
+ if "blockid" in entry[0].lower() or "label:" in entry[0].lower():
+ continue
+ add_link('{0} ({1})'.format(name, entry[1]), 'https://www.kla.tv/{}'.format(entry[0]), __icon__)
+
+
+def get_params():
+ param = []
+ paramstring = sys.argv[2]
+ if len(paramstring) >= 2:
+ params = sys.argv[2]
+ cleanedparams = params.replace('?', '')
+ if (params[len(params) - 1] == '/'):
+ params = params[0:len(params) - 2]
+ pairsofparams = cleanedparams.split('&')
+ param = {}
+ for i in range(len(pairsofparams)):
+ splitparams = pairsofparams[i].split('=')
+ if (len(splitparams)) == 2:
+ param[splitparams[0]] = splitparams[1]
+
+ return param
+
+
+def add_link(name, url, icon_image):
+ liz = xbmcgui.ListItem(name)
+ liz.setArt({"thumb": icon_image})
+ liz.setInfo(type="Video", infoLabels={"title": name, "mediatype": "video"})
+ ok = xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=liz)
+ return ok
+
+
+def add_dir(name, url, mode, icon_image):
+ u = sys.argv[0] + "?url=" + urllib.quote_plus(url) + "&mode=" + str(mode) + "&name=" + urllib.quote_plus(name)
+ liz = xbmcgui.ListItem(name)
+ liz.setInfo(type="Video", infoLabels={"title": name, "mediatype": "video"})
+ liz.setArt({"thumb": icon_image})
+ ok = xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=u, listitem=liz, isFolder=True)
+ return ok
+
+
+params = get_params()
+url = None
+name = None
+mode = None
+
+try:
+ url = urllib.unquote_plus(params["url"])
+except:
+ pass
+try:
+ name = urllib.unquote_plus(params["name"])
+except:
+ pass
+try:
+ mode = int(params["mode"])
+except:
+ pass
+
+
+if mode == None or url == None or len(url) < 1:
+ INDEX('https://www.kla.tv/en')
+
+elif mode == 1:
+ INDEX(url)
+
+elif mode == 2:
+ VIDEOLINKS(url, name)
+
+else:
+ INDEX('https://www.kla.tv/en')
+
+xbmcplugin.endOfDirectory(int(sys.argv[1]))
diff --git a/plugin.video.kla.tv/addon.xml b/plugin.video.kla.tv/addon.xml
new file mode 100644
index 0000000..ab2a350
--- /dev/null
+++ b/plugin.video.kla.tv/addon.xml
@@ -0,0 +1,36 @@
+<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
+<addon
+ id="plugin.video.kla.tv"
+ name="Klagemauer TV"
+ provider-name="celadoor"
+ version="0.0.5">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0" />
+ </requires>
+ <extension library="addon.py" point="xbmc.python.pluginsource">
+ <provides>video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <summary lang="de_de">www.kla.tv video plugin</summary>
+ <summary lang="en_gb">www.kla.tv video plugin</summary>
+ <summary lang="pl_pl">www.kla.tv video plugin</summary>
+ <summary lang="fr_fr">www.kla.tv video plugin</summary>
+ <description lang="de_de">Klagemauer TV dagegen arbeitet seit 2012 ehrenamtlich und unentgeltlich für Sie! Und dies in 90 Studios mit über 170 Moderatorinnen und Moderatoren, in 38 Sprachen und einem Sendegebiet von 212 Ländern. Helfen Sie mit, diesen wichtigen Stimmen in aller Welt Gehör zu verschaffen. Schon in den ersten 2 Jahren produzierte Kla.TV über 5.000 klarstellende Sendungen, dazu 30 Dokumentarfilme und vieles andere mehr..
+ </description>
+ <description lang="en_gb">Klagemauer TV,has been working as a volunteer for you since 2012! And this in 90 studios with over 170 presenters, in 38 languages and a broadcasting area of 212 countries. Help to make these important voices heard around the world. During the first two years, Kla.TV produced more than 5,000 channels, including 30 documentary films and much more..</description>
+ <description lang="pl_pl">Z drugiej strony telewizor Klagenwand działa od 2012 roku jako ochotnik! I to w 90 studiach z ponad 170 prelegentami, w 38 językach i obszarze nadawczym 212 krajów. Pomóż, aby te ważne głosy słyszeć na całym świecie. W ciągu pierwszych dwóch lat Kla.TV wyprodukował ponad 5000 kanałów, w tym 30 filmów dokumentalnych i wiele innych..</description>
+ <description lang="fr_fr">Klagemauer TV, en revanche, a travaillé comme bénévole pour vous depuis 2012! Et cela dans 90 studios avec plus de 170 présentateurs, en 38 langues et une zone de diffusion de 212 pays. Aidez à faire entendre ces voix importantes dans le monde entier. Au cours des deux premières années, Kla.TV a produit plus de 5 000 chaînes, dont 30 films documentaires et bien plus encore..</description>
+<news>Version 0.0.5 -Initial Release. Klagemauer TV video plugin.supports 4 languages de,en,pl,fr</news>
+ <platform>all</platform>
+ <language>en de pl fr</language>
+ <license>GNU GENERAL PUBLIC LICENSE. Version 3, June 2007</license>
+ <forum></forum>
+ <website>www.kla.tv</website>
+ <email></email>
+ <source>https://github.com/celadoor/repo-plugins/tree/krypton-kla-tv-2/plugin.video.kla.tv</source>
+<assets>
+ <icon>resources/icon.png</icon>
+ <fanart>resources/fanart.jpg</fanart>
+</assets>
+ </extension>
+</addon>
diff --git a/plugin.video.kla.tv/resources/fanart.jpg b/plugin.video.kla.tv/resources/fanart.jpg
new file mode 100644
index 0000000..a73f3a9
--- /dev/null
+++ b/plugin.video.kla.tv/resources/fanart.jpg
Binary files differ
diff --git a/plugin.video.kla.tv/resources/icon.png b/plugin.video.kla.tv/resources/icon.png
new file mode 100644
index 0000000..e46c2d9
--- /dev/null
+++ b/plugin.video.kla.tv/resources/icon.png
Binary files differ
diff --git a/plugin.video.kla.tv/resources/language/resource.language.de_de/strings.po b/plugin.video.kla.tv/resources/language/resource.language.de_de/strings.po
new file mode 100644
index 0000000..e0e6ad3
--- /dev/null
+++ b/plugin.video.kla.tv/resources/language/resource.language.de_de/strings.po
@@ -0,0 +1,39 @@
+# Kodi Media Center language file
+# Addon Name: kla.tv
+# Addon id: plugin.video.kla.tv
+# Addon Provider: celadoor
+msgid ""
+msgstr ""
+"Last-Translator: Kodi Translation Team\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en\n"
+
+msgctxt "#30001"
+msgid "Original stream's language"
+msgstr "Ursprüngliche Sprache des Streams"
+
+msgctxt "#30950"
+msgid "en"
+msgstr "de"
+
+msgctxt "#30951"
+msgid "Auto detect"
+msgstr "Auto-Erkennung"
+
+msgctxt "#30952"
+msgid "en"
+msgstr "en"
+
+msgctxt "#30953"
+msgid "de"
+msgstr "de"
+
+msgctxt "#30954"
+msgid "fr"
+msgstr "fr"
+
+msgctxt "#30955"
+msgid "pl"
+msgstr "pl" \ No newline at end of file
diff --git a/plugin.video.kla.tv/resources/language/resource.language.en_gb/strings.po b/plugin.video.kla.tv/resources/language/resource.language.en_gb/strings.po
new file mode 100644
index 0000000..0c0a1b7
--- /dev/null
+++ b/plugin.video.kla.tv/resources/language/resource.language.en_gb/strings.po
@@ -0,0 +1,39 @@
+# Kodi Media Center language file
+# Addon Name: kla.tv
+# Addon id: plugin.video.kla.tv
+# Addon Provider: celadoor
+msgid ""
+msgstr ""
+"Last-Translator: Kodi Translation Team\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en\n"
+
+msgctxt "#30001"
+msgid "Original stream's language"
+msgstr ""
+
+msgctxt "#30950"
+msgid "en"
+msgstr ""
+
+msgctxt "#30951"
+msgid "Auto detect"
+msgstr ""
+
+msgctxt "#30952"
+msgid "en"
+msgstr ""
+
+msgctxt "#30953"
+msgid "de"
+msgstr ""
+
+msgctxt "#30954"
+msgid "fr"
+msgstr ""
+
+msgctxt "#30955"
+msgid "pl"
+msgstr "" \ No newline at end of file
diff --git a/plugin.video.kla.tv/resources/language/resource.language.fr_fr/strings.po b/plugin.video.kla.tv/resources/language/resource.language.fr_fr/strings.po
new file mode 100644
index 0000000..91fa92a
--- /dev/null
+++ b/plugin.video.kla.tv/resources/language/resource.language.fr_fr/strings.po
@@ -0,0 +1,39 @@
+# Kodi Media Center language file
+# Addon Name: kla.tv
+# Addon id: plugin.video.kla.tv
+# Addon Provider: celadoor
+msgid ""
+msgstr ""
+"Last-Translator: Kodi Translation Team\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en\n"
+
+msgctxt "#30001"
+msgid "Original stream's language"
+msgstr "Langue d'origine du flux"
+
+msgctxt "#30950"
+msgid "en"
+msgstr "fr"
+
+msgctxt "#30951"
+msgid "Auto detect"
+msgstr "Détection automatique"
+
+msgctxt "#30952"
+msgid "en"
+msgstr "en"
+
+msgctxt "#30953"
+msgid "de"
+msgstr "de"
+
+msgctxt "#30954"
+msgid "fr"
+msgstr "fr"
+
+msgctxt "#30955"
+msgid "pl"
+msgstr "pl" \ No newline at end of file
diff --git a/plugin.video.kla.tv/resources/language/resource.language.pl_pl/strings.po b/plugin.video.kla.tv/resources/language/resource.language.pl_pl/strings.po
new file mode 100644
index 0000000..b8ddec8
--- /dev/null
+++ b/plugin.video.kla.tv/resources/language/resource.language.pl_pl/strings.po
@@ -0,0 +1,39 @@
+# Kodi Media Center language file
+# Addon Name: kla.tv
+# Addon id: plugin.video.kla.tv
+# Addon Provider: celadoor
+msgid ""
+msgstr ""
+"Last-Translator: Kodi Translation Team\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en\n"
+
+msgctxt "#30001"
+msgid "Original stream's language"
+msgstr "Język oryginalny"
+
+msgctxt "#30950"
+msgid "en"
+msgstr "pl"
+
+msgctxt "#30951"
+msgid "Auto detect"
+msgstr "Automat"
+
+msgctxt "#30952"
+msgid "en"
+msgstr "en"
+
+msgctxt "#30953"
+msgid "de"
+msgstr "de"
+
+msgctxt "#30954"
+msgid "fr"
+msgstr "fr"
+
+msgctxt "#30955"
+msgid "pl"
+msgstr "pl" \ No newline at end of file
diff --git a/plugin.video.kla.tv/resources/settings.xml b/plugin.video.kla.tv/resources/settings.xml
new file mode 100644
index 0000000..4dcadf6
--- /dev/null
+++ b/plugin.video.kla.tv/resources/settings.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<settings>
+ <category label="128">
+ <setting label="30001" type="select" lvalues="30951|30952|30953|30954|30955" id="LanguageID" default="30951"/>
+ </category>
+</settings> \ No newline at end of file
diff --git a/plugin.video.massengeschmack/addon.xml b/plugin.video.massengeschmack/addon.xml
index aefcaee..c15006b 100644
--- a/plugin.video.massengeschmack/addon.xml
+++ b/plugin.video.massengeschmack/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<addon id="plugin.video.massengeschmack" name="Massengeschmack" version="2.2.0" provider-name="phoerious">
+<addon id="plugin.video.massengeschmack" name="Massengeschmack" version="2.3.1" provider-name="phoerious">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
</requires>
diff --git a/plugin.video.massengeschmack/changelog.txt b/plugin.video.massengeschmack/changelog.txt
index afcda1a..e9f0aa3 100644
--- a/plugin.video.massengeschmack/changelog.txt
+++ b/plugin.video.massengeschmack/changelog.txt
@@ -1,3 +1,8 @@
+2.3.1
+ - Fix required Python API version
+2.3.0
+ - Add Moritz & die Anderen
+
2.2.0
- Update for Krypton
- List show runners as cast
diff --git a/plugin.video.massengeschmack/resources/datasources/asynchron.json b/plugin.video.massengeschmack/resources/datasources/asynchron.json
index c9a5a31..387597a 100644
--- a/plugin.video.massengeschmack/resources/datasources/asynchron.json
+++ b/plugin.video.massengeschmack/resources/datasources/asynchron.json
@@ -5,7 +5,7 @@
"title": "Asynchron",
"cast": ["Olaf Brill", "Holger Kreymeier"],
"country": 30202,
- "plot": "Asynchron beschäftigt sich mit der Synchronisation von Serien und Filmen. Wie gut sind die mSprecher? Wie nah am Original sind die Dialoge? Asynchron ist exklusiv im Abo verfügbar. Ein Magazin zu diesem speziellen Thema – das gibt es nur auf Massengeschmack.",
+ "plot": "Asynchron beschäftigt sich mit der Synchronisation von Serien und Filmen. Wie gut sind die Sprecher? Wie nah am Original sind die Dialoge? Asynchron ist exklusiv im Abo verfügbar. Ein Magazin zu diesem speziellen Thema – das gibt es nur auf Massengeschmack.",
"premiered": "2017-04-05"
},
"fanart": "fanart-asynchron-20160220.jpg",
diff --git a/plugin.video.massengeschmack/resources/datasources/moritz.json b/plugin.video.massengeschmack/resources/datasources/moritz.json
new file mode 100644
index 0000000..20b8b1b
--- /dev/null
+++ b/plugin.video.massengeschmack/resources/datasources/moritz.json
@@ -0,0 +1,20 @@
+{
+ "id": 18,
+ "order": 18,
+ "metadata": {
+ "title": "Moritz & die Anderen",
+ "cast": ["Moritz"],
+ "country": 30202,
+ "plot": "Moritz sucht nach anderen Meinungen und will sich mit diesen auseinandersetzen. Seine Gäste sind Menschen, die nicht den politischen Mainstream vertreten - mal extrem, mal absurd, mal intellektuell. Aber immer fair und immer sachlich.",
+ "premiered": "2017-04-04"
+ },
+ "fanart": "fanart-moritz.jpg",
+ "qualities": ["best", "hd", "mobile", "audio"],
+ "submodules": [
+ {
+ "name": "all",
+ "ids": [1]
+ }
+ ],
+ "active": true
+}
diff --git a/plugin.video.massengeschmack/resources/media/fanart-moritz.jpg b/plugin.video.massengeschmack/resources/media/fanart-moritz.jpg
new file mode 100644
index 0000000..2c1807a
--- /dev/null
+++ b/plugin.video.massengeschmack/resources/media/fanart-moritz.jpg
Binary files differ
diff --git a/plugin.video.mediacorp/LICENSE.txt b/plugin.video.mediacorp/LICENSE.txt
new file mode 100644
index 0000000..4f8e8eb
--- /dev/null
+++ b/plugin.video.mediacorp/LICENSE.txt
@@ -0,0 +1,282 @@
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+-------------------------------------------------------------------------
diff --git a/plugin.video.mediacorp/README.txt b/plugin.video.mediacorp/README.txt
new file mode 100644
index 0000000..4403aaf
--- /dev/null
+++ b/plugin.video.mediacorp/README.txt
@@ -0,0 +1,11 @@
+plugin.video.mediacorp
+================
+
+Kodi Addon for mediacorp
+For Kodi Isgengard and later releases
+
+V3.0.6 website change; Krypton version uses inputstream.adaptive
+V3.0.4 Added new formats
+V3.0.1 Isengard version
+V2.0.1 initial v2 release
+
diff --git a/plugin.video.mediacorp/addon.xml b/plugin.video.mediacorp/addon.xml
new file mode 100644
index 0000000..23d9419
--- /dev/null
+++ b/plugin.video.mediacorp/addon.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<addon id="plugin.video.mediacorp"
+ name="Mediacorp Singapore"
+ version="3.0.6"
+ provider-name="t1m">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="script.module.t1mlib" version="1.0.18"/>
+ <import addon="inputstream.adaptive" version="2.0.0"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource"
+ library="default.py">
+ <provides>video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <summary lang="en_GB">Mediacorp Singapore</summary>
+ <description lang="en_GB">Mediacorp Singapore - Toggle.sg version. To display Chinese correctly, choose Arial Font under Settings-Appearance-Skin-Font</description>
+ <disclaimer lang="en_GB">Feel free to use this script. For information visit the wiki.</disclaimer>
+ <platform>all</platform>
+ <language>en</language>
+ <license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license>
+ <forum>http://forum.xbmc.org/showthread.php?tid=173754</forum>
+ <website>www.toggle.sg</website>
+ <email></email>
+ <source>https://github.com/learningit/plugin.video.mediacorp</source>
+ </extension>
+</addon>
diff --git a/plugin.video.mediacorp/changelog.txt b/plugin.video.mediacorp/changelog.txt
new file mode 100644
index 0000000..0681f0d
--- /dev/null
+++ b/plugin.video.mediacorp/changelog.txt
@@ -0,0 +1,4 @@
+V3.0.6 Fix website change; Krypton version requires inputstream.adaptive
+V3.0.4 Added new formats
+V3.0.1 Isengard version
+V2.0.1 Initial v2 release
diff --git a/plugin.video.mediacorp/default.py b/plugin.video.mediacorp/default.py
new file mode 100644
index 0000000..414fdef
--- /dev/null
+++ b/plugin.video.mediacorp/default.py
@@ -0,0 +1,13 @@
+# -*- coding: utf-8 -*-
+# KodiAddon
+#
+from resources.lib.scraper import myAddon
+import re
+import sys
+
+# Start of Module
+
+addonName = re.search('plugin\://plugin.video.(.+?)/',str(sys.argv[0])).group(1)
+ma = myAddon(addonName)
+ma.processAddonEvent()
+
diff --git a/plugin.video.mediacorp/icon.png b/plugin.video.mediacorp/icon.png
new file mode 100644
index 0000000..bde979e
--- /dev/null
+++ b/plugin.video.mediacorp/icon.png
Binary files differ
diff --git a/plugin.video.mediacorp/resources/__init__.py b/plugin.video.mediacorp/resources/__init__.py
new file mode 100644
index 0000000..7986681
--- /dev/null
+++ b/plugin.video.mediacorp/resources/__init__.py
@@ -0,0 +1 @@
+__author__ = 't1m'
diff --git a/plugin.video.mediacorp/resources/lib/__init__.py b/plugin.video.mediacorp/resources/lib/__init__.py
new file mode 100644
index 0000000..7986681
--- /dev/null
+++ b/plugin.video.mediacorp/resources/lib/__init__.py
@@ -0,0 +1 @@
+__author__ = 't1m'
diff --git a/plugin.video.mediacorp/resources/lib/scraper.py b/plugin.video.mediacorp/resources/lib/scraper.py
new file mode 100644
index 0000000..1e1fa6b
--- /dev/null
+++ b/plugin.video.mediacorp/resources/lib/scraper.py
@@ -0,0 +1,137 @@
+# -*- coding: utf-8 -*-
+# Kodi Addon for Mediacorp
+#
+from t1mlib import t1mAddon
+import json
+import re
+import urllib
+import urllib2
+import cookielib
+import xbmcplugin
+import xbmcgui
+import datetime
+import HTMLParser
+import xbmc
+import os
+import sys
+
+h = HTMLParser.HTMLParser()
+uqp = urllib.unquote_plus
+UTF8 = 'utf-8'
+
+
+class myAddon(t1mAddon):
+
+ def getAddonMenu(self,url,ilist):
+ html = self.getRequest('http://video.toggle.sg/en/catchup-listing')
+ cats = re.compile('<div class="megaslider-holder tgtabs.+?href=".+?">(.+?)<.+?data-ajax-url="(.+?)".+?<div id="preloader">',re.DOTALL).findall(html)
+
+ infoList = {}
+ for name,url in cats:
+ name = name.strip()
+ if not url.startswith('http'):
+ url = 'https://video.toggle.sg'+url
+ else:
+ continue
+ infoList['Title'] = name
+ infoList['Plot'] = name
+ infoList['mediatype'] = 'file'
+ ilist = self.addMenuItem(name,'GS', ilist, url, self.addonIcon, self.addonFanart, infoList, isFolder=True)
+ return(ilist)
+
+ def getAddonShows(self,url,ilist):
+ url = uqp(url)
+ html = self.getRequest(url)
+ blob = re.compile('bandData =(.+?)toggle.functions',re.DOTALL).search(html)
+ if blob is not None:
+ blob = blob.group(1)
+ blob = blob.replace('JSON.stringify({})',"''")
+ blob = blob.strip()
+ blob = blob.replace('}',',').replace('{','')
+ kpairs = re.compile('(.+?)\:(.+?),').findall(blob)
+ u = ''
+ for kkey,kval in kpairs:
+ kkey=kkey.strip()
+ kval=kval.strip()
+ u = u+'&%s=%s' % (kkey,kval.replace('"','').replace("'",''))
+ u = re.sub(r'pageSize=[0-9]*', 'pageSize=300', u)
+ url = 'http://video.toggle.sg/en/blueprint/servlet/toggle/bandlist?%s' % u
+ html = self.getRequest(url)
+ shows = re.compile('<div class="tg-teaser-item".+?href="(.+?)".+?src="(.+?)".+?<h6 class.+?href=.+?">(.+?)<.+?</div',re.DOTALL).findall(html)
+ else:
+ shows = re.compile('<div class="tg-teaser-item".+?href="(.+?)".+?srcset="(.+?)".+?<h6 class.+?href=.+?">(.+?)<.+?</div',re.DOTALL).findall(html)
+ for (url,thumb,name) in shows:
+ name = name.decode(UTF8)
+ infoList = {}
+ if not (thumb.startswith('http')):
+ thumb = 'http://video.toggle.sg'+thumb
+ name = name.strip()
+ name = h.unescape(name)
+ infoList['Title'] = name
+ infoList['Plot'] = name
+ infoList['TVShowTitle'] = name
+ infoList['mediatype'] = 'tvshow'
+ if ('/movies/' in url) or ('/extras' in url):
+ ilist = self.addMenuItem(name,'GV', ilist, url, thumb, self.addonFanart, infoList, isFolder=False)
+ else:
+ ilist = self.addMenuItem(name,'GE', ilist, url, thumb, self.addonFanart, infoList, isFolder=True)
+ return(ilist)
+
+
+ def getAddonEpisodes(self,url,ilist):
+ url = uqp(url)
+ showName = xbmc.getInfoLabel('ListItem.TVShowTitle')
+ html = self.getRequest(url)
+ url = re.compile('<div class="tg-microsite-link card ">.+?href="(.+?)"', re.DOTALL).search(html).group(1)
+ url += '/episodes'
+ html = self.getRequest(url)
+ parms = re.compile('toggle.functions.ajaxEpisodeListingPage\((.+?)\)', re.DOTALL).search(html).group(1)
+ parms = parms.split(',')
+ url = 'http://tv.toggle.sg/en/blueprint/servlet/toggle/paginate?pageSize=200&pageIndex=0&contentId=%s&navigationId=%s&isCatchup=1' % (parms[3].strip(), parms[4].strip())
+ html = self.getRequest(url)
+ epis = re.compile('<div class="img-holder">.+?src="(.+?)".+?ref="(.+?)">(.+?)<.+?<p>(.+?)</p', re.DOTALL).findall(html)
+ for (thumb,url,name,plot) in epis:
+ infoList={}
+ name = name.replace('\n','').strip()
+ vid = url.rsplit('/',1)[1]
+ if not (thumb.startswith('http')): thumb = 'http://video.toggle.sg'+thumb
+ infoList['Plot'] = h.unescape(plot.decode(UTF8))
+ infoList['Title'] = h.unescape(name)
+ infoList['TVShowTitle'] = showName
+ infoList['mediatype'] = 'episode'
+ fanart = thumb
+ ilist = self.addMenuItem(name,'GV', ilist, vid, thumb, fanart, infoList, isFolder=False)
+ return(ilist)
+
+
+ def getAddonVideo(self,url):
+ vid = url
+ vurl = 'http://toggleplayer-1410100339.ap-southeast-1.elb.amazonaws.com/v0.30/mwEmbed/mwEmbedFrame.php?&wid=_27017&uiconf_id=8413350&entry_id='+vid+'&flashvars[ks]=0&flashvars[logo]=undefined&flashvars[toggle.sgPlus]=false&flashvars[vast]=%7B%22htmlCompanions%22%3A%22video-companion-ad-320-100-in-flash%3A320%3A100%22%7D&flashvars[multiDrm]=%7B%22plugin%22%3Atrue%2C%22isClear%22%3Atrue%7D&flashvars[localizationCode]=en&flashvars[autoPlay]=true&flashvars[proxyData]=%7B%22initObj%22%3A%7B%22Locale%22%3A%7B%22LocaleLanguage%22%3A%22%22%2C%22LocaleCountry%22%3A%22%22%2C%22LocaleDevice%22%3A%22%22%2C%22LocaleUserState%22%3A0%7D%2C%22Platform%22%3A0%2C%22SiteGuid%22%3A0%2C%22DomainID%22%3A%220%22%2C%22UDID%22%3A%22%22%2C%22ApiUser%22%3A%22tvpapi_147%22%2C%22ApiPass%22%3A%2211111%22%7D%2C%22MediaID%22%3A%22'+vid+'%22%2C%22iMediaID%22%3A%22'+vid+'%22%2C%22picSize%22%3A%22640X360%22%7D&playerId=SilverlightContainer&forceMobileHTML5=true&urid=2.29.1.10&callback='
+ html = self.getRequest(vurl)
+ m = re.compile('kalturaIframePackageData = (.+?)};',re.DOTALL).search(html)
+ x = html[m.start(1):m.end(1)+1].replace('\\','')
+ x = re.compile('"Files"\:(.+?),"Tags"', re.DOTALL).search(x).group(1)
+ a = json.loads(x)
+ u = None
+ for c in ['STB Main','Main','HLS_Web','HLS_Tablet','iPad Main']:
+ for b in a:
+ if b['Format'] == c:
+ u = b['URL']
+ break
+ if not (u is None):
+ break
+ if ( u is None or u.endswith('.wvm')):
+ xbmcgui.Dialog().notification(self.addonName, 'No Video Found', self.addonIcon, 5000)
+ return
+ liz = xbmcgui.ListItem(path = u)
+ html = self.getRequest('https://sub.toggle.sg/toggle_api/v1.0/apiService/getSubtitleFilesForMedia?mediaId=%s' % vid)
+ subfile = json.loads(html)
+ subfiles = []
+ for a in subfile.get('subtitleFiles'):
+ subfiles.append(a['subtitleFileUrl'])
+ liz.setSubtitles(subfiles)
+ liz.setProperty('inputstreamaddon','inputstream.adaptive')
+ liz.setProperty('inputstream.adaptive.manifest_type','hls')
+ liz.setMimeType('application/x-mpegURL')
+ xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
+
diff --git a/plugin.video.mediathek/addon.xml b/plugin.video.mediathek/addon.xml
index 0f8d28d..cd6b021 100644
--- a/plugin.video.mediathek/addon.xml
+++ b/plugin.video.mediathek/addon.xml
@@ -2,7 +2,7 @@
<addon
id="plugin.video.mediathek"
name="Mediathek"
- version="0.8.4"
+ version="0.8.5"
provider-name="Raptor 2101">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
diff --git a/plugin.video.mediathek/changelog.txt b/plugin.video.mediathek/changelog.txt
index bdef090..91df365 100644
--- a/plugin.video.mediathek/changelog.txt
+++ b/plugin.video.mediathek/changelog.txt
@@ -1,3 +1,4 @@
+0.8.5 - FIX: KIKA and ARD
0.8.4 - CHG: ARTE JSON link changed
0.8.3 - CHG: Reimplement ARTE
0.8.2 - CHG: Reimplement ORF
diff --git a/plugin.video.mediathek/mediathek/ard.py b/plugin.video.mediathek/mediathek/ard.py
index 6c66ce2..658ac87 100644
--- a/plugin.video.mediathek/mediathek/ard.py
+++ b/plugin.video.mediathek/mediathek/ard.py
@@ -55,19 +55,19 @@ class ARDMediathek(Mediathek):
)),
TreeNode("2","Ausgewählte Dokus".decode("utf-8"),self.rootLink+"/tv/Ausgew%C3%A4hlte-Dokus/mehr?documentId=33649086",True),
TreeNode("3","Ausgewählte Filme".decode("utf-8"),self.rootLink+"/tv/Ausgew%C3%A4hlte-Filme/mehr?documentId=33649088",True),
- TreeNode("4","Alle Reportagen und Dokus",self.rootLink+"/tv/Alle-Dokus-Reportagen/mehr?documentId=29897596",True),
- TreeNode("5","Alle Filme",self.rootLink+"/tv/Alle-Filme/mehr?documentId=33594630",True),
- TreeNode("6","Alle Serien",self.rootLink+"/tv/Serien/mehr?documentId=26402940",True),
+ TreeNode("4","Alle Reportagen und Dokus",self.rootLink+"/tv/dokus",True),
+ TreeNode("5","Alle Filme",self.rootLink+"/tv/filme",True),
+ TreeNode("6","Nachrichten",self.rootLink+"/tv/nachrichten",True),
TreeNode("7","Themen",self.rootLink+"/tv/Themen/mehr?documentId=21301810",True),
TreeNode("8","Rubriken","",False,(
TreeNode("8.0","Kinder",self.rootLink+"/tv/Kinder/Tipps?documentId=21282542",True),
- TreeNode("8.1","Unterhaltung & Comedy",self.rootLink+"/tv/Unterhaltung-Comedy/mehr?documentId=21282544",True),
- TreeNode("8.2","Kultur",self.rootLink+"/tv/Kultur/mehr?documentId=21282546",True),
- TreeNode("8.3","Wissen",self.rootLink+"/tv/Wissen/mehr?documentId=21282530",True),
- TreeNode("8.4","Politik",self.rootLink+"/tv/Politik/mehr?documentId=29684598",True),
- TreeNode("8.5","Ratgeber",self.rootLink+"/tv/Ratgeber/mehr?documentId=27112994",True),
- TreeNode("8.6","Krimi",self.rootLink+"/tv/Krimi/mehr?documentId=27258656",True),
- TreeNode("8.7","Reise",self.rootLink+"/tv/Reise/mehr?documentId=29769608",True),
+ TreeNode("8.1","Unterhaltung & Comedy",self.rootLink+"/tv/unterhaltung",True),
+ TreeNode("8.2","Kultur",self.rootLink+"/tv/kultur",True),
+ TreeNode("8.3","Wissen",self.rootLink+"/tv/wissen",True),
+ TreeNode("8.4","Politik",self.rootLink+"/tv/politik",True),
+ TreeNode("8.5","Ratgeber",self.rootLink+"/tv/ratgeber",True),
+ TreeNode("8.6","Sport",self.rootLink+"/tv/sport",True),
+ TreeNode("8.7","Reise",self.rootLink+"/tv/reise",True),
)),
)
self.configLink = self.rootLink+"/play/media/%s?devicetype=pc&feature=flash"
@@ -136,7 +136,7 @@ class ARDMediathek(Mediathek):
self.gui.buildVideoLink(DisplayObject(title,subTitle,"","",link,False),self,counter);
for element in videoElements:
videoId = element.group(1);
- title = element.group(2).decode('utf-8');
+ title = element.group(2).decode('utf-8').replace("<br/>","");
subTitle = element.group(3).decode('utf-8');
if element.group(4):
datestring = element.group(4).decode('utf-8');
@@ -155,7 +155,10 @@ class ARDMediathek(Mediathek):
videoLinks = {}
for match in self.regex_videoLinks.finditer(videoPage):
quality = int(match.group(1));
- link = SimpleLink(match.group(2),0);
+ link = match.group(2);
+ if(link.startswith("//")):
+ link = "http:"+link;
+ link = SimpleLink(link,0);
if(quality > 0):
quality -= 1
diff --git a/plugin.video.mediathek/mediathek/kika.py b/plugin.video.mediathek/mediathek/kika.py
index 238ba9d..e17a1dc 100644
--- a/plugin.video.mediathek/mediathek/kika.py
+++ b/plugin.video.mediathek/mediathek/kika.py
@@ -58,11 +58,14 @@ class KIKA(Mediathek):
)
self.regex_videoLinks=re.compile("<a href=\"(.*?/videos/video\\d+?)\\.html\"");
- self.regex_configLinks=re.compile("{dataURL:'http://www.kika.de(/.*?-avCustom.xml)'}");
+ self.regex_allVideosLinks=re.compile("<a href=\"(.*?/sendungen/allevideos.*?\\.html)\"");
+ self.regex_configLinks=re.compile("\\{dataURL:'https{0,1}:\\/\\/www\\.kika\\.de(\\/.*?-avCustom.*\\.xml)'\\}");
+ self.selector_allVideoPage = "div.mod > div.boxCon > div.box > div.teaser > a.linkAll";
self.selector_videoPages = "div.mod > div.box > div.teaser > a.linkAll";
self.selector_seriesPages = "div.modCon > div.mod > div.boxCon > div.boxBroadcastSeries > div.teaser > a.linkAll";
self.regex_xml_channel=re.compile("<channelName>(.*?)</channelName>");
self.regex_xml_title=re.compile("<title>(.*?)</title>");
+ self.regex_xml_time=re.compile("<webTime>(.*?)</webTime>");
self.regex_xml_image=re.compile("<teaserimage>\\s*?<url>(.*?)</url>");
self.regex_xml_videoLink=re.compile("<asset>\\s*?<profileName>(.*?)</profileName>.*?<progressiveDownloadUrl>(.*?)</progressiveDownloadUrl>\\s*?</asset>",re.DOTALL)
self.regex_videoLink=re.compile("rtmp://.*?\.mp4");
@@ -70,10 +73,12 @@ class KIKA(Mediathek):
def name(self):
return "KI.KA";
+ @classmethod
def isSearchable(self):
return False;
- def searchVideo(self, searchText):
+ @classmethod
+ def searchVideo(self,searchText):
return;
def buildVideoLink(self,pageLink):
@@ -89,7 +94,7 @@ class KIKA(Mediathek):
for match in self.regex_xml_videoLink.finditer(xmlPage):
profile = match.group(1);
directLink = match.group(2);
- self.gui.log("%s %s"%(profile,directLink));
+ #self.gui.log("%s %s"%(profile,directLink));
if("MP4 Web S" in profile):
links[0] = SimpleLink(directLink, 0);
if("MP4 Web L" in profile):
@@ -99,17 +104,39 @@ class KIKA(Mediathek):
if("MP4 Web XL" in profile):
links[3] = SimpleLink(directLink, 0);
+ date = None
+ date = time.strptime(unicode(self.regex_xml_time.search(xmlPage).group(1),"UTF-8"),u"%d.%m.%Y %H:%M");
if(channel is not None):
- return DisplayObject(channel,title,image,"",links,True, None);
+ return DisplayObject(channel,title,image,"",links,True, date);
else:
- return DisplayObject(title,"",image,"",links,True, None);
+ return DisplayObject(title,"",image,"",links,True, date);
def buildPageMenu(self, link, initCount):
+ videoLinks = set()
pageContent = self.loadPage(link);
htmlPage = BeautifulSoup(pageContent, 'html.parser')
+
htmlElements = htmlPage.select(self.selector_videoPages)
- videoLinks = set()
+ self.gui.log("found %d htmlElements"%len(htmlElements));
+ self.extractConfigLinks(videoLinks,pageContent);
+ self.extractVideoLinks(videoLinks,htmlElements);
+ if(len(videoLinks) == 0):
+ htmlElements = htmlPage.select(self.selector_allVideoPage)
+ self.extractVideoLinks(videoLinks,htmlElements);
+ count = initCount + len(videoLinks)
+
+ self.extractSubFolders(htmlPage,count);
+ displayObects = set()
+ for link in videoLinks:
+ displayObject = self.buildVideoLink(link);
+ displayObects.add(displayObject);
+ displayObects_sorted = sorted(displayObects, key=lambda displayObject: displayObject.date)
+ self.gui.log("found %d display obj "%len(displayObects))
+ for displayObject in displayObects_sorted:
+ self.gui.buildVideoLink(displayObject,self, count);
+
+ def extractVideoLinks(self,videoLinks,htmlElements):
for item in htmlElements:
link = self.rootLink+item['href'];
videoPage = self.loadPage(link);
@@ -117,24 +144,33 @@ class KIKA(Mediathek):
link=match.group(1)+"-avCustom.xml";
if(link not in videoLinks):
videoLinks.add(link)
- directLinks = list(self.regex_configLinks.finditer(pageContent));
+ self.gui.log("found %d video links"%len(videoLinks))
+
+ def extractConfigLinks(self,videoLinks,pageContent):
+ directLinks = list(self.regex_configLinks.finditer(pageContent));
for match in directLinks:
link = match.group(1);
if(link not in videoLinks):
- videoLinks.add(link)
- self.gui.log("found %d video links"%len(videoLinks))
- count = initCount + len(videoLinks)
- for link in videoLinks:
- displayObject = self.buildVideoLink(link);
- self.gui.buildVideoLink(displayObject,self, count);
- if(len(videoLinks) > 0):
- return;
- htmlElements = htmlPage.select(self.selector_seriesPages);
- count = count + len(htmlElements)
+ videoLinks.add(link)
+ self.gui.log("found %d config links"%len(videoLinks))
+
+ def extractSubFolders(self, htmlPage,initCount):
+ htmlElements = htmlPage.select(self.selector_seriesPages) + htmlPage.select(self.selector_allVideoPage);
self.gui.log("found %d page links"%len(htmlElements))
+ count = initCount + len(htmlElements)
+ displayObects = set()
for item in htmlElements:
- self.gui.log(item.prettify());
link = self.rootLink+item['href'];
title = item['title'];
- displayObject = DisplayObject(title,"",None,"",link,False, None);
+ #i'am uncertain why this is needed. a.linkAll should be found by selector_allVideoPage
+ if(item.has_attr('onclick')):
+ self.gui.log("onclick detected - skip link")
+ continue;
+ if(title == ""):
+ continue;
+ displayObject = DisplayObject("Alle Videos",title,"","",link,False);
+ displayObects.add(displayObject);
+ displayObects_sorted = sorted(displayObects, key=lambda displayObject: displayObject.title)
+ for displayObject in displayObects_sorted:
self.gui.buildVideoLink(displayObject,self, count);
+ return count;
diff --git a/plugin.video.mediathek/simplexbmc.py b/plugin.video.mediathek/simplexbmc.py
index 1529b83..b4b3cb6 100644
--- a/plugin.video.mediathek/simplexbmc.py
+++ b/plugin.video.mediathek/simplexbmc.py
@@ -92,8 +92,6 @@ class SimpleXbmcGui(object):
metaData["duration"] = int(displayObject.duration);
if(displayObject.date is not None):
- self.log(time.strftime("%d.%m.%Y",displayObject.date));
- self.log(time.strftime("%Y",displayObject.date));
metaData["date"] =time.strftime("%d.%m.%Y",displayObject.date);
metaData["year"] =int(time.strftime("%Y",displayObject.date));
return metaData;
diff --git a/plugin.video.metalvideo/LICENSE.txt b/plugin.video.metalvideo/LICENSE.txt
new file mode 100644
index 0000000..d159169
--- /dev/null
+++ b/plugin.video.metalvideo/LICENSE.txt
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/plugin.video.metalvideo/addon.py b/plugin.video.metalvideo/addon.py
new file mode 100644
index 0000000..11c627c
--- /dev/null
+++ b/plugin.video.metalvideo/addon.py
@@ -0,0 +1,282 @@
+# -*- coding: utf-8 -*-
+# Copyright: (c) 2016 William Forde (willforde+kodi@gmail.com)
+#
+# License: GPLv2, see LICENSE for more details
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+from __future__ import unicode_literals
+from codequick import Route, Resolver, Listitem, utils, run
+import xbmcgui
+import re
+
+# Localized string Constants
+VIDEO_OF_THE_DAY = 30004
+WATCHING_NOW = 30005
+TOP_VIDEOS = 30002
+SELECT_TOP = 30001
+PARTY_MODE = 589
+
+# Base url constructor
+url_constructor = utils.urljoin_partial("http://metalvideo.com")
+
+
+# noinspection PyUnusedLocal
+@Route.register
+def root(plugin, content_type):
+ """
+ :param Route plugin: The plugin parent object.
+ :param str content_type: The type of content been listed e.g. video, music. This is passed in from kodi and
+ we have no use for it as of yet.
+ """
+ yield Listitem.recent(recent_videos)
+ yield Listitem.from_dict(plugin.localize(TOP_VIDEOS), top_videos)
+ yield Listitem.from_dict(plugin.localize(WATCHING_NOW), watching_now)
+ yield Listitem.search(video_list)
+
+ # Fetch HTML Source
+ url = url_constructor("/mobile/category.html")
+ html = plugin.request.get(url, headers={"Cookie": "COOKIE_DEVICE=mobile"})
+ root_elem = html.parse(u"ul", attrs={"id": "category_listing"})
+ for elem in root_elem.iterfind("li"):
+ a_tag = elem.find("a")
+ item = Listitem()
+
+ # Set label with video count added
+ item.label = "%s (%s)" % (a_tag.text, elem.find("span").text)
+ item.set_callback(video_list, cat=a_tag.get("href"))
+ yield item
+
+ # Add the video items here so that show at the end of the listing
+ yield Listitem.from_dict(plugin.localize(VIDEO_OF_THE_DAY), play_video, params={"url": "index.html"})
+ yield Listitem.from_dict(plugin.localize(PARTY_MODE), party_play, params={"url": "randomizer.php"})
+
+
+@Route.register
+def recent_videos(plugin, url="newvideos.php"):
+ """
+ :param Route plugin: The plugin parent object.
+ :param unicode url: The url resource containing recent videos.
+ """
+ # Fetch HTML Source
+ url = url_constructor(url)
+ html = plugin.request.get(url)
+ root_elem = html.parse("div", attrs={"id": "browse_main"})
+ node = root_elem.find("./div[@id='newvideos_results']")[0]
+ for elem in node.iterfind("./tr"):
+ if not elem.attrib:
+ item = Listitem()
+ item.art["thumb"] = elem.find(".//img").get("src")
+
+ artist = elem[1].text
+ track = elem[1][0][0].text
+ item.label = "%s - %s" % (artist, track)
+ item.info["artist"] = [artist]
+
+ url = elem.find(".//a").get("href")
+ item.context.related(related, url=url)
+ item.set_callback(play_video, url=url)
+ yield item
+
+ # Fetch next page url
+ next_tag = root_elem.findall("./div[@class='pagination']/a")
+ if next_tag and next_tag[-1].text.startswith("next"):
+ yield Listitem.next_page(url=next_tag[-1].get("href"))
+
+
+@Route.register
+def watching_now(plugin):
+ # Fetch HTML Source
+ url = url_constructor("/index.html")
+ html = plugin.request.get(url)
+ root_elem = html.parse("ul", attrs={"id": "mycarousel"})
+ for elem in root_elem.iterfind("li"):
+ a_tag = elem.find(".//a[@title]")
+ item = Listitem()
+
+ # Fetch label & thumb
+ item.label = a_tag.text
+ item.art["thumb"] = elem.find(".//img").get("src")
+
+ url = a_tag.get("href")
+ item.context.related(related, url=url)
+ item.set_callback(play_video, url=url)
+ yield item
+
+
+@Route.register
+def top_videos(plugin):
+ """:param Route plugin: The plugin parent object."""
+ # Fetch HTML Source
+ url = url_constructor("/topvideos.html")
+ html = plugin.request.get(url)
+ titles = []
+ urls = []
+
+ # Parse categories
+ root_elem = html.parse("select", attrs={"name": "categories"})
+ for group in root_elem.iterfind("optgroup"):
+ for elem in group:
+ urls.append(elem.get("value"))
+ titles.append(elem.text.strip())
+
+ # Display list for Selection
+ dialog = xbmcgui.Dialog()
+ ret = dialog.select(plugin.localize(SELECT_TOP), titles)
+ if ret >= 0:
+ # Fetch HTML Source
+ url = urls[ret]
+ html = plugin.request.get(url)
+ root_elem = html.parse("div", attrs={"id": "topvideos_results"})
+ for elem in root_elem.iterfind(".//tr"):
+ if not elem.attrib:
+ item = Listitem()
+ a_tag = elem[3][0]
+
+ artist = elem[2].text
+ item.label = "%s %s - %s" % (elem[0].text, artist, a_tag.text)
+ item.art["thumb"] = elem.find(".//img").get("src")
+ item.info["count"] = elem[4].text.replace(",", "")
+ item.info["artist"] = [artist]
+
+ url = a_tag.get("href")
+ item.context.related(related, url=url)
+ item.set_callback(play_video, url=url)
+ yield item
+
+
+@Route.register
+def related(plugin, url):
+ """
+ :param Route plugin: The plugin parent object.
+ :param unicode url: The url of a video.
+ """
+ # Fetch HTML Source
+ url = url_constructor(url)
+ html = plugin.request.get(url)
+ root_elem = html.parse("div", attrs={"id": "tabs_related"})
+
+ # Parse the xml
+ for elem in root_elem.iterfind(u"div"):
+ a_tag = elem.find("./a[@class='song_name']")
+
+ item = Listitem()
+ item.label = a_tag.text
+ item.art["thumb"] = elem.find("./a/img").get("src")
+
+ url = a_tag.get("href")
+ item.context.related(related, url=url)
+ item.set_callback(play_video, url=url)
+ yield item
+
+
+@Route.register
+def video_list(plugin, url=None, cat=None, search_query=None):
+ """
+ :param Route plugin: The plugin parent object.
+ :param unicode url: The url resource containing lists of videos or next page.
+ :param unicode cat: A category url e.g. Alternative, Folk Metal.
+ :param unicode search_query: The video search term to use for searching.
+ """
+ if search_query:
+ url = url_constructor("search.php?keywords=%s&btn=Search" % search_query)
+ elif cat:
+ sortby = (u"date.html", u"artist.html", u"rating.html", u"views.html")[plugin.setting.get_int("sort")]
+ base, _ = url_constructor(cat).rsplit("-", 1)
+ url = "-".join((base, sortby))
+ else:
+ url = url_constructor(url)
+
+ html = plugin.request.get(url)
+ root_elem = html.parse("div", attrs={"id": "browse_main"})
+ for elem in root_elem.iterfind(u".//div[@class='video_i']"):
+ item = Listitem()
+ item.art["thumb"] = elem.find(".//img").get("src")
+
+ # Extract url and remove first 'a' tag section
+ # This makes it easir to extract 'artist' and 'song' name later
+ a_tag = elem.find("a")
+ url = a_tag.get("href")
+ elem.remove(a_tag)
+
+ # Fetch title
+ span_tags = tuple(node.text for node in elem.findall(".//span"))
+ item.label = "%s - %s" % span_tags
+ item.info["artist"] = [span_tags[0]]
+
+ # Add related video context item
+ item.context.related(related, url=url)
+ item.set_callback(play_video, url=url)
+ yield item
+
+ # Fetch next page url
+ next_tag = root_elem.findall(".//div[@class='pagination']/a")
+ if next_tag and next_tag[-1].text.startswith("next"):
+ yield Listitem.next_page(url=next_tag[-1].get("href"))
+
+
+@Resolver.register
+def play_video(plugin, url):
+ """
+ :param Resolver plugin: The plugin parent object.
+ :param unicode url: The url of a video.
+ :returns: A playable video url.
+ """
+ # Attemp to find url using extract_source(YTDL) first
+ url = url_constructor(url)
+ source_url = plugin.extract_source(url)
+ if source_url:
+ return source_url
+
+ # Fallback to search for direct file
+ html = plugin.request.get(url).text
+ search_regx = 'file:\s+\'(\S+?)\''
+ match = re.findall(search_regx, html)
+ if match:
+ return match[0]
+
+
+@Resolver.register
+def party_play(plugin, url):
+ """
+ :param Resolver plugin: The plugin parent object.
+ :param unicode url: The url to a video.
+ :return: A playlist with the first item been a playable video url and the seconde been a callback url that
+ will fetch the next video url to play.
+ """
+ # Attempt to fetch a video url 3 times
+ attempts = 0
+ while attempts < 3:
+ try:
+ url = play_video(plugin, url)
+ except Exception as e:
+ # Raise the Exception if we are on the last run of the loop
+ if attempts == 2:
+ raise e
+ else:
+ if url:
+ # Break from loop when we have a url
+ return plugin.create_loopback(url)
+
+ # Increment attempts counter
+ attempts += 1
+
+ # All 3 attemps failed to resolve a url
+ return None
+
+
+# Initiate Startup
+if __name__ == "__main__":
+ run()
diff --git a/plugin.video.metalvideo/addon.xml b/plugin.video.metalvideo/addon.xml
new file mode 100644
index 0000000..c436fae
--- /dev/null
+++ b/plugin.video.metalvideo/addon.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<addon id="plugin.video.metalvideo" name="Metalvideo" provider-name="willforde" version="3.0.0">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="script.module.codequick" version="0.9.0"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource" library="addon.py">
+ <provides>audio video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <summary lang="en_GB">Heavy Metal Music Videos.</summary>
+ <description lang="en_GB">A Place for all your heavy metal music videos, With loads of categorys.</description>
+ <license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license>
+ <source>https://github.com/willforde/plugin.video.metalvideo</source>
+ <forum>http://forum.kodi.tv/showthread.php?tid=178798</forum>
+ <website>http://metalvideo.com</website>
+ <email>willforde+addon@gmail.com</email>
+ <platform>all</platform>
+ <language>en</language>
+ <assets>
+ <icon>resources/icon.png</icon>
+ <fanart>resources/fanart.jpg</fanart>
+ <screenshot>resources/screenshots/screenshot000.jpg</screenshot>
+ <screenshot>resources/screenshots/screenshot001.jpg</screenshot>
+ <screenshot>resources/screenshots/screenshot002.jpg</screenshot>
+ </assets>
+ <news>[upd] Upgraded to use the codequick framework.</news>
+ </extension>
+</addon>
diff --git a/plugin.video.metalvideo/resources/fanart.jpg b/plugin.video.metalvideo/resources/fanart.jpg
new file mode 100644
index 0000000..60989ca
--- /dev/null
+++ b/plugin.video.metalvideo/resources/fanart.jpg
Binary files differ
diff --git a/plugin.video.metalvideo/resources/icon.png b/plugin.video.metalvideo/resources/icon.png
new file mode 100644
index 0000000..d7d6bb4
--- /dev/null
+++ b/plugin.video.metalvideo/resources/icon.png
Binary files differ
diff --git a/plugin.video.metalvideo/resources/language/resource.language.en_gb/strings.po b/plugin.video.metalvideo/resources/language/resource.language.en_gb/strings.po
new file mode 100644
index 0000000..8dd29a3
--- /dev/null
+++ b/plugin.video.metalvideo/resources/language/resource.language.en_gb/strings.po
@@ -0,0 +1,49 @@
+# Kodi Media Center language file
+# Addon Name: MetalVideo
+# Addon id: plugin.video.metalvideo
+# Addon Provider: willforde
+msgid ""
+msgstr ""
+"Project-Id-Version: Kodi Addons\n"
+"Report-Msgid-Bugs-To: alanwww1@kodi.org\n"
+"POT-Creation-Date: 2016-01-28 21:10+0000\n"
+"PO-Revision-Date: 2017-08-01 04:17+0000\n"
+"Last-Translator: Kodi Translation Team\n"
+"Language-Team: English (http://www.transifex.com/projects/p/xbmc-addons/language/en/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+###############################
+# Addon Codes: 30000 to 30199 #
+###############################
+
+msgctxt "#30001"
+msgid "Please Select Top 50"
+msgstr ""
+
+msgctxt "#30002"
+msgid "[B]Top 50 Videos[/B]"
+msgstr ""
+
+msgctxt "#30004"
+msgid "[B]Video of the day[/B]"
+msgstr ""
+
+msgctxt "#30005"
+msgid "[B]Being watched right now[/B]"
+msgstr ""
+
+##################################
+# Settings Codes: 30300 to 30399 #
+##################################
+
+msgctxt "#30301"
+msgid "Sort By"
+msgstr ""
+
+msgctxt "#30302"
+msgid "Views"
+msgstr ""
diff --git a/plugin.video.metalvideo/resources/screenshots/screenshot000.jpg b/plugin.video.metalvideo/resources/screenshots/screenshot000.jpg
new file mode 100644
index 0000000..12a3ada
--- /dev/null
+++ b/plugin.video.metalvideo/resources/screenshots/screenshot000.jpg
Binary files differ
diff --git a/plugin.video.metalvideo/resources/screenshots/screenshot001.jpg b/plugin.video.metalvideo/resources/screenshots/screenshot001.jpg
new file mode 100644
index 0000000..af0e823
--- /dev/null
+++ b/plugin.video.metalvideo/resources/screenshots/screenshot001.jpg
Binary files differ
diff --git a/plugin.video.metalvideo/resources/screenshots/screenshot002.jpg b/plugin.video.metalvideo/resources/screenshots/screenshot002.jpg
new file mode 100644
index 0000000..eebaa80
--- /dev/null
+++ b/plugin.video.metalvideo/resources/screenshots/screenshot002.jpg
Binary files differ
diff --git a/plugin.video.metalvideo/resources/settings.xml b/plugin.video.metalvideo/resources/settings.xml
new file mode 100644
index 0000000..dc387e0
--- /dev/null
+++ b/plugin.video.metalvideo/resources/settings.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<settings>
+ <category>
+ <!-- Misc -->
+ <setting id="sort" type="enum" label="30301" lvalues="552|557|563|30302" default="0" />
+ </category>
+</settings> \ No newline at end of file
diff --git a/plugin.video.mlbtv/addon.xml b/plugin.video.mlbtv/addon.xml
index 3c2f6bd..7ef5aa8 100644
--- a/plugin.video.mlbtv/addon.xml
+++ b/plugin.video.mlbtv/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.video.mlbtv" name="MLB.TV®" version="2017.4.2" provider-name="eracknaphobia">
+<addon id="plugin.video.mlbtv" name="MLB.TV®" version="2017.11.28" provider-name="eracknaphobia">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
<import addon="script.module.simplejson" version="3.3.0"/>
@@ -15,8 +15,8 @@
<description lang="en_GB">Watch every out-of-market regular season game in the office or on the go. The #1 LIVE Streaming Sports Service</description>
<disclaimer lang="en_GB"></disclaimer>
<news>
-- Added Proxy settings
-- Removed PIL (it was causing crashes)
+- Fixed Invalid XML issue
+
</news>
<language>en</language>
<platform>all</platform>
diff --git a/plugin.video.mlbtv/main.py b/plugin.video.mlbtv/main.py
index 7149b11..5a885a0 100644
--- a/plugin.video.mlbtv/main.py
+++ b/plugin.video.mlbtv/main.py
@@ -563,25 +563,25 @@ def createFullGameStream(stream_url, media_auth, media_state):
if bandwidth != '':
if media_state == 'MEDIA_ARCHIVE':
#ARCHIVE
- #http://mlblive-akc.mlb.com/ls04/mlbam/2016/03/02/MLB_GAME_VIDEO_DETNYA_HOME_20160302/master_wired.m3u8
- #http://mlblive-akc.mlb.com/ls04/mlbam/2016/03/02/MLB_GAME_VIDEO_DETNYA_HOME_20160302/1800K/1800_complete-trimmed.m3u8
- stream_url = stream_url.replace(MASTER_FILE_TYPE, bandwidth+'K/'+bandwidth+'_complete-trimmed.m3u8')
-
+ #stream_url = stream_url.replace(MASTER_FILE_TYPE, bandwidth+'K/'+bandwidth+'_complete_fwv2-trimmed.m3u8')
+ stream_url = stream_url.replace(MASTER_FILE_TYPE, bandwidth+'K/'+bandwidth+'_complete-trimmed.m3u8')
elif media_state == 'MEDIA_ON':
- #LIVE
- #5000K/5000_slide.m3u8 OR #3500K/3500_complete.m3u8
- # Slide = Live, Complete = Watch from beginning?
- stream_url = stream_url.replace(MASTER_FILE_TYPE, bandwidth+'K/'+bandwidth+'_complete.m3u8')
-
-
+ #LIVE
+ #stream_url = stream_url.replace(MASTER_FILE_TYPE, bandwidth+'K/'+bandwidth+'_slide_fwv2.m3u8')
+ stream_url = stream_url.replace(MASTER_FILE_TYPE, bandwidth+'K/'+bandwidth+'_complete.m3u8')
+
+ #CDN
+ akc_url = 'akc.mlb.com'
+ l3c_url = 'l3c.mlb.com'
+ if CDN == 'Akamai' and akc_url not in stream_url:
+ stream_url = stream_url.replace(l3c_url,akc_url)
+ elif CDN == 'Level 3' and l3c_url not in stream_url:
+ stream_url = stream_url.replace(akc_url,l3c_url)
- #cj = cookielib.LWPCookieJar()
- #cj.load(os.path.join(ADDON_PATH_PROFILE, 'cookies.lwp'),ignore_discard=True)
+ #stream_url = stream_url + '|User-Agent='+UA_IPAD+'&Cookie='+media_auth
stream_url = stream_url + '|User-Agent='+UA_PS4+'&Cookie='+media_auth
return stream_url
-
-
def fetchStream(content_id,event_id,playback_scenario):
diff --git a/plugin.video.mlbtv/resources/language/resource.language.en_gb/strings.po b/plugin.video.mlbtv/resources/language/resource.language.en_gb/strings.po
index 46d5ecf..ee8d6ea 100644
--- a/plugin.video.mlbtv/resources/language/resource.language.en_gb/strings.po
+++ b/plugin.video.mlbtv/resources/language/resource.language.en_gb/strings.po
@@ -44,6 +44,10 @@ msgctxt "#160"
msgid "Stream Quality"
msgstr ""
+msgctxt "#165"
+msgid "CDN"
+msgstr ""
+
msgctxt "#170"
msgid "Hide Scores"
msgstr ""
diff --git a/plugin.video.mlbtv/resources/lib/globals.py b/plugin.video.mlbtv/resources/lib/globals.py
index 15d15a3..6189c16 100644
--- a/plugin.video.mlbtv/resources/lib/globals.py
+++ b/plugin.video.mlbtv/resources/lib/globals.py
@@ -37,6 +37,7 @@ OLD_USERNAME = str(settings.getSetting(id="old_username"))
OLD_PASSWORD = str(settings.getSetting(id="old_password"))
ROGERS_SUBSCRIBER = str(settings.getSetting(id="rogers"))
QUALITY = str(settings.getSetting(id="quality"))
+CDN = str(settings.getSetting(id="cdn"))
NO_SPOILERS = settings.getSetting(id="no_spoilers")
FAV_TEAM = str(settings.getSetting(id="fav_team"))
TEAM_NAMES = settings.getSetting(id="team_names")
diff --git a/plugin.video.mlbtv/resources/settings.xml b/plugin.video.mlbtv/resources/settings.xml
index f579877..2e38e0c 100644
--- a/plugin.video.mlbtv/resources/settings.xml
+++ b/plugin.video.mlbtv/resources/settings.xml
@@ -5,11 +5,12 @@
<setting id="username" type="text" label="140" default=""/>
<setting id="password" type="text" label="150" option="hidden" default=""/>
<setting id="single_team" type="bool" label="151" default="false"/>
- <setting label="156" type="action" action="RunPlugin(plugin://plugin.video.mlbtv/?url=junk&mode=400)" option="close" />
+ <setting label="156" type="action" action="RunPlugin(plugin://plugin.video.mlbtv/?url=junk&amp;mode=400)" option="close" />
<!-- <setting label="156" type="action" action="RunScript(special://home/addons/plugin.video.nhlgcl/resources/lib/logout.py)" option="close" /> -->
</category>
<category label="159">
<setting id="quality" type="labelenum" label="160" values="SD (450 kbps)|SD (800 kbps)|SD (1200 kbps)|SD (1800 kbps)|HD (2500 kbps)|HD (3500 kbps)|HD (5000 kbps)|Best Available|Always Ask" default="HD (5000 kbps)" />
+ <setting id="cdn" type="labelenum" label="165" values="Akamai|Level 3|No Preference" default="No Preference"/>
<setting id="no_spoilers" type="enum" label="170" lvalues="1700|1701|1702|1703|1704" />
<setting id="fav_team" type="labelenum" label="180" default="None" values="None|Washington Nationals|Toronto Blue Jays|Texas Rangers|Tampa Bay Rays|St. Louis Cardinals|Seattle Mariners|San Francisco Giants|San Diego Padres|Pittsburgh Pirates|Philadelphia Phillies|Oakland Athletics|New York Yankees|New York Mets|Minnesota Twins|Milwaukee Brewers|Los Angeles Dodgers|Los Angeles Angels|Kansas City Royals|Miami Marlins|Houston Astros|Detroit Tigers|Colorado Rockies|Cleveland Indians|Cincinnati Reds|Chicago White Sox|Chicago Cubs|Boston Red Sox|Baltimore Orioles|Atlanta Braves|Arizona Diamondbacks" />
diff --git a/plugin.video.montreal.greek-tv/LICENSE.txt b/plugin.video.montreal.greek-tv/LICENSE.txt
new file mode 100644
index 0000000..69f6cb3
--- /dev/null
+++ b/plugin.video.montreal.greek-tv/LICENSE.txt
@@ -0,0 +1,674 @@
+GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ {one line to give the program's name and a brief idea of what it does.}
+ Copyright (C) 2017 {name of author}
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ plugin.video.montreal.greek-tv Copyright (C) 2017 Jeffrey Thgiliwt
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>. \ No newline at end of file
diff --git a/plugin.video.montreal.greek-tv/README.md b/plugin.video.montreal.greek-tv/README.md
new file mode 100644
index 0000000..cf61654
--- /dev/null
+++ b/plugin.video.montreal.greek-tv/README.md
@@ -0,0 +1,7 @@
+## plugin.video.montreal.greek-tv
+
+# Montreal Greek TV
+
+A Kodi addon featuring streams from Montreal Greek TV & Radio Stations
+
+Artwork provided by Montreal Greek TV webmaster \ No newline at end of file
diff --git a/plugin.video.montreal.greek-tv/addon.py b/plugin.video.montreal.greek-tv/addon.py
new file mode 100644
index 0000000..845bbe1
--- /dev/null
+++ b/plugin.video.montreal.greek-tv/addon.py
@@ -0,0 +1,114 @@
+# -*- coding: utf-8 -*-
+
+"""
+ Montreal Greek TV Add-on
+ Author: Twilight0
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+"""
+
+import requests
+import CommonFunctions as common
+from base64 import b64decode
+from resources.lib import control, youtube, cache, directory, syshandle, sysaddon, action, url
+
+
+# Misc variables:
+addonicon = control.addonInfo('icon')
+addonart = control.join(control.addonPath, 'resources/media')
+livetv_img = control.join(addonart, 'livetv.png')
+radio_img = control.join(addonart, 'radio.png')
+youtube_img = control.join(addonart, 'youtube.png')
+settings_img = control.join(addonart, 'settings.png')
+
+# Please do not copy these keys, instead create your own:
+# http://forum.kodi.tv/showthread.php?tid=267160&pid=2299960#pid2299960
+
+key = b64decode('QUl6YVN5QThrMU95TEdmMDNIQk5sMGJ5RDUxMWpyOWNGV28yR1I0')
+ytid = 'UCFr8nqHDhA_fLQq2lEK3Mlw'
+old_radio_url = 'http://209.95.50.189:8049/stream'
+
+
+def yt():
+ return youtube.youtube(key=key).videos(ytid)
+
+
+def vod():
+
+ video_list = cache.get(yt, 12)
+
+ print video_list
+
+ for v in video_list:
+ v.update({'action': 'play', 'isFolder': 'False'})
+
+ directory.add(video_list)
+
+
+def main_menu():
+
+ xml = requests.get(url='http://www.greekradio.net/mgtv.xml').text
+
+ mgtv = common.parseDOM(xml, 'title')[0]
+ livetv_url = common.parseDOM(xml, 'url')[0]
+ mgr = common.parseDOM(xml, 'title')[1]
+ new_radio_url = common.parseDOM(xml, 'url')[1]
+
+ # Live TV
+ url1 = '{0}?action=play&url={1}'.format(sysaddon, livetv_url)
+ li = control.item(label=mgtv)
+ li.setArt({'icon': livetv_img, 'thumb': livetv_img, 'fanart': control.addonInfo('fanart')})
+ li.setInfo('video', {'title': mgtv})
+ li.setProperty('IsPlayable', 'true')
+ control.addItem(handle=syshandle, url=url1, listitem=li, isFolder=False)
+
+ # Radio
+ url2 = '{0}?action=play&url={1}'.format(sysaddon, new_radio_url if control.setting('old-url') == 'false' else old_radio_url)
+ li = control.item(label=mgr)
+ li.setArt({'icon': radio_img, 'thumb': radio_img, 'fanart': control.addonInfo('fanart')})
+ li.setInfo('audio', {'title': mgr})
+ li.setProperty('IsPlayable', 'true')
+ control.addItem(handle=syshandle, url=url2, listitem=li, isFolder=False)
+
+ # Youtube
+ url3 = '{0}?action=youtube'.format(sysaddon)
+ li = control.item(label='Montreal Greek TV - Youtube Channel')
+ li.setArt({'icon': youtube_img, 'thumb': youtube_img, 'fanart': control.addonInfo('fanart')})
+ li.setInfo('video', {'title': 'Montreal Greek TV - Youtube Channel'})
+ control.addItem(handle=syshandle, url=url3, listitem=li, isFolder=True)
+
+ control.directory(syshandle)
+
+
+def play_item(path):
+
+ li = control.item(path=path)
+ control.resolve(syshandle, True, listitem=li)
+
+
+if action is None:
+
+ main_menu()
+
+elif action == 'play':
+
+ play_item(url)
+
+elif action == 'youtube':
+
+ vod()
+
+elif action == 'settings':
+
+ control.openSettings()
diff --git a/plugin.video.montreal.greek-tv/addon.xml b/plugin.video.montreal.greek-tv/addon.xml
new file mode 100644
index 0000000..f67862c
--- /dev/null
+++ b/plugin.video.montreal.greek-tv/addon.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<addon id="plugin.video.montreal.greek-tv" name="Montreal Greek TV" version="1.2.1" provider-name="Twilight0">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="script.module.requests" version="2.12.4"/>
+ <import addon="script.module.parsedom" version="2.5.2"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource" library="addon.py">
+ <provides>video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <platform>all</platform>
+ <summary lang="en_GB">Montreal Greek TV addon</summary>
+ <description lang="en_GB">Montreal Greek TV add-on for Kodi featuring Live TV, Radio and Video on demand streams from Montreal, Quebec, Canada. Montreal Greek Television is broadcasting in-house locally-produced Canadian programming in the Greek language from the Greek Community of Greater Montreal.</description>
+ <summary lang="el_gr">Πρόσθετο Montreal Greek TV</summary>
+ <description lang="el_gr">Το πρόσθετο Montreal Greek TV για το σύστημα πολυμέσων Kodi προσφέρει ζωντανή τηλεόραση, ραδιόφωνο και ροές κατ' απαίτηση από το Μόντρεαλ, Κεμπέκ, Καναδά. Η Τηλεόραση Montreak Greek εκπέμπει περιεχόμενο τοπικής παραγωγής εις την Ελληνική γλώσσα από την Ελληνική κοινότητα της ευρύτερης περιοχής του Μόντρεαλ.</description>
+ <language>en el</language>
+ <license>GNU General Public License, v3</license>
+ <size>338115</size>
+ <news>
+1.2.1 (16-11-2017)
+- Few minor tweaks here &amp; there
+- Tinified artwork
+- Removed client module &amp; replace it with parsedom
+
+1.2.0 (02-08-2017)
+- Made several changes to comply with Kodi addon submission rules
+- Removed request function from client module, using requests library instead
+- Made icons non-transparent
+
+1.1.0 (16-07-2017)
+- Made items' info remotely hosted
+
+1.0.2 (19-06-2017)
+- New radio stream
+
+1.0.1 (25-05-2017)
+- Minor changes to artwork
+
+1.0.0 (08-05-2017)
+- Initial Version
+ </news>
+ <assets>
+ <icon>icon.png</icon>
+ <fanart>fanart.jpg</fanart>
+ </assets>
+ <website>http://www.greekradio.net/</website>
+ <email>twilight@freemail.gr</email>
+ <source>https://github.com/Twilight0/plugin.video.montreal.greek-tv/</source>
+ </extension>
+</addon>
diff --git a/plugin.video.montreal.greek-tv/changelog.txt b/plugin.video.montreal.greek-tv/changelog.txt
new file mode 100644
index 0000000..074863f
--- /dev/null
+++ b/plugin.video.montreal.greek-tv/changelog.txt
@@ -0,0 +1,19 @@
+1.2.1 (16-11-2017)
+- Few minor tweaks here &amp; there
+
+1.2.0 (02-08-2017)
+- Made several changes to comply with Kodi addon submission rules
+- Removed request function from client module, using requests library instead
+- Made icons non-transparent
+
+1.1.0 (16-07-2017)
+- Made items' info remotely hosted
+
+1.0.2 (19-06-2017)
+- New radio stream
+
+1.0.1 (25-05-2017)
+- Minor changes to artwork
+
+1.0.0 (08-05-2017)
+- Initial Version \ No newline at end of file
diff --git a/plugin.video.montreal.greek-tv/fanart.jpg b/plugin.video.montreal.greek-tv/fanart.jpg
new file mode 100644
index 0000000..8543ae3
--- /dev/null
+++ b/plugin.video.montreal.greek-tv/fanart.jpg
Binary files differ
diff --git a/plugin.video.montreal.greek-tv/icon.png b/plugin.video.montreal.greek-tv/icon.png
new file mode 100644
index 0000000..08c089c
--- /dev/null
+++ b/plugin.video.montreal.greek-tv/icon.png
Binary files differ
diff --git a/plugin.video.montreal.greek-tv/resources/__init__.py b/plugin.video.montreal.greek-tv/resources/__init__.py
new file mode 100644
index 0000000..d3f5a12
--- /dev/null
+++ b/plugin.video.montreal.greek-tv/resources/__init__.py
@@ -0,0 +1 @@
+
diff --git a/plugin.video.montreal.greek-tv/resources/language/resource.language.el_gr/strings.po b/plugin.video.montreal.greek-tv/resources/language/resource.language.el_gr/strings.po
new file mode 100644
index 0000000..2c2212f
--- /dev/null
+++ b/plugin.video.montreal.greek-tv/resources/language/resource.language.el_gr/strings.po
@@ -0,0 +1,40 @@
+# Addon Name: Montreal Greek TV
+# Addon id: plugin.video.montreal.greek-tv
+# Addon Provider: Twilight0
+msgid ""
+msgstr ""
+"Project-Id-Version: Montreal Greek TV\n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: 2016-06-22 11:29+0000\n"
+"Last-Translator: twilight0\n"
+"Language-Team: English (http://www.domain.com)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: el\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "#30001"
+msgid "General"
+msgstr "Γενικά"
+
+msgctxt "#30002"
+msgid "Use old radio stream"
+msgstr "Κάνε χρήση της παλαιάς ροής ραδιοφώνου"
+
+msgctxt "#30003"
+msgid ""
+msgstr ""
+
+msgctxt "#30004"
+msgid ""
+msgstr ""
+
+msgctxt "#30005"
+msgid ""
+msgstr ""
+
+msgctxt "#30006"
+msgid ""
+msgstr ""
+
diff --git a/plugin.video.montreal.greek-tv/resources/language/resource.language.en_gb/strings.po b/plugin.video.montreal.greek-tv/resources/language/resource.language.en_gb/strings.po
new file mode 100644
index 0000000..91a20cd
--- /dev/null
+++ b/plugin.video.montreal.greek-tv/resources/language/resource.language.en_gb/strings.po
@@ -0,0 +1,39 @@
+# Addon Name: Montreal Greek TV
+# Addon id: plugin.video.montreal.greek-tv
+# Addon Provider: Twilight0
+msgid ""
+msgstr ""
+"Project-Id-Version: Montreal Greek TV\n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: 2016-06-22 11:29+0000\n"
+"Last-Translator: twilight0\n"
+"Language-Team: English (http://www.domain.com)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "#30001"
+msgid "General"
+msgstr ""
+
+msgctxt "#30002"
+msgid "Use old radio stream"
+msgstr ""
+
+msgctxt "#30003"
+msgid ""
+msgstr ""
+
+msgctxt "#30004"
+msgid ""
+msgstr ""
+
+msgctxt "#30005"
+msgid ""
+msgstr ""
+
+msgctxt "#30006"
+msgid ""
+msgstr ""
diff --git a/plugin.video.montreal.greek-tv/resources/lib/__init__.py b/plugin.video.montreal.greek-tv/resources/lib/__init__.py
new file mode 100644
index 0000000..96ddb71
--- /dev/null
+++ b/plugin.video.montreal.greek-tv/resources/lib/__init__.py
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+
+"""
+ Montreal Greek TV Add-on
+ Author: Twilight0
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+"""
+
+import sys, urlparse
+
+sysaddon = sys.argv[0]
+syshandle = int(sys.argv[1])
+params = dict(urlparse.parse_qsl(sys.argv[2][1:]))
+action = params.get('action', None)
+url = params.get('url')
diff --git a/plugin.video.montreal.greek-tv/resources/lib/cache.py b/plugin.video.montreal.greek-tv/resources/lib/cache.py
new file mode 100644
index 0000000..6c77d5f
--- /dev/null
+++ b/plugin.video.montreal.greek-tv/resources/lib/cache.py
@@ -0,0 +1,149 @@
+# -*- coding: utf-8 -*-
+
+'''
+ Tulip routine libraries, based on lambda's lamlib
+ Author Twilight0
+
+ License summary below, for more details please read license.txt file
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+'''
+
+
+import re, hashlib, time
+
+try:
+ from sqlite3 import dbapi2 as database
+except:
+ from pysqlite2 import dbapi2 as database
+
+import control
+
+
+def get(function, timeout, *args, **table):
+ try:
+ response = None
+
+ f = repr(function)
+ f = re.sub('.+\smethod\s|.+function\s|\sat\s.+|\sof\s.+', '', f)
+
+ a = hashlib.md5()
+ for i in args: a.update(str(i))
+ a = str(a.hexdigest())
+ except:
+ pass
+
+ try:
+ table = table['table']
+ except:
+ table = 'rel_list'
+
+ try:
+ control.makeFile(control.dataPath)
+ dbcon = database.connect(control.cacheFile)
+ dbcur = dbcon.cursor()
+ dbcur.execute("SELECT * FROM %s WHERE func = '%s' AND args = '%s'" % (table, f, a))
+ match = dbcur.fetchone()
+
+ response = eval(match[2].encode('utf-8'))
+
+ t1 = int(match[3])
+ t2 = int(time.time())
+ update = (abs(t2 - t1) / 3600) >= int(timeout)
+ if update == False:
+ return response
+ except:
+ pass
+
+ try:
+ r = function(*args)
+ if (r == None or r == []) and not response == None:
+ return response
+ elif (r == None or r == []):
+ return r
+ except:
+ return
+
+ try:
+ r = repr(r)
+ t = int(time.time())
+ dbcur.execute("CREATE TABLE IF NOT EXISTS %s (""func TEXT, ""args TEXT, ""response TEXT, ""added TEXT, ""UNIQUE(func, args)"");" % table)
+ dbcur.execute("DELETE FROM %s WHERE func = '%s' AND args = '%s'" % (table, f, a))
+ dbcur.execute("INSERT INTO %s Values (?, ?, ?, ?)" % table, (f, a, r, t))
+ dbcon.commit()
+ except:
+ pass
+
+ try:
+ return eval(r.encode('utf-8'))
+ except:
+ pass
+
+
+def timeout(function, *args, **table):
+ try:
+ response = None
+
+ f = repr(function)
+ f = re.sub('.+\smethod\s|.+function\s|\sat\s.+|\sof\s.+', '', f)
+
+ a = hashlib.md5()
+ for i in args: a.update(str(i))
+ a = str(a.hexdigest())
+ except:
+ pass
+
+ try:
+ table = table['table']
+ except:
+ table = 'rel_list'
+
+ try:
+ control.makeFile(control.dataPath)
+ dbcon = database.connect(control.cacheFile)
+ dbcur = dbcon.cursor()
+ dbcur.execute("SELECT * FROM %s WHERE func = '%s' AND args = '%s'" % (table, f, a))
+ match = dbcur.fetchone()
+ return int(match[3])
+ except:
+ return
+
+
+def clear(table=None):
+ try:
+ control.idle()
+
+ if table is None:
+ table = ['rel_list', 'rel_lib']
+ elif not type(table) == list:
+ table = [table]
+
+ yes = control.yesnoDialog(control.lang(30401).encode('utf-8'), '', '')
+ if not yes:
+ return
+
+ dbcon = database.connect(control.cacheFile)
+ dbcur = dbcon.cursor()
+
+ for t in table:
+ try:
+ dbcur.execute("DROP TABLE IF EXISTS %s" % t)
+ dbcur.execute("VACUUM")
+ dbcon.commit()
+ except:
+ pass
+
+ control.infoDialog(control.lang(30402).encode('utf-8'))
+ except:
+ pass
+
+
diff --git a/plugin.video.montreal.greek-tv/resources/lib/control.py b/plugin.video.montreal.greek-tv/resources/lib/control.py
new file mode 100644
index 0000000..3e6a8d7
--- /dev/null
+++ b/plugin.video.montreal.greek-tv/resources/lib/control.py
@@ -0,0 +1,147 @@
+# -*- coding: utf-8 -*-
+
+'''
+ Tulip routine libraries, based on lambda's lamlib
+ Author Twilight0
+
+ License summary below, for more details please read license.txt file
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+'''
+
+
+import os, xbmc, xbmcaddon, xbmcplugin, xbmcgui, xbmcvfs
+
+
+integer = 1000
+lang = xbmcaddon.Addon().getLocalizedString
+setting = xbmcaddon.Addon().getSetting
+setSetting = xbmcaddon.Addon().setSetting
+addon = xbmcaddon.Addon
+addonInfo = xbmcaddon.Addon().getAddonInfo
+
+addItem = xbmcplugin.addDirectoryItem
+addItems = xbmcplugin.addDirectoryItems
+directory = xbmcplugin.endOfDirectory
+content = xbmcplugin.setContent
+property = xbmcplugin.setProperty
+resolve = xbmcplugin.setResolvedUrl
+
+infoLabel = xbmc.getInfoLabel
+condVisibility = xbmc.getCondVisibility
+jsonrpc = xbmc.executeJSONRPC
+keyboard = xbmc.Keyboard
+sleep = xbmc.sleep
+execute = xbmc.executebuiltin
+skin = xbmc.getSkinDir()
+player = xbmc.Player()
+playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
+
+transPath = xbmc.translatePath
+skinPath = xbmc.translatePath('special://skin/')
+addonPath = xbmc.translatePath(addonInfo('path'))
+dataPath = xbmc.translatePath(addonInfo('profile')).decode('utf-8')
+
+window = xbmcgui.Window(10000)
+dialog = xbmcgui.Dialog()
+progressDialog = xbmcgui.DialogProgress()
+windowDialog = xbmcgui.WindowDialog()
+button = xbmcgui.ControlButton
+image = xbmcgui.ControlImage
+alphanum_input = xbmcgui.INPUT_ALPHANUM
+password_input = xbmcgui.INPUT_PASSWORD
+hide_input = xbmcgui.ALPHANUM_HIDE_INPUT
+item = xbmcgui.ListItem
+
+openFile = xbmcvfs.File
+makeFile = xbmcvfs.mkdir
+deleteFile = xbmcvfs.delete
+deleteDir = xbmcvfs.rmdir
+listDir = xbmcvfs.listdir
+exists = xbmcvfs.exists
+copy = xbmcvfs.copy
+
+join = os.path.join
+settingsFile = os.path.join(dataPath, 'settings.xml')
+bookmarksFile = os.path.join(dataPath, 'bookmarks.db')
+cacheFile = os.path.join(dataPath, 'cache.db')
+
+
+def infoDialog(message, heading=addonInfo('name'), icon='', time=3000):
+ if icon == '':
+ icon = addonInfo('icon')
+ try:
+ dialog.notification(heading, message, icon, time, sound=False)
+ except:
+ execute("Notification(%s, %s, %s, %s)" % (heading, message, time, icon))
+
+
+def okDialog(heading, line1):
+ return dialog.ok(heading, line1)
+
+
+def inputDialog(heading):
+ return dialog.input(heading)
+
+
+def yesnoDialog(line1, line2, line3, heading=addonInfo('name'), nolabel='', yeslabel=''):
+ return dialog.yesno(heading, line1, line2, line3, nolabel, yeslabel)
+
+
+def selectDialog(list, heading=addonInfo('name')):
+ return dialog.select(heading, list)
+
+
+def openSettings(query=None, id=addonInfo('id')):
+ try:
+ idle()
+ execute('Addon.OpenSettings(%s)' % id)
+ if query is None:
+ raise Exception()
+ c, f = query.split('.')
+ execute('SetFocus(%i)' % (int(c) + 100))
+ execute('SetFocus(%i)' % (int(f) + 200))
+ except:
+ return
+
+
+def openSettings_alt():
+ try:
+ idle()
+ xbmcaddon.Addon().openSettings()
+ except:
+ return
+
+
+def openPlaylist():
+ return execute('ActivateWindow(VideoPlaylist)')
+
+
+def refresh():
+ return execute('Container.Refresh')
+
+
+def idle():
+ return execute('Dialog.Close(busydialog)')
+
+
+def wait4abort(secs=None):
+ return xbmc.Monitor().waitForAbort(secs)
+
+
+def set_view_mode(vmid):
+ return execute('Container.SetViewMode({0})'.format(vmid))
+
+
+# for compartmentalized theme addons
+def addonmedia(icon):
+ return join(addonPath, 'resources', 'media', icon)
diff --git a/plugin.video.montreal.greek-tv/resources/lib/directory.py b/plugin.video.montreal.greek-tv/resources/lib/directory.py
new file mode 100644
index 0000000..3ae0b04
--- /dev/null
+++ b/plugin.video.montreal.greek-tv/resources/lib/directory.py
@@ -0,0 +1,146 @@
+# -*- coding: utf-8 -*-
+
+'''
+ Tulip routine libraries, based on lambda's lamlib
+ Author Twilight0
+
+ License summary below, for more details please read license.txt file
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+'''
+
+import sys
+import urllib
+import control
+
+
+
+def add(items, cacheToDisc=True, content=None, mediatype=None, infotype='video'):
+
+ if items is None or len(items) == 0:
+ return
+
+ sysicon = control.join(control.addonInfo('path'), 'resources', 'media')
+ sysimage = control.addonInfo('icon')
+ sysfanart = control.addonInfo('fanart')
+
+ for i in items:
+ try:
+ try:
+ label = control.lang(i['title']).encode('utf-8')
+ except:
+ label = i['title']
+
+ if 'label' in i and not i['label'] == '0':
+ label = i['label']
+
+ if 'image' in i and not i['image'] == '0':
+ image = i['image']
+ elif 'poster' in i and not i['poster'] == '0':
+ image = i['poster']
+ elif 'icon' in i and not i['icon'] == '0':
+ image = control.join(sysicon, i['icon'])
+ else:
+ image = sysimage
+
+ if 'banner' in i and not i['banner'] == '0':
+ banner = i['banner']
+ elif 'fanart' in i and not i['fanart'] == '0':
+ banner = i['fanart']
+ else:
+ banner = image
+
+ fanart = i['fanart'] if 'fanart' in i and not i['fanart'] == '0' else sysfanart
+
+ isFolder = False if 'isFolder' in i and not i['isFolder'] == '0' else True
+
+ url = '%s?action=%s' % (sys.argv[0], i['action'])
+
+ try:
+ url += '&url=%s' % urllib.quote_plus(i['url'])
+ except:
+ pass
+ try:
+ url += '&image=%s' % urllib.quote_plus(i['image'])
+ except:
+ pass
+
+ cm = []
+ menus = i['cm'] if 'cm' in i else []
+
+ for menu in menus:
+ try:
+ try:
+ tmenu = control.lang(menu['title']).encode('utf-8')
+ except:
+ tmenu = menu['title']
+ qmenu = urllib.urlencode(menu['query'])
+ cm.append((tmenu, 'RunPlugin(%s?%s)' % (sys.argv[0], qmenu)))
+ except:
+ pass
+
+ meta = dict((k, v) for k, v in i.iteritems() if not k == 'cm' and not v == '0')
+ if mediatype is not None:
+ meta['mediatype'] = mediatype
+
+ item = control.item(label=label, iconImage=image, thumbnailImage=image)
+
+ item.setArt({'icon': image, 'thumb': image, 'poster': image, 'tvshow.poster': image, 'season.poster': image, 'banner': banner, 'tvshow.banner': banner, 'season.banner': banner})
+
+ item.setProperty('Fanart_Image', fanart)
+
+ item.addContextMenuItems(cm)
+ item.setInfo(type=infotype, infoLabels = meta)
+ if not isFolder:
+ item.setProperty('IsPlayable', 'true')
+
+ control.addItem(handle=int(sys.argv[1]), url=url, listitem=item, isFolder=isFolder)
+ except:
+ pass
+
+ try:
+ i = items[0]
+ if i['next'] == '':
+ raise Exception()
+
+ url = '%s?action=%s&url=%s' % (sys.argv[0], i['nextaction'], urllib.quote_plus(i['next']))
+ icon = i['nexticon'] if 'nexticon' in i else control.join(sysicon, 'next.png')
+ fanart = i['nextfanart'] if 'nextfanart' in i else sysfanart
+ try:
+ label = control.lang(i['nextlabel']).encode('utf-8')
+ except:
+ label = 'next'
+
+ item = control.item(label=label, iconImage=icon, thumbnailImage=icon)
+ item.setArt({'icon': icon, 'thumb': icon, 'poster': icon, 'tvshow.poster': icon, 'season.poster': icon, 'banner': icon, 'tvshow.banner': icon, 'season.banner': icon})
+ item.setProperty('Fanart_Image', fanart)
+ control.addItem(handle=int(sys.argv[1]), url=url, listitem=item, isFolder=True)
+ except:
+ pass
+
+ if not content is None:
+ control.content(int(sys.argv[1]), content)
+
+ control.directory(int(sys.argv[1]), cacheToDisc=cacheToDisc)
+
+
+def resolve(url, meta=None, icon=None):
+
+ item = control.item(path=url)
+
+ if not icon is None:
+ item.setArt({'icon': icon, 'thumb': icon})
+
+ if not meta is None:
+ item.setInfo(type='Video', infoLabels=meta)
+
+ control.resolve(int(sys.argv[1]), True, item)
diff --git a/plugin.video.montreal.greek-tv/resources/lib/workers.py b/plugin.video.montreal.greek-tv/resources/lib/workers.py
new file mode 100644
index 0000000..b40a082
--- /dev/null
+++ b/plugin.video.montreal.greek-tv/resources/lib/workers.py
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+
+'''
+ Tulip routine libraries, based on lambda's lamlib
+ Author Twilight0
+
+ License summary below, for more details please read license.txt file
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+'''
+
+
+import threading
+
+
+class Thread(threading.Thread):
+
+ def __init__(self, target, *args):
+ self._target = target
+ self._args = args
+ threading.Thread.__init__(self)
+
+ def run(self):
+ self._target(*self._args)
+
diff --git a/plugin.video.montreal.greek-tv/resources/lib/youtube.py b/plugin.video.montreal.greek-tv/resources/lib/youtube.py
new file mode 100644
index 0000000..ecd7e45
--- /dev/null
+++ b/plugin.video.montreal.greek-tv/resources/lib/youtube.py
@@ -0,0 +1,187 @@
+# -*- coding: utf-8 -*-
+
+'''
+ Tulip routine libraries, based on lambda's lamlib
+ Author Twilight0
+
+ License summary below, for more details please read license.txt file
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+'''
+
+import re, json, requests
+import workers
+
+
+class youtube(object):
+
+ def __init__(self, key):
+ self.list = [] ; self.data = []
+ self.base_link = 'http://www.youtube.com'
+ self.key_link = '&key={0}'.format(key)
+ self.playlists_link = 'https://www.googleapis.com/youtube/v3/playlists?part=snippet&maxResults=50&channelId=%s'
+ self.playlist_link = 'https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&maxResults=50&playlistId=%s'
+ self.videos_link = 'https://www.googleapis.com/youtube/v3/search?part=snippet&order=date&maxResults=50&channelId=%s'
+ self.content_link = 'https://www.googleapis.com/youtube/v3/videos?part=contentDetails&id=%s'
+ self.play_link = 'plugin://plugin.video.youtube/play/?video_id=%s'
+
+ def playlists(self, url):
+ url = self.playlists_link % url + self.key_link
+ return self.play_list(url)
+
+ def playlist(self, url, pagination=False):
+ cid = url.split('&')[0]
+ url = self.playlist_link % url + self.key_link
+ return self.video_list(cid, url, pagination)
+
+ def videos(self, url, pagination=False):
+ cid = url.split('&')[0]
+ link = self.videos_link % url + self.key_link
+ return self.video_list(cid, link, pagination)
+
+ def play_list(self, url):
+ try:
+ result = requests.get(url).text
+ result = json.loads(result)
+ items = result['items']
+ except:
+ pass
+
+ for i in range(1, 5):
+ try:
+ if not 'nextPageToken' in result: raise Exception()
+ next = url + '&pageToken=' + result['nextPageToken']
+ result = requests.get(next).text
+ result = json.loads(result)
+ items += result['items']
+ except:
+ pass
+
+ for item in items:
+ try:
+ title = item['snippet']['title']
+ title = title.encode('utf-8')
+
+ url = item['id']
+ url = url.encode('utf-8')
+
+ image = item['snippet']['thumbnails']['high']['url']
+ if '/default.jpg' in image: raise Exception()
+ image = image.encode('utf-8')
+
+ self.list.append({'title': title, 'url': url, 'image': image})
+ except:
+ pass
+
+ return self.list
+
+ def video_list(self, cid, url, pagination):
+ try:
+ result = requests.get(url).text
+ result = json.loads(result)
+ items = result['items']
+ except:
+ pass
+
+ for i in range(1, 5):
+ try:
+ if pagination == True: raise Exception()
+ if not 'nextPageToken' in result: raise Exception()
+ page = url + '&pageToken=' + result['nextPageToken']
+ result = requests.get(page).text
+ result = json.loads(result)
+ items += result['items']
+ except:
+ pass
+
+ try:
+ if pagination == False: raise Exception()
+ next = cid + '&pageToken=' + result['nextPageToken']
+ except:
+ next = ''
+
+ for item in items:
+ try:
+ title = item['snippet']['title']
+ title = title.encode('utf-8')
+
+ try: url = item['snippet']['resourceId']['videoId']
+ except: url = item['id']['videoId']
+ url = url.encode('utf-8')
+
+ image = item['snippet']['thumbnails']['high']['url']
+ if '/default.jpg' in image: raise Exception()
+ image = image.encode('utf-8')
+
+ append = {'title': title, 'url': url, 'image': image}
+ if not next == '': append['next'] = next
+ self.list.append(append)
+ except:
+ pass
+
+ try:
+ u = [range(0, len(self.list))[i:i+50] for i in range(len(range(0, len(self.list))))[::50]]
+ u = [','.join([self.list[x]['url'] for x in i]) for i in u]
+ u = [self.content_link % i + self.key_link for i in u]
+
+ threads = []
+
+ for i in range(0, len(u)):
+ threads.append(workers.Thread(self.thread, u[i], i))
+ self.data.append('')
+
+ [i.start() for i in threads]
+ [i.join() for i in threads]
+
+ items = []
+ for i in self.data:
+ items += json.loads(i)['items']
+ except:
+ pass
+
+ for item in range(0, len(self.list)):
+ try:
+ vid = self.list[item]['url']
+
+ self.list[item]['url'] = self.play_link % vid
+
+ d = [(i['id'], i['contentDetails']) for i in items]
+ d = [i for i in d if i[0] == vid]
+ d = d[0][1]['duration']
+
+ duration = 0
+ try:
+ duration += 60 * 60 * int(re.findall('(\d*)H', d)[0])
+ except:
+ pass
+ try:
+ duration += 60 * int(re.findall('(\d*)M', d)[0])
+ except:
+ pass
+ try:
+ duration += int(re.findall('(\d*)S', d)[0])
+ except:
+ pass
+ duration = str(duration)
+
+ self.list[item]['duration'] = duration
+ except:
+ pass
+
+ return self.list
+
+ def thread(self, url, i):
+ try:
+ result = requests.get(url).text
+ self.data[i] = result
+ except:
+ return
diff --git a/plugin.video.montreal.greek-tv/resources/media/livetv.png b/plugin.video.montreal.greek-tv/resources/media/livetv.png
new file mode 100644
index 0000000..08c089c
--- /dev/null
+++ b/plugin.video.montreal.greek-tv/resources/media/livetv.png
Binary files differ
diff --git a/plugin.video.montreal.greek-tv/resources/media/radio.png b/plugin.video.montreal.greek-tv/resources/media/radio.png
new file mode 100644
index 0000000..d67b912
--- /dev/null
+++ b/plugin.video.montreal.greek-tv/resources/media/radio.png
Binary files differ
diff --git a/plugin.video.montreal.greek-tv/resources/media/youtube.png b/plugin.video.montreal.greek-tv/resources/media/youtube.png
new file mode 100644
index 0000000..0bda3a6
--- /dev/null
+++ b/plugin.video.montreal.greek-tv/resources/media/youtube.png
Binary files differ
diff --git a/plugin.video.montreal.greek-tv/resources/settings.xml b/plugin.video.montreal.greek-tv/resources/settings.xml
new file mode 100644
index 0000000..8cf2505
--- /dev/null
+++ b/plugin.video.montreal.greek-tv/resources/settings.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<settings>
+ <category label="30001">
+ <setting id="old-url" type="bool" label="30002" default="false"/>
+ </category>
+</settings> \ No newline at end of file
diff --git a/plugin.video.myvevo/LICENSE.txt b/plugin.video.myvevo/LICENSE.txt
new file mode 100644
index 0000000..4f8e8eb
--- /dev/null
+++ b/plugin.video.myvevo/LICENSE.txt
@@ -0,0 +1,282 @@
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+-------------------------------------------------------------------------
diff --git a/plugin.video.myvevo/README.txt b/plugin.video.myvevo/README.txt
new file mode 100644
index 0000000..993a05b
--- /dev/null
+++ b/plugin.video.myvevo/README.txt
@@ -0,0 +1,14 @@
+plugin.video.myvevo
+================
+
+
+Kodi Addon for VEVO
+
+Version 3.0.8 Krypton or above needed. Added mpd support thru inputstream.adaptive
+Version 3.0.7 m3u8 version fix
+Version 3.0.6 auth fix
+Version 3.0.5 fix playlists, remove live channels, fix navigation
+V3.0.4 add Get Related Videos
+V3.0.3 improve add to library
+V3.0.2 Added initial version of Add to Library
+V3.0.1 Isengard version \ No newline at end of file
diff --git a/plugin.video.myvevo/addon.xml b/plugin.video.myvevo/addon.xml
new file mode 100644
index 0000000..396bd19
--- /dev/null
+++ b/plugin.video.myvevo/addon.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<addon id="plugin.video.myvevo"
+ name="VEVO"
+ version="3.0.8"
+ provider-name="t1m">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="script.module.t1mlib" version="1.0.18"/>
+ <import addon="inputstream.adaptive" version="2.0.0"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource"
+ library="default.py">
+ <provides>video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <summary lang="en_GB">VEVO Video Addon</summary>
+ <description lang="en_GB">Watch music videos, artist videos, and original shows on VEVO and VEVO TV</description>
+ <disclaimer lang="en_GB">Feel free to use this script. For information visit the wiki.</disclaimer>
+ <platform>all</platform>
+ <language>en</language>
+ <license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991. Icons are made by Freepik from www.flaticon.com and are licensed under Creative Commons BY 3.0</license>
+ <forum>http://forum.kodi.tv/showthread.php?tid=223221</forum>
+ <website>www.vevo.com</website>
+ <email></email>
+ <source>https://github.com/learningit/Kodi-plugins-source</source>
+ </extension>
+</addon>
diff --git a/plugin.video.myvevo/changelog.txt b/plugin.video.myvevo/changelog.txt
new file mode 100644
index 0000000..ec06439
--- /dev/null
+++ b/plugin.video.myvevo/changelog.txt
@@ -0,0 +1,8 @@
+Version 3.0.8 Krypton or above needed. Added mpd support thru inputstream.adaptive
+Version 3.0.7 m3u8 version fix
+Version 3.0.6 auth fix
+Version 3.0.5 fix playlists, remove live channels, fix navigation
+Version 3.0.4 add Get Related Videos
+Version 3.0.3 improve add to library
+Version 3.0.2 Added initial version of Add to Library
+Version 3.0.1 Isengard version \ No newline at end of file
diff --git a/plugin.video.myvevo/default.py b/plugin.video.myvevo/default.py
new file mode 100644
index 0000000..0b0cbd4
--- /dev/null
+++ b/plugin.video.myvevo/default.py
@@ -0,0 +1,13 @@
+# -*- coding: utf-8 -*-
+# KodiAddon
+#
+from resources.lib.scraper import myAddon
+import re
+import sys
+
+# Start of Module
+
+addonName = re.search('plugin\://plugin.video.(.+?)/',str(sys.argv[0])).group(1)
+ma = myAddon(addonName)
+ma.processAddonEvent()
+
diff --git a/plugin.video.myvevo/fanart.jpg b/plugin.video.myvevo/fanart.jpg
new file mode 100644
index 0000000..7f1cf7f
--- /dev/null
+++ b/plugin.video.myvevo/fanart.jpg
Binary files differ
diff --git a/plugin.video.myvevo/icon.png b/plugin.video.myvevo/icon.png
new file mode 100644
index 0000000..2beeb90
--- /dev/null
+++ b/plugin.video.myvevo/icon.png
Binary files differ
diff --git a/plugin.video.myvevo/resources/__init__.py b/plugin.video.myvevo/resources/__init__.py
new file mode 100644
index 0000000..7986681
--- /dev/null
+++ b/plugin.video.myvevo/resources/__init__.py
@@ -0,0 +1 @@
+__author__ = 't1m'
diff --git a/plugin.video.myvevo/resources/language/resource.language.en_gb/strings.po b/plugin.video.myvevo/resources/language/resource.language.en_gb/strings.po
new file mode 100644
index 0000000..778566b
--- /dev/null
+++ b/plugin.video.myvevo/resources/language/resource.language.en_gb/strings.po
@@ -0,0 +1,91 @@
+# XBMC Media Center language file
+msgid ""
+msgstr ""
+"Project-Id-Version: XBMC-Addons\n"
+"Report-Msgid-Bugs-To: alanwww1@xbmc.org\n"
+"POT-Creation-Date: 2016-03-28 13:35+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en\n"
+"Plural-Forms: nplurals=2; plural=(n != 1)\n"
+
+msgctxt "#30000"
+msgid "New releases"
+msgstr ""
+
+msgctxt "#30001"
+msgid "Genres"
+msgstr ""
+
+msgctxt "#30002"
+msgid "Favorite Artists"
+msgstr ""
+
+msgctxt "#30003"
+msgid "My Playlists"
+msgstr ""
+
+msgctxt "#30004"
+msgid "Search"
+msgstr ""
+
+msgctxt "#30005"
+msgid "Next Page"
+msgstr ""
+
+msgctxt "#30006"
+msgid "List is Full"
+msgstr ""
+
+msgctxt "#30007"
+msgid "Rename List"
+msgstr ""
+
+msgctxt "#30008"
+msgid "Enter New List Name"
+msgstr ""
+
+msgctxt "#30009"
+msgid "Delete Playlist"
+msgstr ""
+
+msgctxt "#30010"
+msgid "Rename Playlist"
+msgstr ""
+
+msgctxt "#30011"
+msgid "Remove From Playlist"
+msgstr ""
+
+msgctxt "#30012"
+msgid "Add To Library"
+msgstr ""
+
+msgctxt "#30013"
+msgid "Add to Playlist"
+msgstr ""
+
+msgctxt "#30014"
+msgid "Get Related Videos"
+msgstr ""
+
+msgctxt "#30015"
+msgid "Create New Playlist"
+msgstr ""
+
+msgctxt "#30016"
+msgid "User Email"
+msgstr ""
+
+msgctxt "#30017"
+msgid "User Password"
+msgstr ""
+
+msgctxt "#30018"
+msgid "VEVO Login"
+msgstr ""
+
diff --git a/plugin.video.myvevo/resources/lib/__init__.py b/plugin.video.myvevo/resources/lib/__init__.py
new file mode 100644
index 0000000..7986681
--- /dev/null
+++ b/plugin.video.myvevo/resources/lib/__init__.py
@@ -0,0 +1 @@
+__author__ = 't1m'
diff --git a/plugin.video.myvevo/resources/lib/scraper.py b/plugin.video.myvevo/resources/lib/scraper.py
new file mode 100644
index 0000000..a5a0ec5
--- /dev/null
+++ b/plugin.video.myvevo/resources/lib/scraper.py
@@ -0,0 +1,361 @@
+# -*- coding: utf-8 -*-
+# KodiAddon for myVEVO
+#
+from t1mlib import t1mAddon
+import json
+import re
+import urllib
+import urllib2
+import cookielib
+import xbmcplugin
+import xbmcgui
+import xbmc
+import sys
+import os
+
+uqp = urllib.unquote_plus
+qp = urllib.quote_plus
+UTF8 = 'utf-8'
+VEVOAPI = 'https://apiv2.vevo.com'
+
+class myAddon(t1mAddon):
+
+ def getAutho(self, getMe=False):
+ if self.addon.getSetting('login_name') != '':
+ vevoName = self.addon.getSetting('login_name')
+ vevoPswd = self.addon.getSetting('login_pass')
+ udata = urllib.urlencode({'username': vevoName, 'password':vevoPswd, 'grant_type':'password', 'client_id':'SPupX1tvqFEopQ1YS6SS'})
+ else:
+ udata = ' '
+ uheaders = self.defaultHeaders.copy()
+ uheaders['X-Requested-With'] = 'XMLHttpRequest'
+ uheaders['Connection'] = 'keep-alive'
+ html = self.getRequest('https://accounts.vevo.com/token', udata , uheaders)
+ a = json.loads(html)
+ if not getMe:
+ return a['legacy_token']
+ uheaders['Authorization'] = 'Bearer %s' % a['access_token']
+ html = self.getRequest('https://users.vevo.com/user/me', None, uheaders)
+ b = json.loads(html)
+ return (a['legacy_token'], b.get('vevo_user_id'))
+
+
+ def getAPI(self,url):
+ autho = self.getAutho()
+ uheaders = self.defaultHeaders.copy()
+ uheaders['Authorization'] = 'Bearer %s' % autho
+ uheaders['Connection'] = 'keep-alive'
+ html = self.getRequest(url, None , uheaders)
+ return json.loads(html)
+
+
+ def getAddonMenu(self,url,ilist):
+ addonLanguage = self.addon.getLocalizedString
+ menu = [(addonLanguage(30000),VEVOAPI+'/now?page=1&size=50&token=','GE'),
+ (addonLanguage(30001),'/genres?page=1&size=50', 'GC'),
+ (addonLanguage(30002),'GM','GM'),
+ (addonLanguage(30003),'GS','GS'),
+ (addonLanguage(30004),'Search', 'GE')]
+ for name, url, mode in menu:
+ ilist = self.addMenuItem(name, mode, ilist, url, self.addonIcon, self.addonFanart, None, isFolder=True)
+ return(ilist)
+
+
+ def getAddonCats(self,url,ilist):
+ addonLanguage = self.addon.getLocalizedString
+ xbmcplugin.setContent(int(sys.argv[1]), 'files')
+ if not url.startswith('http'):
+ url = VEVOAPI + url
+ a = self.getAPI(url)
+ infoList = None
+ originUrl = url
+ nextUrl = None
+ if '&genre=' in originUrl:
+ nextUrl = a['paging'].get('next')
+ a = a['artists']
+ for b in a:
+ name = b['name']
+ thumb = b['thumbnailUrl']
+ if '&genre=' in originUrl:
+ mode = 'GE'
+ url = VEVOAPI+'/artist/%s/videos?size=50&page=1&sort=MostRecent' % b['urlSafeName']
+ else:
+ mode = 'GC'
+ url = '/artists?page=1&size=50&genre=%s' % b['urlSafeName']
+ ilist = self.addMenuItem(name, mode, ilist, url, thumb, thumb, infoList, isFolder=True)
+ if nextUrl is not None:
+ nextUrl += ('&genre='+originUrl.rsplit('&genre=',1)[1])
+ name = '[COLOR blue]'+addonLanguage(30005)+'[/COLOR]'
+ ilist = self.addMenuItem(name, 'GC', ilist, nextUrl, self.addonIcon, self.addonFanart, infoList, isFolder=True)
+ return(ilist)
+
+
+ def updateList(self, token = None, pid = None, cmd = None, name = None, desc = None, isrc = None, imageUrl = None):
+ addonLanguage = self.addon.getLocalizedString
+ MAXPLISTITEMS = 25
+ if token is None:
+ token = self.getAutho()
+ html = self.getRequest(VEVOAPI + ('/playlist/%s?token=%s' % (pid, token)))
+ a = json.loads(html)
+ ud = 'playlistId=%s' % qp(pid)
+ if name is None:
+ name = a['name']
+ ud += '&name=%s' % qp(name)
+ if desc is None:
+ desc = a.get('description')
+ if desc is not None:
+ ud += "&description=%s" % qp(desc)
+ if imageUrl is None:
+ imageUrl = a.get('imageUrl')
+ if imageUrl is not None:
+ ud += "&imageUrl=%s" % qp(imageUrl)
+ b = a["videos"]
+ if (cmd == 'ADDITEM') and (len(b) >= MAXPLISTITEMS):
+ xbmc.executebuiltin('XBMC.Notification("%s", "%s", %s)' % ( 'VEVO', addonLanguage(30006), 5000) )
+ return
+ for c in b:
+ if (cmd == 'DELITEM') and (c['isrc'] == isrc):
+ continue
+ else:
+ ud += "&Isrcs=%s" % qp(c['isrc'])
+ if cmd == 'ADDITEM':
+ ud += "&Isrcs=%s" % qp(isrc)
+ azheaders = self.defaultHeaders.copy()
+ azheaders['X-Requested-With'] = 'XMLHttpRequest'
+ url = VEVOAPI + ('/me/playlist/%s?token=%s' % (pid, token))
+ html = self.getRequest(url, ud , azheaders, rmethod = 'PUT')
+ return
+
+
+ def getAddonShows(self,url,ilist):
+ addonLanguage = self.addon.getLocalizedString
+ token, uid = self.getAutho(getMe = True)
+ pid = url[2:]
+ func = url[:2]
+ uheaders = self.defaultHeaders
+ uheaders['X-Requested-With'] = 'XMLHttpRequest'
+ if func == 'DP':
+ url = VEVOAPI + ('/me/playlist/%s?token=%s') % (pid, token)
+ html = self.getRequest(url, ' ', uheaders, rmethod='DELETE')
+ elif func == 'RL':
+ html = self.getRequest(VEVOAPI + ('/playlist/%s?token=%s' % (pid, token)))
+ a = json.loads(html)
+ oldname = a["name"]
+ keyb = xbmc.Keyboard(oldname, addonLanguage(30007))
+ keyb.doModal()
+ if (keyb.isConfirmed()):
+ newname = keyb.getText()
+ if len(newname) > 0:
+ self.updateList(token = token, pid = pid, cmd = 'REN', name=newname)
+ elif func == 'CP':
+ keyb = xbmc.Keyboard('', addonLanguage(30008))
+ keyb.doModal()
+ if (keyb.isConfirmed()):
+ text = keyb.getText()
+ udata = 'name=%s&Isrcs=undefined' % qp(text)
+ url = VEVOAPI + ('/me/playlists?token=%s' % token)
+ self.getRequest(url, udata, uheaders)
+ xbmcplugin.setContent(int(sys.argv[1]), 'files')
+ html = self.getRequest(VEVOAPI + ('/user/%s/playlists?token=%s' % (uid,token)))
+ a = json.loads(html)
+ for b in a:
+ thumb = b.get("thumbnailUrl")
+ name = b["name"]
+ url = 'GL' + VEVOAPI + '/playlist/%s?token=' % b["playlistId"]
+ infoList ={}
+ infoList['Title'] = name
+ infoList['Plot'] = b.get("description")
+ contextMenu = [(addonLanguage(30009),'XBMC.Container.Refresh(%s?mode=GS&url=DP%s)' % (sys.argv[0], b["playlistId"])),
+ (addonLanguage(30010),'XBMC.Container.Refresh(%s?mode=GS&url=RL%s)' % (sys.argv[0], b["playlistId"]))]
+ ilist = self.addMenuItem(name, 'GE', ilist, url, thumb, self.addonFanart, infoList, isFolder=True, cm=contextMenu)
+ ilist = self.addMenuItem('[COLOR blue]'+addonLanguage(30015)+'[/COLOR]', 'GS', ilist, 'CP' , self.addonIcon, self.addonFanart, None, isFolder=True)
+ return(ilist)
+
+
+ def getAddonEpisodes(self,url,ilist):
+ addonLanguage = self.addon.getLocalizedString
+ url = uqp(url)
+ self.defaultVidStream['width'] = 1920
+ self.defaultVidStream['height'] = 1080
+ xbmcplugin.setContent(int(sys.argv[1]), 'musicvideos')
+ playList = None
+ if url == 'Search':
+ keyb = xbmc.Keyboard('', addonLanguage(30004))
+ keyb.doModal()
+ if (keyb.isConfirmed()):
+ url = 'https://apiv2.vevo.com/search?page=1&size=50&q=' + keyb.getText().replace(' ','+')
+ else:
+ return(ilist)
+ elif url.startswith('GF'):
+ url = 'https://apiv2.vevo.com/search?artistsLimit=1&page=1&size=50&skippedVideos=0&q=' + url[2:]
+ elif url.startswith('GL'):
+ url = url[2:]
+ playList = re.compile('\/playlist\/(.+?)\?', re.DOTALL).search(url).group(1)
+ if url.endswith('token='):
+ url += self.getAutho()
+ if not url.startswith('http'):
+ url = 'https://apiv2.vevo.com' + url
+ a = self.getAPI(url)
+ nextUrl = None
+ if type(a) is not list:
+ nextUrl = a.get('paging')
+ if nextUrl is not None:
+ nextUrl = nextUrl.get('next')
+ if type(a) is list:
+ if a[0].get('stream') is not None:
+ akeys = ['name', 'stream', 'thumbnailUrl']
+ else:
+ akeys = ['title', 'isrc', 'thumbnailUrl']
+ elif a.get('videos') is not None:
+ a = a['videos']
+ akeys = ['title', 'isrc', 'thumbnailUrl']
+ elif a.get('nowPosts') is not None:
+ a = a['nowPosts']
+ akeys = ['name', 'isrc', 'image']
+ lastUrl = None
+ for b in a:
+ if b is None:
+ continue
+ playlistId = b.get('playlistId')
+ if playlistId is None:
+ url = b.get(akeys[1])
+ else:
+ url = '/playlist/%s?token=' % playlistId
+ if url is None or url == lastUrl:
+ continue
+ lastUrl = url
+ name = b[akeys[0]]
+ thumb = b.get(akeys[2])
+ if thumb is None:
+ thumb = b.get('images')
+ if thumb is not None:
+ thumb = thumb[0].get('image')
+ infoList = {}
+ infoList['Title'] = name
+ infoList['Plot'] = b.get('description')
+ artists = b.get('artists')
+ infoList['Artist'] = []
+ if artists is not None and artists != []:
+ for artist in artists:
+ infoList['Artist'].append(artist['name'] + ' ')
+ else:
+ if name.endswith('"') and akeys[2] == 'image':
+ artist, name = name.split('"',1)
+ infoList['Artist'].append(artist.strip())
+ name = name.strip('"').strip()
+ infoList['Title'] = name
+ else:
+ infoList['Artist'].append(xbmc.getInfoLabel('ListItem.Artist'))
+ vyear = b.get('year')
+ if vyear is not None and vyear != 0:
+ infoList['Year'] = vyear
+ infoList['duration'] = b.get('duration')
+ infoList['mediatype']= 'musicvideo'
+ if playList is not None:
+ contextMenu = [(addonLanguage(30011),'XBMC.Container.Update(%s?mode=DF&url=DP%spid%s)' % (sys.argv[0],url, playList)),
+ (addonLanguage(30012),'XBMC.RunPlugin(%s?mode=DF&url=AL%s)' % (sys.argv[0],url))]
+ else:
+ contextMenu = [(addonLanguage(30013),'XBMC.RunPlugin(%s?mode=DF&url=AP%s)' % (sys.argv[0],url)),
+ (addonLanguage(30012),'XBMC.RunPlugin(%s?mode=DF&url=AL%s)' % (sys.argv[0],url))]
+ if akeys[1] == 'isrc':
+ curl = VEVOAPI + ('/video/%s/related?&page=1&size=50&token=' % (url))
+ contextMenu.append((addonLanguage(30014),'XBMC.Container.Update(%s?mode=GE&url=%s)' % (sys.argv[0],qp(curl))))
+ if playlistId is None:
+ ilist = self.addMenuItem(name,'GV', ilist, url, thumb, thumb, infoList, isFolder=False, cm=contextMenu)
+ else:
+ contextMenu = []
+ name = '[COLOR yellow]'+name+'[/COLOR]'
+ ilist = self.addMenuItem(name,'GE', ilist, url, thumb, thumb, infoList, isFolder=True, cm=contextMenu)
+
+ if nextUrl is not None:
+ name = '[COLOR blue]'+addonLanguage(30005)+'[/COLOR]'
+ ilist = self.addMenuItem(name, 'GE', ilist, nextUrl, self.addonIcon, self.addonFanart, [], isFolder=True)
+ return(ilist)
+
+
+ def getAddonMovies(self,url,ilist):
+ xbmcplugin.setContent(int(sys.argv[1]), 'musicvideos')
+ json_cmd= '{"jsonrpc": "2.0", "method": "AudioLibrary.GetArtists", "params": { "limits": { "start" : 0 }, "properties": [ "thumbnail", "fanart", "genre" ], "sort": { "order": "ascending", "method": "artist", "ignorearticle": true }}, "id": 1}'
+ jsonRespond = xbmc.executeJSONRPC(json_cmd)
+ a = json.loads(jsonRespond)
+ for b in a["result"]["artists"]:
+ name = b["artist"].encode(UTF8)
+ thumb = b.get("thumbnail", self.addonIcon)
+ fanart = b.get("fanart", self.addonFanart)
+ url = 'GF'+name.replace(' ','+')
+ infoList = {}
+ infoList['Title'] = name
+ infoList['Plot'] = b.get('description')
+ infoList['Artist'] = [name]
+ vyear = b.get('year')
+ if vyear is not None and vyear != 0:
+ infoList['Year'] = vyear
+ infoList['duration'] = b.get('duration')
+ infoList['mediatype']= 'musicvideo'
+ ilist = self.addMenuItem(name, 'GE', ilist, url, thumb, fanart, infoList, isFolder=True)
+ return(ilist)
+
+
+ def doFunction(self, url):
+ func = url[0:2]
+ url = url[2:]
+ if func == 'DP':
+ isrc, pid = url.split('pid',1)
+ self.updateList(pid = pid, token = None, cmd = 'DELITEM', isrc = isrc)
+ elif func == 'AP':
+ token, uid = self.getAutho(getMe = True)
+ html = self.getRequest(VEVOAPI + ('/user/%s/playlists?token=%s' % (uid,token)))
+ a = json.loads(html)
+ ilist=[]
+ nlist=[]
+ for b in a:
+ nlist.append(b['name'])
+ ilist.append(b['playlistId'])
+ dialog = xbmcgui.Dialog()
+ choice = dialog.select('Choose a playlist', nlist)
+ pid = ilist[choice]
+ self.updateList(pid = pid, token = token, cmd = 'ADDITEM', isrc = url)
+ elif func == 'AL':
+ artist = xbmc.getInfoLabel('ListItem.Artist').split('/',1)[0]
+ artist = artist.replace(':','').replace('-','').replace('?','%3F')
+ title = xbmc.getInfoLabel('ListItem.Title').split('(',1)[0]
+ title = title.replace(':','').replace('-','').replace('?','%3F')
+ name = artist.strip() + ' - ' + title.strip()
+ profile = self.addon.getAddonInfo('profile').decode(UTF8)
+ videosDir = xbmc.translatePath(os.path.join(profile,'Videos'))
+ videoDir = xbmc.translatePath(os.path.join(videosDir, name))
+ if not os.path.isdir(videoDir):
+ os.makedirs(videoDir)
+ strmFile = xbmc.translatePath(os.path.join(videoDir, name+'.strm'))
+ with open(strmFile, 'w') as outfile:
+ outfile.write('%s?mode=GV&url=%s' %(sys.argv[0], url))
+ json_cmd = '{"jsonrpc":"2.0","method":"VideoLibrary.Scan", "params": {"directory":"%s/"},"id":1}' % videoDir.replace('\\','/')
+ jsonRespond = xbmc.executeJSONRPC(json_cmd)
+
+
+ def getAddonVideo(self,url):
+ if not '.m3u8' in url:
+ url = ('https://apiv2.vevo.com/video/%s/streams/mpd?token=%s' % (url, self.getAutho()))
+ a = self.getAPI(url)
+ for b in a:
+ url = b.get('url')
+ if not url is None:
+ break
+ thumb = xbmc.getInfoLabel('ListItem.Art(thumb)')
+ liz = xbmcgui.ListItem(path = url, thumbnailImage = thumb)
+ infoList ={}
+ infoList['Artist'] = []
+ infoList['Artist'].append(xbmc.getInfoLabel('ListItem.Artist'))
+ infoList['Title'] = xbmc.getInfoLabel('ListItem.Title')
+ vyear = xbmc.getInfoLabel('ListItem.Year')
+ if vyear is not None and vyear != 0:
+ infoList['Year'] = vyear
+ infoList['Plot'] = xbmc.getInfoLabel('ListItem.Plot')
+ infoList['Studio'] = xbmc.getInfoLabel('ListItem.Studio')
+ infoList['Album'] = xbmc.getInfoLabel('ListItem.Album')
+ infoList['Duration'] = xbmc.getInfoLabel('ListItem.Duration')
+ infoList['mediatype']= 'musicvideo'
+ liz.setInfo('video', infoList)
+ liz.setProperty('inputstreamaddon','inputstream.adaptive')
+ liz.setProperty('inputstream.adaptive.manifest_type','mpd')
+ xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
diff --git a/plugin.video.myvevo/resources/settings.xml b/plugin.video.myvevo/resources/settings.xml
new file mode 100644
index 0000000..3f67baf
--- /dev/null
+++ b/plugin.video.myvevo/resources/settings.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<settings>
+ <category label="30018">
+ <setting type="sep" />
+ <setting id="login_name" type="text" label="30016" default=""/>
+ <setting id="login_pass" type="text" label="30017" enable="!eq(-1,)" option="hidden" default=""/>
+ <setting type="sep" />
+ </category>
+
+</settings>
diff --git a/plugin.video.news12/LICENSE.md b/plugin.video.news12/LICENSE.md
new file mode 100644
index 0000000..733c072
--- /dev/null
+++ b/plugin.video.news12/LICENSE.md
@@ -0,0 +1,675 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ {one line to give the program's name and a brief idea of what it does.}
+ Copyright (C) {year} {name of author}
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ {project} Copyright (C) {year} {fullname}
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+
diff --git a/plugin.video.news12/addon.xml b/plugin.video.news12/addon.xml
new file mode 100644
index 0000000..3a54c13
--- /dev/null
+++ b/plugin.video.news12/addon.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<addon id="plugin.video.news12" version="1.0.2" name="News12" provider-name="Lunatixz">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="script.module.simplecache" version="1.0.0"/>
+ <import addon="script.module.feedparser" version="5.1.3"/>
+ <import addon="script.module.beautifulsoup4" version="4.3.2"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource" library="default.py">
+ <provides>video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <summary lang="en_GB">Welcome to News 12!</summary>
+ <description lang="en_GB">News 12, a cable network exclusive to seven regions of the New York tri-state area. Please select an region to get the latest local news and information.</description>
+ <platform>all</platform>
+ <license>GNU GENERAL PUBLIC LICENSE. Version 3, June 2007</license>
+ <source>https://github.com/Lunatixz/XBMC_Addons/tree/master/plugin.video.news12</source>
+ <website>http://news12.com</website>
+ <forum>https://forum.kodi.tv/showthread.php?tid=319396</forum>
+ <news>[CR]v1.0.2[CR]- Improved browsing speed.[CR]v.1.0.1[CR]- Fixed Video Quality Error</news>
+ <assets>
+ <icon>resources/images/icon.png</icon>
+ <fanart>resources/images/fanart.jpg</fanart>
+ <screenshot>resources/images/screenshot01.png</screenshot>
+ <screenshot>resources/images/screenshot02.png</screenshot>
+ <screenshot>resources/images/screenshot03.png</screenshot>
+ </assets>
+ </extension>
+</addon> \ No newline at end of file
diff --git a/plugin.video.news12/default.py b/plugin.video.news12/default.py
new file mode 100644
index 0000000..ed2df56
--- /dev/null
+++ b/plugin.video.news12/default.py
@@ -0,0 +1,23 @@
+# Copyright (C) 2017 Lunatixz
+#
+#
+# This file is part of News12.
+#
+# News12 is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# News12 is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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 News12. If not, see <http://www.gnu.org/licenses/>.
+
+# -*- coding: utf-8 -*-
+
+#entrypoint
+if __name__ == '__main__':
+ from resources.lib import news12 \ No newline at end of file
diff --git a/plugin.video.news12/resources/__init__.py b/plugin.video.news12/resources/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.news12/resources/__init__.py
diff --git a/plugin.video.news12/resources/images/fanart.jpg b/plugin.video.news12/resources/images/fanart.jpg
new file mode 100644
index 0000000..bd772b3
--- /dev/null
+++ b/plugin.video.news12/resources/images/fanart.jpg
Binary files differ
diff --git a/plugin.video.news12/resources/images/icon.png b/plugin.video.news12/resources/images/icon.png
new file mode 100644
index 0000000..e3de402
--- /dev/null
+++ b/plugin.video.news12/resources/images/icon.png
Binary files differ
diff --git a/plugin.video.news12/resources/images/screenshot01.png b/plugin.video.news12/resources/images/screenshot01.png
new file mode 100644
index 0000000..841aa4e
--- /dev/null
+++ b/plugin.video.news12/resources/images/screenshot01.png
Binary files differ
diff --git a/plugin.video.news12/resources/images/screenshot02.png b/plugin.video.news12/resources/images/screenshot02.png
new file mode 100644
index 0000000..b3efcd8
--- /dev/null
+++ b/plugin.video.news12/resources/images/screenshot02.png
Binary files differ
diff --git a/plugin.video.news12/resources/images/screenshot03.png b/plugin.video.news12/resources/images/screenshot03.png
new file mode 100644
index 0000000..986790a
--- /dev/null
+++ b/plugin.video.news12/resources/images/screenshot03.png
Binary files differ
diff --git a/plugin.video.news12/resources/language/resource.language.en_gb/strings.po b/plugin.video.news12/resources/language/resource.language.en_gb/strings.po
new file mode 100644
index 0000000..c7824fc
--- /dev/null
+++ b/plugin.video.news12/resources/language/resource.language.en_gb/strings.po
@@ -0,0 +1,42 @@
+# Kodi Media Center language file
+# Addon Name: News12
+# Addon id: plugin.video.news12
+# Addon Provider: Lunatixz
+msgid ""
+msgstr ""
+"Project-Id-Version: plugin.video.news12\n"
+"Report-Msgid-Bugs-To: https://forum.kodi.tv/showthread.php?tid=319396\n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Lunatixz Translation Team\n"
+"Language-Team: English (http://www.transifex.com/projects/p/xbmc-addons/language/en/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "#30000"
+msgid "Enable Debugging [Log errors]"
+msgstr ""
+
+msgctxt "#30001"
+msgid "Something went wrong, Try again..."
+msgstr ""
+
+msgctxt "#30002"
+msgid "Select Video Clip Quality"
+msgstr ""
+
+msgctxt "#30003"
+msgid "Low"
+msgstr ""
+
+msgctxt "#30004"
+msgid "Medium"
+msgstr ""
+
+
+msgctxt "#30005"
+msgid "High"
+msgstr "" \ No newline at end of file
diff --git a/plugin.video.news12/resources/lib/__init__.py b/plugin.video.news12/resources/lib/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.news12/resources/lib/__init__.py
diff --git a/plugin.video.news12/resources/lib/news12.py b/plugin.video.news12/resources/lib/news12.py
new file mode 100644
index 0000000..9287665
--- /dev/null
+++ b/plugin.video.news12/resources/lib/news12.py
@@ -0,0 +1,254 @@
+# Copyright (C) 2017 Lunatixz
+#
+#
+# This file is part of News12.
+#
+# News12 is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# News12 is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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 News12. If not, see <http://www.gnu.org/licenses/>.
+
+# -*- coding: utf-8 -*-
+import os, sys, time, datetime, re, traceback, feedparser
+import urllib, urllib2, socket, json
+import xbmc, xbmcgui, xbmcplugin, xbmcvfs, xbmcaddon
+
+from simplecache import SimpleCache
+from bs4 import BeautifulSoup
+
+# Plugin Info
+ADDON_ID = 'plugin.video.news12'
+REAL_SETTINGS = xbmcaddon.Addon(id=ADDON_ID)
+ADDON_NAME = REAL_SETTINGS.getAddonInfo('name')
+SETTINGS_LOC = REAL_SETTINGS.getAddonInfo('profile')
+ADDON_PATH = REAL_SETTINGS.getAddonInfo('path').decode('utf-8')
+ADDON_VERSION = REAL_SETTINGS.getAddonInfo('version')
+ICON = REAL_SETTINGS.getAddonInfo('icon')
+FANART = REAL_SETTINGS.getAddonInfo('fanart')
+LANGUAGE = REAL_SETTINGS.getLocalizedString
+
+## GLOBALS ##
+TIMEOUT = 15
+DEBUG = REAL_SETTINGS.getSetting('Enable_Debugging') == 'true'
+BITRATE = {0:LANGUAGE(30003),1:LANGUAGE(30004),2:LANGUAGE(30005)}[int(REAL_SETTINGS.getSetting('Video_Quality'))]
+BASEURL = 'http://news12.com'
+RSSURL = '%s/?clienttype=rss'
+BASEIMG = 'http://ftpcontent.worldnow.com/professionalservices/clients/news12/images/regions/selectregion_%i.jpg'
+LIVEURL = 'http://adx.news12.com/livevideo/livevideo_iframe.html'
+VODURL = '%s/clip/%s/videoclip?clienttype=mrssjson'
+LIVEMAP = {'N12%s':'%s - News','TW%s':'%s - Traffic & Weather','N12%sB2':'%s - Doppler Radar'}
+IMGPARM = {'bx':BASEIMG%1,'bk':BASEIMG%2,'ct':BASEIMG%3,'hv':BASEIMG%4,'li':BASEIMG%5,'nj':BASEIMG%6,'wc':BASEIMG%7,'None':ICON,}
+
+def log(msg, level=xbmc.LOGDEBUG):
+ if DEBUG == True:
+ if level == xbmc.LOGERROR:
+ msg += ' ,' + traceback.format_exc()
+ xbmc.log(ADDON_ID + '-' + ADDON_VERSION + '-' + (msg), level)
+
+def getParams():
+ param=[]
+ if len(sys.argv[2])>=2:
+ params=sys.argv[2]
+ cleanedparams=params.replace('?','')
+ if (params[len(params)-1]=='/'):
+ params=params[0:len(params)-2]
+ pairsofparams=cleanedparams.split('&')
+ param={}
+ for i in range(len(pairsofparams)):
+ splitparams={}
+ splitparams=pairsofparams[i].split('=')
+ if (len(splitparams))==2:
+ param[splitparams[0]]=splitparams[1]
+ return param
+
+socket.setdefaulttimeout(TIMEOUT)
+class News12():
+ def __init__(self):
+ log('__init__')
+ self.cache = SimpleCache()
+
+
+ def openURL(self, url):
+ log('openURL, url = ' + str(url))
+ try:
+ cacheResponse = self.cache.get(ADDON_NAME + '.openURL, url = %s'%url)
+ if not cacheResponse:
+ request = urllib2.Request(url)
+ request.add_header('User-Agent','Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)')
+ response = urllib2.urlopen(request, timeout=TIMEOUT).read()
+ self.cache.set(ADDON_NAME + '.openURL, url = %s'%url, response, expiration=datetime.timedelta(hours=6))
+ return self.cache.get(ADDON_NAME + '.openURL, url = %s'%url)
+ except urllib2.URLError, e:
+ log("openURL Failed! " + str(e), xbmc.LOGERROR)
+ except socket.timeout, e:
+ log("openURL Failed! " + str(e), xbmc.LOGERROR)
+ except Exception, e:
+ log("openURL Failed! " + str(e), xbmc.LOGERROR)
+ xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30001), ICON, 4000)
+
+
+ def buildRegionMenu(self):
+ log('buildRegionMenu')
+ soup = BeautifulSoup(self.openURL(BASEURL), "html.parser")
+ data = soup('div' , {'class': 'region-links'})[0].find_all('a')
+ for idx, region in enumerate(data):
+ thumb = IMGPARM[region['class'][0]]
+ art = {"thumb":thumb,"poster":thumb,"icon":ICON,"fanart":FANART}
+ self.addDir(region.get_text(),json.dumps({'region_ad':region['class'][0],'url':region.get('href')}),0,infoArt=art)
+
+
+ def buildMenu(self, name, url):
+ log('buildMenu')
+ self.buildLive(name, url['region_ad'])
+ thumb = IMGPARM[url['region_ad']]
+ art = {"thumb":thumb,"poster":thumb,"icon":ICON,"fanart":FANART}
+ self.addDir('%s - Video Clips'%name,json.dumps(url),1,infoArt=art)
+
+
+ def buildLive(self, name, url):
+ data = self.openURL(LIVEURL).replace(' ','').replace('(','{').replace(')','}')
+ live = re.search(r'varstream_url="(.*)"', data.strip(), re.M|re.I).group(1).replace('"+streamname+"','%s')
+ for line in data.split('\n'):
+ search = re.match( r'if{region=="(.*)"}{region_ad="(.*)";streamname="(.*)";url="(.*)";}.*', line.strip(), re.M|re.I)
+ if search and search.group(2).lower() == url:
+ region = search.group(1).upper()
+ for key in LIVEMAP:
+ if key%url.upper() == region:
+ art = {"thumb":IMGPARM[url],"poster":IMGPARM[url],"icon":ICON,"fanart":FANART}
+ self.addLink(LIVEMAP[key]%name, live%search.group(3),9,infoArt=art,total=len(LIVEMAP))
+
+
+ def buildRSS(self, url, end=9):
+ log('buildRSS, url = ' + str(url))
+ start = int(url.get('start','0') or '0')
+ data = feedparser.parse(RSSURL%url['url'])['entries']
+ start = 0 if start >= len(data) else start
+ count = 0
+ for idx in range(start,len(data)):
+ item = data[idx]
+ if item and 'summary_detail' in item:
+ try:
+ path, duration = self.resolveURL(url['url'], item['links'][0]['href'])
+ thumb = item['links'][1]['href']
+ label = item['title']
+ plot = item['summary_detail']['value']
+ plot = '%s - %s'%(item['published'], plot)
+ infoLabel = {"mediatype":"video","label":label,"title":label,"plot":plot,"plotoutline":plot,"genre":"News","duration":duration}
+ infoArt = {"thumb":thumb,"poster":thumb,"icon":ICON,"fanart":FANART}
+ self.addLink(label,path,9,infoLabel,infoArt,len(data[start]))
+ count +=1
+ if count == end:
+ break
+ except:
+ pass
+ url['start'] = 0 if count == 0 else idx
+ self.addDir('>> Next',json.dumps(url), 1)
+
+
+ def resolveURL(self, name, url):
+ log('resolveURL, url = ' + str(url))
+ try:
+ cacheResponse = self.cache.get(ADDON_NAME + '.resolveURL, url = %s.%s'%(url,str(BITRATE)))
+ if not cacheResponse:
+ data = self.openURL(url).replace(' ','').replace('(','{').replace(')','}')
+ try:
+ clip = re.search(r'widgetVideoCanvasDS37.SetVariable{"clipId","(.*)"};', data.strip(), re.M|re.I).group(1)
+ except:
+ return
+
+ response = None
+ items = json.loads(self.openURL(VODURL%(name,clip)))
+ if items and 'channel' in items:
+ for video in items['channel']['item']['media-group']['media-content']:
+ if BITRATE == LANGUAGE(30003) and int(video['@attributes']['bitrate']) > 1200:
+ continue
+ elif BITRATE == LANGUAGE(30004) and int(video['@attributes']['bitrate']) > 2200 and int(video['@attributes']['bitrate']) < 1200:
+ continue
+ elif BITRATE == LANGUAGE(30005) and int(video['@attributes']['bitrate']) < 2200:
+ continue
+ log('resolveURL, using bitrate = ' + str(video['@attributes']['bitrate']))
+ response = video['@attributes']['url'], int(video['@attributes']['duration'])
+
+ if not response:
+ response = video['@attributes']['url'], int(video['@attributes']['duration'])
+ self.cache.set(ADDON_NAME + '.resolveURL, url = %s.%s'%(url,str(BITRATE)), response, expiration=datetime.timedelta(hours=48))
+ return self.cache.get(ADDON_NAME + '.resolveURL, url = %s.%s'%(url,str(BITRATE)))
+ except Exception, e:
+ log("resolveURL Failed! " + str(e), xbmc.LOGERROR)
+
+
+ def playVideo(self, name, url, list=None):
+ log('playVideo')
+ if not list:
+ list = xbmcgui.ListItem(name, path=url)
+ xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, list)
+
+
+ def addLink(self, name, u, mode, infoList=False, infoArt=False, total=0):
+ name = name.encode("utf-8")
+ log('addLink, name = ' + name)
+ liz=xbmcgui.ListItem(name)
+ liz.setProperty('IsPlayable', 'true')
+ if infoList == False:
+ liz.setInfo(type="Video", infoLabels={"mediatype":"video","label":name,"title":name,"genre":"News"})
+ else:
+ liz.setInfo(type="Video", infoLabels=infoList)
+
+ if infoArt == False:
+ liz.setArt({'thumb':ICON,'fanart':FANART})
+ else:
+ liz.setArt(infoArt)
+ u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
+ xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,totalItems=total)
+
+
+ def addDir(self, name, u, mode, infoList=False, infoArt=False):
+ name = name.encode("utf-8")
+ log('addDir, name = ' + name)
+ liz=xbmcgui.ListItem(name)
+ liz.setProperty('IsPlayable', 'false')
+ if infoList == False:
+ liz.setInfo(type="Video", infoLabels={"mediatype":"video","label":name,"title":name,"genre":"News"})
+ else:
+ liz.setInfo(type="Video", infoLabels=infoList)
+ if infoArt == False:
+ liz.setArt({'thumb':ICON,'fanart':FANART})
+ else:
+ liz.setArt(infoArt)
+ u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
+ xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
+
+params=getParams()
+try:
+ url=urllib.unquote_plus(params["url"])
+except:
+ url=None
+try:
+ name=urllib.unquote_plus(params["name"])
+except:
+ name=None
+try:
+ mode=int(params["mode"])
+except:
+ mode=None
+
+log("Mode: "+str(mode))
+log("URL : "+str(url))
+log("Name: "+str(name))
+
+if mode==None: News12().buildRegionMenu()
+elif mode == 0: News12().buildMenu(name, json.loads(url))
+elif mode == 1: News12().buildRSS(json.loads(url))
+elif mode == 9: News12().playVideo(name, url)
+
+xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_NONE )
+xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_LABEL )
+xbmcplugin.endOfDirectory(int(sys.argv[1]),cacheToDisc=True) \ No newline at end of file
diff --git a/plugin.video.news12/resources/settings.xml b/plugin.video.news12/resources/settings.xml
new file mode 100644
index 0000000..423c351
--- /dev/null
+++ b/plugin.video.news12/resources/settings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<settings>
+ <setting id="Enable_Debugging" type="bool" label="30000" default="false" />
+ <setting id="Video_Quality" type="enum" label="30002" default="1" lvalues="30003|30004|30005" />
+</settings>
diff --git a/plugin.video.newsmaxtv/LICENSE.md b/plugin.video.newsmaxtv/LICENSE.md
new file mode 100644
index 0000000..733c072
--- /dev/null
+++ b/plugin.video.newsmaxtv/LICENSE.md
@@ -0,0 +1,675 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ {one line to give the program's name and a brief idea of what it does.}
+ Copyright (C) {year} {name of author}
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ {project} Copyright (C) {year} {fullname}
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+
diff --git a/plugin.video.newsmaxtv/addon.xml b/plugin.video.newsmaxtv/addon.xml
new file mode 100644
index 0000000..ba71430
--- /dev/null
+++ b/plugin.video.newsmaxtv/addon.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<addon id="plugin.video.newsmaxtv" version="1.0.0" name="NewsmaxTV" provider-name="Lunatixz">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="script.module.simplecache" version="1.0.0"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource" library="default.py">
+ <provides>video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <summary lang="en_GB">Newsmax TV is a United States cable news channel that is owned by Newsmax Media.</summary>
+ <description lang="en_GB">Newsmax TV is growing rapidly and now reaches over 40 million cable/satellite homes and subscribers.</description>
+ <platform>all</platform>
+ <license>GNU GENERAL PUBLIC LICENSE. Version 3, June 2007</license>
+ <source>https://github.com/Lunatixz/XBMC_Addons/tree/master/plugin.video.newsmaxtv</source>
+ <website>http://www.newsmaxtv.com</website>
+ <forum>http://forum.kodi.tv/showthread.php?tid=321030</forum>
+ <news></news>
+ <assets>
+ <icon>resources/images/icon.png</icon>
+ <fanart>resources/images/fanart.jpg</fanart>
+ <screenshot>resources/images/screenshot01.png</screenshot>
+ <screenshot>resources/images/screenshot02.png</screenshot>
+ </assets>
+ </extension>
+</addon> \ No newline at end of file
diff --git a/plugin.video.newsmaxtv/default.py b/plugin.video.newsmaxtv/default.py
new file mode 100644
index 0000000..4d19f29
--- /dev/null
+++ b/plugin.video.newsmaxtv/default.py
@@ -0,0 +1,23 @@
+# Copyright (C) 2017 Lunatixz
+#
+#
+# This file is part of NewsmaxTV.
+#
+# NewsmaxTV is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# NewsmaxTV is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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 NewsmaxTV. If not, see <http://www.gnu.org/licenses/>.
+
+# -*- coding: utf-8 -*-
+
+#entrypoint
+if __name__ == '__main__':
+ from resources.lib import newsmaxtv \ No newline at end of file
diff --git a/plugin.video.newsmaxtv/resources/__init__.py b/plugin.video.newsmaxtv/resources/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.newsmaxtv/resources/__init__.py
diff --git a/plugin.video.newsmaxtv/resources/images/fanart.jpg b/plugin.video.newsmaxtv/resources/images/fanart.jpg
new file mode 100644
index 0000000..d1555b2
--- /dev/null
+++ b/plugin.video.newsmaxtv/resources/images/fanart.jpg
Binary files differ
diff --git a/plugin.video.newsmaxtv/resources/images/icon.png b/plugin.video.newsmaxtv/resources/images/icon.png
new file mode 100644
index 0000000..f6f3505
--- /dev/null
+++ b/plugin.video.newsmaxtv/resources/images/icon.png
Binary files differ
diff --git a/plugin.video.newsmaxtv/resources/images/screenshot01.png b/plugin.video.newsmaxtv/resources/images/screenshot01.png
new file mode 100644
index 0000000..6d348e3
--- /dev/null
+++ b/plugin.video.newsmaxtv/resources/images/screenshot01.png
Binary files differ
diff --git a/plugin.video.newsmaxtv/resources/images/screenshot02.png b/plugin.video.newsmaxtv/resources/images/screenshot02.png
new file mode 100644
index 0000000..71b3e8b
--- /dev/null
+++ b/plugin.video.newsmaxtv/resources/images/screenshot02.png
Binary files differ
diff --git a/plugin.video.newsmaxtv/resources/language/resource.language.en_gb/strings.po b/plugin.video.newsmaxtv/resources/language/resource.language.en_gb/strings.po
new file mode 100644
index 0000000..4212a42
--- /dev/null
+++ b/plugin.video.newsmaxtv/resources/language/resource.language.en_gb/strings.po
@@ -0,0 +1,25 @@
+# Kodi Media Center language file
+# Addon Name: NewsmaxTV
+# Addon id: plugin.video.newsmaxtv
+# Addon Provider: Lunatixz
+msgid ""
+msgstr ""
+"Project-Id-Version: plugin.video.newsmaxtv\n"
+"Report-Msgid-Bugs-To: http://forum.kodi.tv/showthread.php?tid=321030\n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Lunatixz Translation Team\n"
+"Language-Team: English (http://www.transifex.com/projects/p/xbmc-addons/language/en/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "#30000"
+msgid "Enable Debugging [Log errors]"
+msgstr ""
+
+msgctxt "#30001"
+msgid "Site unreachable, try again later..."
+msgstr ""
diff --git a/plugin.video.newsmaxtv/resources/lib/__init__.py b/plugin.video.newsmaxtv/resources/lib/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.newsmaxtv/resources/lib/__init__.py
diff --git a/plugin.video.newsmaxtv/resources/lib/newsmaxtv.py b/plugin.video.newsmaxtv/resources/lib/newsmaxtv.py
new file mode 100644
index 0000000..2846685
--- /dev/null
+++ b/plugin.video.newsmaxtv/resources/lib/newsmaxtv.py
@@ -0,0 +1,166 @@
+# Copyright (C) 2017 Lunatixz
+#
+#
+# This file is part of NewsmaxTV.
+#
+# NewsmaxTV is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# NewsmaxTV is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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 NewsmaxTV. If not, see <http://www.gnu.org/licenses/>.
+
+# -*- coding: utf-8 -*-
+import os, sys, time, datetime, re, traceback
+import urllib, urllib2, socket, json
+import xbmc, xbmcgui, xbmcplugin, xbmcaddon
+
+from simplecache import SimpleCache
+
+# Plugin Info
+ADDON_ID = 'plugin.video.newsmaxtv'
+REAL_SETTINGS = xbmcaddon.Addon(id=ADDON_ID)
+ADDON_NAME = REAL_SETTINGS.getAddonInfo('name')
+SETTINGS_LOC = REAL_SETTINGS.getAddonInfo('profile')
+ADDON_PATH = REAL_SETTINGS.getAddonInfo('path').decode('utf-8')
+ADDON_VERSION = REAL_SETTINGS.getAddonInfo('version')
+ICON = REAL_SETTINGS.getAddonInfo('icon')
+FANART = REAL_SETTINGS.getAddonInfo('fanart')
+LANGUAGE = REAL_SETTINGS.getLocalizedString
+
+## GLOBALS ##
+TIMEOUT = 30
+DEBUG = REAL_SETTINGS.getSetting('Enable_Debugging') == 'true'
+BASE_URL = 'http://www.newsmaxtv.com'
+YT_URL = 'plugin://plugin.video.youtube/user/NewsmaxTV/'
+YT_LIVE = 'plugin://plugin.video.youtube/play/?video_id=q6HJt7Ki6ng'
+
+def log(msg, level=xbmc.LOGDEBUG):
+ if DEBUG == True:
+ if level == xbmc.LOGERROR:
+ msg += ' ,' + traceback.format_exc()
+ xbmc.log(ADDON_ID + '-' + ADDON_VERSION + '-' + (msg), level)
+
+def getParams():
+ param=[]
+ if len(sys.argv[2])>=2:
+ params=sys.argv[2]
+ cleanedparams=params.replace('?','')
+ if (params[len(params)-1]=='/'):
+ params=params[0:len(params)-2]
+ pairsofparams=cleanedparams.split('&')
+ param={}
+ for i in range(len(pairsofparams)):
+ splitparams={}
+ splitparams=pairsofparams[i].split('=')
+ if (len(splitparams))==2:
+ param[splitparams[0]]=splitparams[1]
+ return param
+
+socket.setdefaulttimeout(TIMEOUT)
+class Newsmax(object):
+ def __init__(self):
+ log('__init__')
+ self.cache = SimpleCache()
+
+
+ def openURL(self, url):
+ log('openURL, url = ' + str(url))
+ try:
+ cacheResponse = self.cache.get(ADDON_NAME + '.openURL, url = %s'%url)
+ if not cacheResponse:
+ request = urllib2.Request(url)
+ request.add_header('User-Agent','Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)')
+ response = urllib2.urlopen(request, timeout=TIMEOUT).read()
+ self.cache.set(ADDON_NAME + '.openURL, url = %s'%url, response, expiration=datetime.timedelta(hours=6))
+ return self.cache.get(ADDON_NAME + '.openURL, url = %s'%url)
+ except urllib2.URLError, e:
+ log("openURL Failed! " + str(e), xbmc.LOGERROR)
+ except socket.timeout, e:
+ log("openURL Failed! " + str(e), xbmc.LOGERROR)
+ except Exception, e:
+ log("openURL Failed! " + str(e), xbmc.LOGERROR)
+ xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30001), ICON, 4000)
+ return ''
+
+
+ def buildMainMenu(self):
+ self.addLink('Live' ,'',0)
+ self.addYoutube('Browse',YT_URL)
+
+
+ def buildLiveLink(self):
+ log('buildLiveLink')
+ try:
+ #parse for youtube live feed, may not be necessary. However its useful if the site changes feeds, fallback live youtube feed.
+ site = json.loads(self.openURL(BASE_URL).split('<script type="application/ld+json">')[1].split('</script>')[0])['embedUrl']
+ data = ((self.openURL(site).replace('\n','').replace('\r','').replace('\t','').replace('\\','')).split('"entryResult":')[1]).split(',"recordedEntryId"')[0]+'}}'
+ url = 'https://'+((re.compile('https://(.+?)m3u8', re.DOTALL).search(data)).group(1))+'m3u8'
+ except:
+ url = YT_LIVE
+ self.playVideo('NewsmaxTV Live',url)
+
+
+ def playVideo(self, name, url, liz=None):
+ log('playVideo')
+ if not liz:
+ liz = xbmcgui.ListItem(name, path=url)
+ xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
+
+
+ def addLink(self, name, u, mode, infoList=False, infoArt=False, total=0):
+ name = name.encode("utf-8")
+ log('addLink, name = ' + name)
+ liz=xbmcgui.ListItem(name)
+ liz.setProperty('IsPlayable', 'true')
+ if infoList == False:
+ liz.setInfo(type="Video", infoLabels={"mediatype":"video","label":name,"title":name,"genre":"News"})
+ else:
+ liz.setInfo(type="Video", infoLabels=infoList)
+
+ if infoArt == False:
+ liz.setArt({'thumb':ICON,'fanart':FANART})
+ else:
+ liz.setArt(infoArt)
+ u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
+ xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,totalItems=total)
+
+
+ def addYoutube(self, title, url):
+ liz=xbmcgui.ListItem(title)
+ liz.setProperty('IsPlayable', 'false')
+ liz.setInfo(type="Video", infoLabels={"label":title,"title":title} )
+ liz.setArt({'thumb':ICON,'fanart':FANART})
+ xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=liz,isFolder=True)
+
+params=getParams()
+try:
+ url=urllib.unquote_plus(params["url"])
+except:
+ url=None
+try:
+ name=urllib.unquote_plus(params["name"])
+except:
+ name=None
+try:
+ mode=int(params["mode"])
+except:
+ mode=None
+
+log("Mode: "+str(mode))
+log("URL : "+str(url))
+log("Name: "+str(name))
+
+if mode==None: Newsmax().buildMainMenu()
+if mode == 0: Newsmax().buildLiveLink()
+elif mode == 9: Newsmax().playVideo(name, url)
+
+xbmcplugin.addSortMethod(int(sys.argv[1]) , xbmcplugin.SORT_METHOD_NONE )
+xbmcplugin.addSortMethod(int(sys.argv[1]) , xbmcplugin.SORT_METHOD_LABEL )
+xbmcplugin.endOfDirectory(int(sys.argv[1]),cacheToDisc=True) \ No newline at end of file
diff --git a/plugin.video.newsmaxtv/resources/settings.xml b/plugin.video.newsmaxtv/resources/settings.xml
new file mode 100644
index 0000000..65b7d95
--- /dev/null
+++ b/plugin.video.newsmaxtv/resources/settings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<settings>
+ <setting id="Enable_Debugging" type="bool" label="30000" default="false" />
+</settings>
diff --git a/plugin.video.newson/addon.xml b/plugin.video.newson/addon.xml
index a2d754c..61b7dfd 100644
--- a/plugin.video.newson/addon.xml
+++ b/plugin.video.newson/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<addon id="plugin.video.newson" version="1.0.2" name="NewsON" provider-name="Lunatixz">
+<addon id="plugin.video.newson" version="1.0.3" name="NewsON" provider-name="Lunatixz">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
<import addon="script.module.simplecache" version="1.0.0"/>
@@ -16,10 +16,10 @@
<source>https://github.com/Lunatixz/XBMC_Addons/tree/master/plugin.video.newson</source>
<website>http://watchnewson.com/</website>
<forum>https://forum.kodi.tv/showthread.php?tid=315924</forum>
- <news>v1.0.1[CR]- Updated cache parameters, Improved error detection.,v1.0.2[CR]- Updated cache parameters.</news>
+ <news>v1.0.3[CR]- Plugin improvments.[CR]v1.0.2[CR]- Updated cache parameters.[CR]v1.0.1[CR]- Updated cache parameters, Improved error detection.</news>
<assets>
- <icon>icon.png</icon>
- <fanart>fanart.jpg</fanart>
+ <icon>resources/images/icon.png</icon>
+ <fanart>resources/images/fanart.jpg</fanart>
<screenshot>resources/images/screenshot01.png</screenshot>
<screenshot>resources/images/screenshot02.png</screenshot>
<screenshot>resources/images/screenshot03.png</screenshot>
diff --git a/plugin.video.newson/default.py b/plugin.video.newson/default.py
index 30e1be0..4d85239 100644
--- a/plugin.video.newson/default.py
+++ b/plugin.video.newson/default.py
@@ -17,256 +17,7 @@
# along with NewsOn. If not, see <http://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
-import os, sys, time, datetime, re, traceback, feedparser
-import urllib, urllib2, socket, json, collections, gzip
-import xbmc, xbmcgui, xbmcplugin, xbmcvfs, xbmcaddon
-from StringIO import StringIO
-from simplecache import SimpleCache
-# Plugin Info
-ADDON_ID = 'plugin.video.newson'
-REAL_SETTINGS = xbmcaddon.Addon(id=ADDON_ID)
-ADDON_NAME = REAL_SETTINGS.getAddonInfo('name')
-SETTINGS_LOC = REAL_SETTINGS.getAddonInfo('profile')
-ADDON_PATH = REAL_SETTINGS.getAddonInfo('path').decode('utf-8')
-ADDON_VERSION = REAL_SETTINGS.getAddonInfo('version')
-ICON = REAL_SETTINGS.getAddonInfo('icon')
-FANART = REAL_SETTINGS.getAddonInfo('fanart')
-LANGUAGE = REAL_SETTINGS.getLocalizedString
-NEWSART = os.path.join(ADDON_PATH,'resources','images','newscast.jpg')
-CLIPART = os.path.join(ADDON_PATH,'resources','images','videoclips.jpg')
-
-## GLOBALS ##
-TIMEOUT = 30
-DEBUG = REAL_SETTINGS.getSetting('Enable_Debugging') == 'true'
-BASE_API = 'http://watchnewson.com/api/linear/channels'
-MENU = [("Newscasts" , '0', 0, False, {"thumb":NEWSART,"poster":NEWSART,"fanart":FANART,"icon":ICON,"logo":ICON}),
- ("Video Clips", '2', 2, False, {"thumb":CLIPART,"poster":CLIPART,"fanart":FANART,"icon":ICON,"logo":ICON})]
-
-def log(msg, level=xbmc.LOGDEBUG):
- if DEBUG == True:
- if level == xbmc.LOGERROR:
- msg += ' ,' + traceback.format_exc()
- xbmc.log(ADDON_ID + '-' + ADDON_VERSION + '-' + stringify(msg), level)
-
-def stringify(string):
- if isinstance(string, list):
- string = (string[0])
- elif isinstance(string, (int, float, long, complex, bool)):
- string = str(string)
-
- if isinstance(string, basestring):
- if not isinstance(string, unicode):
- string = unicode(string, 'utf-8')
- elif isinstance(string, unicode):
- string = string.encode('ascii', 'ignore')
- else:
- string = string.encode('utf-8', 'ignore')
- return string
-
-def getParams():
- param=[]
- if len(sys.argv[2])>=2:
- params=sys.argv[2]
- cleanedparams=params.replace('?','')
- if (params[len(params)-1]=='/'):
- params=params[0:len(params)-2]
- pairsofparams=cleanedparams.split('&')
- param={}
- for i in range(len(pairsofparams)):
- splitparams={}
- splitparams=pairsofparams[i].split('=')
- if (len(splitparams))==2:
- param[splitparams[0]]=splitparams[1]
- return param
-
-socket.setdefaulttimeout(TIMEOUT)
-class NewsOn():
- def __init__(self):
- log('__init__')
- self.cache = SimpleCache()
- self.stateMenu = self.getStates()
-
-
- def openURL(self, url):
- try:
- cacheResponce = self.cache.get(ADDON_NAME + '.openURL, url = %s'%url)
- if not cacheResponce:
- request = urllib2.Request(url)
- request.add_header('Accept-encoding', 'gzip')
- request.add_header('User-Agent','Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)')
- responce = urllib2.urlopen(request, timeout = TIMEOUT)
- log(responce.headers['content-type'])
- log(responce.headers['content-encoding'])
- if responce.info().get('content-encoding') == 'gzip':
- buf = StringIO(responce.read())
- f = gzip.GzipFile(fileobj=buf)
- results = json.loads(f.read())
- else:
- results = json.load(responce)
- responce.close()
- self.cache.set(ADDON_NAME + '.openURL, url = %s'%url, results, expiration=datetime.timedelta(hours=1))
- return self.cache.get(ADDON_NAME + '.openURL, url = %s'%url)
- except urllib2.URLError, e:
- log("openURL Failed! " + str(e), xbmc.LOGERROR)
- except socket.timeout, e:
- log("openURL Failed! " + str(e), xbmc.LOGERROR)
- except:
- xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30001), ICON, 4000)
-
-
- def mainMenu(self):
- log('mainMenu')
- for item in MENU:
- self.addDir(*item)
-
-
- def browseMenu(self, id=1):
- log('browseMenu, id = ' + str(id))
- self.stateMenu = [tuple(s.format(id) for s in tup) for tup in self.stateMenu]
- for item in self.stateMenu:
- self.addDir(*item)
-
-
- def getStates(self):
- log('getStates')
- state = []
- stateLST = []
- data = self.openURL(BASE_API)
- if data:
- for channel in data:
- state.append(channel['config']['state'])
- states = collections.Counter(state)
- for key, value in sorted(states.iteritems()):
- stateLST.append(("%s"%(key), key , '{}'))
- return stateLST
-
-
- def newsCasts(self, state):
- log('newsCasts, state = ' + state)
- urls = []
- data = self.openURL(BASE_API)
- if data:
- for channel in data:
- if state in channel['config']['state']:
- chid = channel['identifier']
- title = channel['title']
- icon = (channel['icon'] or ICON)
- for idx, stream in enumerate(channel['streams']):
- #multiple urls, only add unique.
- url = (stream['Url'].split('.m3u8?')[0])+'.m3u8'
- offset = stream['OffsetFromNow']
- delay = url+'&delay=%d'
- #todo do something with delay option?
- if url not in urls:
- urls.append(url)
- chid = chid+'.%d'%idx if idx > 0 else chid
- label = "%s - %s" % (chid, title)
- infoLabels ={"mediatype":"video","label":label ,"title":label}
- infoArt ={"thumb":icon,"poster":icon,"fanart":FANART,"icon":icon,"logo":icon}
- self.addLink(title, url, 9, infoLabels, infoArt)
-
-
- def videoclips(self, state):
- log('videoclips, state = ' + state)
- data = self.openURL(BASE_API)
- if data:
- for channel in data:
- if state in channel['config']['state']:
- chid = channel['identifier']
- title = channel['title']
- icon = (channel['icon'] or ICON)
- vidURL = channel['config']['localvodfeed']
- if vidURL:
- label = "%s - %s" % (chid, title)
- infoLabels ={"mediatype":"video","label":label,"title":label}
- infoArt ={"thumb":icon,"poster":icon,"fanart":FANART,"icon":ICON,"logo":ICON}
- self.addDir(label, vidURL, 4, infoLabels, infoArt)
-
-
- def parseclips(self, url):
- log('parseclips, url = ' + url)
- #using xmltodict, feedparser too bulky for the job.
- feed = feedparser.parse(url)
- for item in feed['entries']:
- if item and 'summary_detail' in item:
- for vids in item['media_content']:
- title = item['title']
- url = vids['url']
- plot = item['summary']
- thumb = item['media_thumbnail'][0]['url']
- infoLabels ={"mediatype":"video","label":title,"title":title,"plot":plot}
- infoArt ={"thumb":thumb,"poster":thumb,"fanart":FANART,"icon":ICON,"logo":ICON}
- self.addLink(title, url, 9, infoLabels, infoArt)
-
-
- def playVideo(self, name, url, list=None):
- log('playVideo')
- if not list:
- list = xbmcgui.ListItem(name, path=url)
- xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, list)
-
-
- def addLink(self, name, u, mode, infoList=False, infoArt=False, total=0):
- name = stringify(name)
- log('addLink, name = ' + name)
- liz=xbmcgui.ListItem(name)
- liz.setProperty('IsPlayable', 'true')
- if infoList == False:
- liz.setInfo( type="Video", infoLabels={"mediatype":"video","label":name,"title":name})
- else:
- liz.setInfo(type="Video", infoLabels=infoList)
-
- if infoArt == False:
- liz.setArt({'thumb':ICON,'fanart':FANART})
- else:
- liz.setArt(infoArt)
- u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
- xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,totalItems=total)
-
-
- def addDir(self, name, u, mode, infoList=False, infoArt=False):
- name = stringify(name)
- log('addDir, name = ' + name)
- liz=xbmcgui.ListItem(name)
- liz.setProperty('IsPlayable', 'false')
- if infoList == False:
- liz.setInfo(type="Video", infoLabels={"mediatype":"video","label":name,"title":name})
- else:
- liz.setInfo(type="Video", infoLabels=infoList)
- if infoArt == False:
- liz.setArt({'thumb':ICON,'fanart':FANART})
- else:
- liz.setArt(infoArt)
- u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
- xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
-
-params=getParams()
-try:
- url=urllib.unquote_plus(params["url"])
-except:
- url=None
-try:
- name=urllib.unquote_plus(params["name"])
-except:
- name=None
-try:
- mode=int(params["mode"])
-except:
- mode=None
-
-log("Mode: "+str(mode))
-log("URL : "+str(url))
-log("Name: "+str(name))
-
-if mode==None: NewsOn().mainMenu()
-elif mode == 0: NewsOn().browseMenu(1)
-elif mode == 1: NewsOn().newsCasts(url)
-elif mode == 2: NewsOn().browseMenu(3)
-elif mode == 3: NewsOn().videoclips(url)
-elif mode == 4: NewsOn().parseclips(url)
-elif mode == 9: NewsOn().playVideo(name, url)
-
-xbmcplugin.addSortMethod(int(sys.argv[1]) , xbmcplugin.SORT_METHOD_NONE )
-xbmcplugin.addSortMethod(int(sys.argv[1]) , xbmcplugin.SORT_METHOD_LABEL )
-xbmcplugin.endOfDirectory(int(sys.argv[1]),cacheToDisc=True) \ No newline at end of file
+#entrypoint
+if __name__ == '__main__':
+ from resources.lib import newson \ No newline at end of file
diff --git a/plugin.video.newson/fanart.jpg b/plugin.video.newson/fanart.jpg
deleted file mode 100644
index b6629a3..0000000
--- a/plugin.video.newson/fanart.jpg
+++ /dev/null
Binary files differ
diff --git a/plugin.video.newson/resources/__init__.py b/plugin.video.newson/resources/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.newson/resources/__init__.py
diff --git a/plugin.video.newson/resources/images/fanart.jpg b/plugin.video.newson/resources/images/fanart.jpg
new file mode 100644
index 0000000..bcc3c04
--- /dev/null
+++ b/plugin.video.newson/resources/images/fanart.jpg
Binary files differ
diff --git a/plugin.video.newson/icon.png b/plugin.video.newson/resources/images/icon.png
index 579e696..579e696 100644
--- a/plugin.video.newson/icon.png
+++ b/plugin.video.newson/resources/images/icon.png
Binary files differ
diff --git a/plugin.video.newson/resources/images/newscast.jpg b/plugin.video.newson/resources/images/newscast.jpg
index 6bed258..11673f1 100644
--- a/plugin.video.newson/resources/images/newscast.jpg
+++ b/plugin.video.newson/resources/images/newscast.jpg
Binary files differ
diff --git a/plugin.video.newson/resources/images/videoclips.jpg b/plugin.video.newson/resources/images/videoclips.jpg
index 6120aa3..7e3217c 100644
--- a/plugin.video.newson/resources/images/videoclips.jpg
+++ b/plugin.video.newson/resources/images/videoclips.jpg
Binary files differ
diff --git a/plugin.video.newson/resources/lib/__init__.py b/plugin.video.newson/resources/lib/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.newson/resources/lib/__init__.py
diff --git a/plugin.video.newson/resources/lib/newson.py b/plugin.video.newson/resources/lib/newson.py
new file mode 100644
index 0000000..5999d4a
--- /dev/null
+++ b/plugin.video.newson/resources/lib/newson.py
@@ -0,0 +1,271 @@
+# Copyright (C) 2017 Lunatixz
+#
+#
+# This file is part of NewsOn.
+#
+# NewsOn is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# NewsOn is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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 NewsOn. If not, see <http://www.gnu.org/licenses/>.
+
+# -*- coding: utf-8 -*-
+import os, sys, time, datetime, re, traceback, feedparser, random
+import urllib, urllib2, socket, json, collections, gzip
+import xbmc, xbmcgui, xbmcplugin, xbmcvfs, xbmcaddon
+
+from StringIO import StringIO
+from simplecache import SimpleCache
+# Plugin Info
+ADDON_ID = 'plugin.video.newson'
+REAL_SETTINGS = xbmcaddon.Addon(id=ADDON_ID)
+ADDON_NAME = REAL_SETTINGS.getAddonInfo('name')
+SETTINGS_LOC = REAL_SETTINGS.getAddonInfo('profile')
+ADDON_PATH = REAL_SETTINGS.getAddonInfo('path').decode('utf-8')
+ADDON_VERSION = REAL_SETTINGS.getAddonInfo('version')
+ICON = REAL_SETTINGS.getAddonInfo('icon')
+FANART = REAL_SETTINGS.getAddonInfo('fanart')
+LANGUAGE = REAL_SETTINGS.getLocalizedString
+NEWSART = os.path.join(ADDON_PATH,'resources','images','newscast.jpg')
+CLIPART = os.path.join(ADDON_PATH,'resources','images','videoclips.jpg')
+
+## GLOBALS ##
+TIMEOUT = 30
+DEBUG = REAL_SETTINGS.getSetting('Enable_Debugging') == 'true'
+BASE_API = 'http://watchnewson.com/api/linear/channels'
+MENU = [("Newscasts" , '0', 0, False, {"thumb":NEWSART,"poster":NEWSART,"fanart":FANART,"icon":ICON,"logo":ICON}),
+ ("Video Clips", '2', 2, False, {"thumb":CLIPART,"poster":CLIPART,"fanart":FANART,"icon":ICON,"logo":ICON})]
+
+def log(msg, level=xbmc.LOGDEBUG):
+ if DEBUG == True:
+ if level == xbmc.LOGERROR:
+ msg += ' ,' + traceback.format_exc()
+ xbmc.log(ADDON_ID + '-' + ADDON_VERSION + '-' + (msg), level)
+
+def getParams():
+ param=[]
+ if len(sys.argv[2])>=2:
+ params=sys.argv[2]
+ cleanedparams=params.replace('?','')
+ if (params[len(params)-1]=='/'):
+ params=params[0:len(params)-2]
+ pairsofparams=cleanedparams.split('&')
+ param={}
+ for i in range(len(pairsofparams)):
+ splitparams={}
+ splitparams=pairsofparams[i].split('=')
+ if (len(splitparams))==2:
+ param[splitparams[0]]=splitparams[1]
+ return param
+
+socket.setdefaulttimeout(TIMEOUT)
+class NewsOn(object):
+ def __init__(self):
+ log('__init__')
+ self.cache = SimpleCache()
+ self.stateMenu = self.getStates()
+
+
+ def openURL(self, url):
+ try:
+ cacheResponce = self.cache.get(ADDON_NAME + '.openURL, url = %s'%url)
+ if not cacheResponce:
+ request = urllib2.Request(url)
+ request.add_header('Accept-encoding', 'gzip')
+ request.add_header('User-Agent','Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)')
+ responce = urllib2.urlopen(request, timeout = TIMEOUT)
+ log(responce.headers['content-type'])
+ log(responce.headers['content-encoding'])
+ if responce.info().get('content-encoding') == 'gzip':
+ buf = StringIO(responce.read())
+ f = gzip.GzipFile(fileobj=buf)
+ results = json.loads(f.read())
+ else:
+ results = json.load(responce)
+ responce.close()
+ self.cache.set(ADDON_NAME + '.openURL, url = %s'%url, results, expiration=datetime.timedelta(hours=1))
+ return self.cache.get(ADDON_NAME + '.openURL, url = %s'%url)
+ except urllib2.URLError, e:
+ log("openURL Failed! " + str(e), xbmc.LOGERROR)
+ except socket.timeout, e:
+ log("openURL Failed! " + str(e), xbmc.LOGERROR)
+ except:
+ xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30001), ICON, 4000)
+
+
+ def mainMenu(self):
+ log('mainMenu')
+ for item in MENU:
+ self.addDir(*item)
+
+
+ def browseMenu(self, id=1):
+ log('browseMenu, id = ' + str(id))
+ self.stateMenu = [tuple(s.format(id) for s in tup) for tup in self.stateMenu]
+ for item in self.stateMenu:
+ self.addDir(*item)
+
+
+ def getStates(self):
+ log('getStates')
+ state = []
+ stateLST = []
+ data = self.openURL(BASE_API)
+ if data:
+ for channel in data:
+ state.append(channel['config']['state'])
+ states = collections.Counter(state)
+ for key, value in sorted(states.iteritems()):
+ stateLST.append(("%s"%(key), key , '{}'))
+ return stateLST
+
+
+ def newsCasts(self, state):
+ log('newsCasts, state = ' + state)
+ urls = []
+ data = self.openURL(BASE_API)
+ if data:
+ for channel in data:
+ if state in channel['config']['state']:
+ chid = channel['identifier']
+ title = channel['title']
+ icon = (channel['icon'] or ICON)
+ for idx, stream in enumerate(channel['streams']):
+ streamType = stream['StreamType']
+ if streamType == 'website':#random.choice(['website','roku']):
+ continue
+ #multiple urls, only add unique.
+ url = stream['Url']
+ offset = stream['OffsetFromNow']
+ delay = url+'&delay=%d'
+ #todo do something with delay option?
+ if url not in urls:
+ urls.append(url)
+ chid = chid+'.%d'%idx if idx > 0 else chid
+ label = "%s - %s" % (chid, title)
+ infoLabels ={"mediatype":"video","label":label ,"title":label}
+ infoArt ={"thumb":icon,"poster":icon,"fanart":FANART,"icon":icon,"logo":icon}
+ self.addLink(title, url, 9, infoLabels, infoArt)
+
+
+ def videoclips(self, state):
+ log('videoclips, state = ' + state)
+ data = self.openURL(BASE_API)
+ if data:
+ for channel in data:
+ if state in channel['config']['state']:
+ chid = channel['identifier']
+ title = channel['title']
+ icon = (channel['icon'] or ICON)
+ vidURL = channel['config']['localvodfeed']
+ if vidURL:
+ label = "%s - %s" % (chid, title)
+ infoLabels ={"mediatype":"video","label":label,"title":label}
+ infoArt ={"thumb":icon,"poster":icon,"fanart":FANART,"icon":ICON,"logo":ICON}
+ self.addDir(label, vidURL, 4, infoLabels, infoArt)
+
+
+ def parseclips(self, url):
+ log('parseclips, url = ' + url)
+ feed = feedparser.parse(url)
+ for item in feed['entries']:
+ if item and 'summary_detail' in item:
+ for vids in item['media_content']:
+ title = item['title']
+ url = vids['url']
+ plot = item['summary']
+ try:
+ aired = (datetime.datetime.strptime(item.get('published',''), '%a, %d %b %Y %H:%M:%S UTC'))
+ except:
+ aired = datetime.datetime.now()
+ aired = aired.strftime("%Y-%m-%d")
+ thumb = item['media_thumbnail'][0]['url']
+ tagLST = []
+ if 'tags' in item:
+ for tag in item['tags']:
+ print tag
+ tagLST.append(((tag['term']).split('/')[0]).title())
+ if len(tagLST) > 0:
+ genre = (tagLST[0] or '')
+ infoLabels ={"mediatype":"video","label":title,"title":title,"plot":plot,"aired":aired,'genre':genre,'tags':tagLST}
+ infoArt ={"thumb":thumb,"poster":thumb,"fanart":FANART,"icon":ICON,"logo":ICON}
+ self.addLink(title, url, 9, infoLabels, infoArt)
+
+
+ def playVideo(self, name, url, list=None):
+ log('playVideo')
+ if not list:
+ list = xbmcgui.ListItem(name, path=url)
+ xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, list)
+
+
+ def addLink(self, name, u, mode, infoList=False, infoArt=False, total=0):
+ name = name.encode("utf-8")
+ log('addLink, name = ' + name)
+ liz=xbmcgui.ListItem(name)
+ liz.setProperty('IsPlayable', 'true')
+ if infoList == False:
+ liz.setInfo( type="Video", infoLabels={"mediatype":"video","label":name,"title":name})
+ else:
+ liz.setInfo(type="Video", infoLabels=infoList)
+
+ if infoArt == False:
+ liz.setArt({'thumb':ICON,'fanart':FANART})
+ else:
+ liz.setArt(infoArt)
+ u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
+ xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,totalItems=total)
+
+
+ def addDir(self, name, u, mode, infoList=False, infoArt=False):
+ name = name.encode("utf-8")
+ log('addDir, name = ' + name)
+ liz=xbmcgui.ListItem(name)
+ liz.setProperty('IsPlayable', 'false')
+ if infoList == False:
+ liz.setInfo(type="Video", infoLabels={"mediatype":"video","label":name,"title":name})
+ else:
+ liz.setInfo(type="Video", infoLabels=infoList)
+ if infoArt == False:
+ liz.setArt({'thumb':ICON,'fanart':FANART})
+ else:
+ liz.setArt(infoArt)
+ u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
+ xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
+
+params=getParams()
+try:
+ url=urllib.unquote_plus(params["url"])
+except:
+ url=None
+try:
+ name=urllib.unquote_plus(params["name"])
+except:
+ name=None
+try:
+ mode=int(params["mode"])
+except:
+ mode=None
+
+log("Mode: "+str(mode))
+log("URL : "+str(url))
+log("Name: "+str(name))
+
+if mode==None: NewsOn().mainMenu()
+elif mode == 0: NewsOn().browseMenu(1)
+elif mode == 1: NewsOn().newsCasts(url)
+elif mode == 2: NewsOn().browseMenu(3)
+elif mode == 3: NewsOn().videoclips(url)
+elif mode == 4: NewsOn().parseclips(url)
+elif mode == 9: NewsOn().playVideo(name, url)
+
+xbmcplugin.addSortMethod(int(sys.argv[1]) , xbmcplugin.SORT_METHOD_NONE )
+xbmcplugin.addSortMethod(int(sys.argv[1]) , xbmcplugin.SORT_METHOD_LABEL )
+xbmcplugin.endOfDirectory(int(sys.argv[1]),cacheToDisc=True) \ No newline at end of file
diff --git a/plugin.video.newsy/LICENSE.md b/plugin.video.newsy/LICENSE.md
new file mode 100644
index 0000000..733c072
--- /dev/null
+++ b/plugin.video.newsy/LICENSE.md
@@ -0,0 +1,675 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ {one line to give the program's name and a brief idea of what it does.}
+ Copyright (C) {year} {name of author}
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ {project} Copyright (C) {year} {fullname}
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+
diff --git a/plugin.video.newsy/addon.xml b/plugin.video.newsy/addon.xml
new file mode 100644
index 0000000..268499c
--- /dev/null
+++ b/plugin.video.newsy/addon.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<addon id="plugin.video.newsy" version="1.0.2" name="Newsy" provider-name="Lunatixz">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="script.module.simplecache" version="1.0.0"/>
+ <import addon="script.module.feedparser" version="5.1.3"/>
+ <import addon="script.module.beautifulsoup4" version="4.3.2"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource" library="default.py">
+ <provides>video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <summary lang="en_GB">Newsy is a video news network that produces short-form video news pieces that provide breaking news and updates across U.S. and world news, policy and politics, science and health, entertainment, technology, business and sports.</summary>
+ <description lang="en_GB">Newsy is your source for concise, unbiased video news and analysis covering the top stories from around the world. With persistent curiosity and no agenda, we strive to fuel meaningful conversations by highlighting multiple sides of every story. Newsy delivers the news and perspective you need without the hype and bias common to many news sources.</description>
+ <platform>all</platform>
+ <license>GNU GENERAL PUBLIC LICENSE. Version 3, June 2007</license>
+ <source>https://github.com/Lunatixz/XBMC_Addons/tree/master/plugin.video.newsy</source>
+ <website>http://www.newsy.com</website>
+ <forum>https://forum.kodi.tv/showthread.php?tid=320402</forum>
+ <news>[CR]v1.0.2[CR]- Improved caching.[CR]v1.0.1[CR]- Improved browsing speed.</news>
+ <assets>
+ <icon>resources/images/icon.png</icon>
+ <fanart>resources/images/fanart.jpg</fanart>
+ <screenshot>resources/images/screenshot01.png</screenshot>
+ <screenshot>resources/images/screenshot02.png</screenshot>
+ </assets>
+ </extension>
+</addon> \ No newline at end of file
diff --git a/plugin.video.newsy/default.py b/plugin.video.newsy/default.py
new file mode 100644
index 0000000..f4bfd84
--- /dev/null
+++ b/plugin.video.newsy/default.py
@@ -0,0 +1,23 @@
+# Copyright (C) 2017 Lunatixz
+#
+#
+# This file is part of Newsy.
+#
+# Newsy is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Newsy is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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 Newsy. If not, see <http://www.gnu.org/licenses/>.
+
+# -*- coding: utf-8 -*-
+
+#entrypoint
+if __name__ == '__main__':
+ from resources.lib import newsy \ No newline at end of file
diff --git a/plugin.video.newsy/resources/__init__.py b/plugin.video.newsy/resources/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.newsy/resources/__init__.py
diff --git a/plugin.video.newsy/resources/images/fanart.jpg b/plugin.video.newsy/resources/images/fanart.jpg
new file mode 100644
index 0000000..64ddc1a
--- /dev/null
+++ b/plugin.video.newsy/resources/images/fanart.jpg
Binary files differ
diff --git a/plugin.video.newsy/resources/images/icon.png b/plugin.video.newsy/resources/images/icon.png
new file mode 100644
index 0000000..a11a575
--- /dev/null
+++ b/plugin.video.newsy/resources/images/icon.png
Binary files differ
diff --git a/plugin.video.newsy/resources/images/screenshot01.png b/plugin.video.newsy/resources/images/screenshot01.png
new file mode 100644
index 0000000..7c34469
--- /dev/null
+++ b/plugin.video.newsy/resources/images/screenshot01.png
Binary files differ
diff --git a/plugin.video.newsy/resources/images/screenshot02.png b/plugin.video.newsy/resources/images/screenshot02.png
new file mode 100644
index 0000000..01abe93
--- /dev/null
+++ b/plugin.video.newsy/resources/images/screenshot02.png
Binary files differ
diff --git a/plugin.video.newsy/resources/language/resource.language.en_gb/strings.po b/plugin.video.newsy/resources/language/resource.language.en_gb/strings.po
new file mode 100644
index 0000000..3cf5982
--- /dev/null
+++ b/plugin.video.newsy/resources/language/resource.language.en_gb/strings.po
@@ -0,0 +1,29 @@
+# Kodi Media Center language file
+# Addon Name: Newsy
+# Addon id: plugin.video.newsy
+# Addon Provider: Lunatixz
+msgid ""
+msgstr ""
+"Project-Id-Version: plugin.video.newsy\n"
+"Report-Msgid-Bugs-To: https://forum.kodi.tv/showthread.php?tid=320402\n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Lunatixz Translation Team\n"
+"Language-Team: English (http://www.transifex.com/projects/p/xbmc-addons/language/en/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "#30000"
+msgid "Enable Debugging [Log errors]"
+msgstr ""
+
+msgctxt "#30001"
+msgid "Something went wrong, Try again..."
+msgstr ""
+
+msgctxt "#30002"
+msgid "Preferred Playback Method"
+msgstr ""
diff --git a/plugin.video.newsy/resources/lib/__init__.py b/plugin.video.newsy/resources/lib/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.newsy/resources/lib/__init__.py
diff --git a/plugin.video.newsy/resources/lib/newsy.py b/plugin.video.newsy/resources/lib/newsy.py
new file mode 100644
index 0000000..640e8ad
--- /dev/null
+++ b/plugin.video.newsy/resources/lib/newsy.py
@@ -0,0 +1,215 @@
+# Copyright (C) 2017 Lunatixz
+#
+#
+# This file is part of Newsy.
+#
+# Newsy is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Newsy is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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 Newsy. If not, see <http://www.gnu.org/licenses/>.
+
+# -*- coding: utf-8 -*-
+import os, sys, time, datetime, traceback, feedparser
+import urllib, urllib2, socket, json
+import xbmc, xbmcgui, xbmcplugin, xbmcaddon
+
+from simplecache import SimpleCache
+from bs4 import BeautifulSoup
+
+# Plugin Info
+ADDON_ID = 'plugin.video.newsy'
+REAL_SETTINGS = xbmcaddon.Addon(id=ADDON_ID)
+ADDON_NAME = REAL_SETTINGS.getAddonInfo('name')
+SETTINGS_LOC = REAL_SETTINGS.getAddonInfo('profile')
+ADDON_PATH = REAL_SETTINGS.getAddonInfo('path').decode('utf-8')
+ADDON_VERSION = REAL_SETTINGS.getAddonInfo('version')
+ICON = REAL_SETTINGS.getAddonInfo('icon')
+FANART = REAL_SETTINGS.getAddonInfo('fanart')
+LANGUAGE = REAL_SETTINGS.getLocalizedString
+
+## GLOBALS ##
+TIMEOUT = 15
+DEBUG = REAL_SETTINGS.getSetting('Enable_Debugging') == 'true'
+LIVEURL = 'http://www.newsy.com/live/'
+RSSURL = 'http://feeds.feedburner.com/newsy-allvideos/'
+VID_TYPE = ['M3U8','MP4'][int(REAL_SETTINGS.getSetting('Video_Type'))]
+
+def log(msg, level=xbmc.LOGDEBUG):
+ if DEBUG == True:
+ if level == xbmc.LOGERROR:
+ msg += ' ,' + traceback.format_exc()
+ xbmc.log(ADDON_ID + '-' + ADDON_VERSION + '-' + (msg), level)
+
+def getParams():
+ param=[]
+ if len(sys.argv[2])>=2:
+ params=sys.argv[2]
+ cleanedparams=params.replace('?','')
+ if (params[len(params)-1]=='/'):
+ params=params[0:len(params)-2]
+ pairsofparams=cleanedparams.split('&')
+ param={}
+ for i in range(len(pairsofparams)):
+ splitparams={}
+ splitparams=pairsofparams[i].split('=')
+ if (len(splitparams))==2:
+ param[splitparams[0]]=splitparams[1]
+ return param
+
+socket.setdefaulttimeout(TIMEOUT)
+class Newsy(object):
+ def __init__(self):
+ log('__init__')
+ self.cache = SimpleCache()
+
+
+ def openURL(self, url):
+ log('openURL, url = ' + str(url))
+ try:
+ cacheResponse = self.cache.get(ADDON_NAME + '.openURL, url = %s'%url)
+ if not cacheResponse:
+ request = urllib2.Request(url)
+ request.add_header('User-Agent','Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)')
+ response = urllib2.urlopen(request, timeout=TIMEOUT).read()
+ self.cache.set(ADDON_NAME + '.openURL, url = %s'%url, response, expiration=datetime.timedelta(hours=6))
+ return self.cache.get(ADDON_NAME + '.openURL, url = %s'%url)
+ except urllib2.URLError, e:
+ log("openURL Failed! " + str(e), xbmc.LOGERROR)
+ except socket.timeout, e:
+ log("openURL Failed! " + str(e), xbmc.LOGERROR)
+ except Exception, e:
+ log("openURL Failed! " + str(e), xbmc.LOGERROR)
+ xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30001), ICON, 4000)
+ return ''
+
+
+ def buildMainMenu(self):
+ self.addLink('Live' ,'' ,0)
+ self.addDir('Browse' ,'0',1)
+
+
+ def buildLiveLink(self):
+ soup = BeautifulSoup(self.openURL(LIVEURL), "html.parser")
+ link = 'http:' + soup('div' , {'class': 'live-player'})[0].find('script').get('src')
+ item = json.loads('{'+self.openURL(link).split('}; // end config')[0].split('var jwConfig = {')[1]+'}')
+ self.playVideo('Newsy Live',item['playlist'][0]['sources'][0]['file'])
+
+
+ def pagination(self, seq, rowlen):
+ for start in xrange(0, len(seq), rowlen):
+ yield seq[start:start+rowlen]
+
+
+ def buildRSS(self, start=0, end=9):
+ data = feedparser.parse(RSSURL)['entries']
+ data = list(self.pagination(data, end))
+ start = 0 if start >= len(data) else start
+ for item in data[start]:
+ if item and 'summary_detail' in item:
+ try:
+ path, duration, plot = self.resolveURL(item['links'][0]['href'])
+ thumb = item['summary_detail']['value'].encode("utf-8").split('<img alt="" src="')[1].split('.jpg')[0]+'.jpg'
+ label = item['title']
+ date = item['published']
+ plot = '%s - %s'%(date, plot)
+ aired = (datetime.datetime.strptime(date[0:16], '%a, %d %b %Y')).strftime('%Y-%m-%d')
+ infoLabel = {"mediatype":"video","label":label,"title":label,"plot":plot,"plotoutline":plot,"genre":"News","duration":duration,"aired":aired}
+ infoArt = {"thumb":thumb,"poster":thumb,"icon":ICON,"fanart":FANART}
+ self.addLink(label,path,9,infoLabel,infoArt,end)
+ except:
+ log("buildRSS, no video found")
+ start += 1
+ self.addDir('>> Next', '%s'%(start), 1)
+
+
+ def resolveURL(self, url):
+ log('resolveURL, url = ' + str(url))
+ try:
+ cacheResponse = self.cache.get(ADDON_NAME + '.resolveURL, url = %s'%url)
+ if not cacheResponse:
+ soup = BeautifulSoup(self.openURL(url), "html.parser")
+ link = soup('div' , {'class': 'video-container'})[0]
+ item = json.loads(link('div' , {'class': 'video-container'})[0].get('data-video-player'))
+ path = item['file'] if VID_TYPE == 'MP4' else 'http:'+item['stream']
+ rep = path, item['duration']//1000, item['headline']
+ self.cache.set(ADDON_NAME + '.resolveURL, url = %s'%url, rep, expiration=datetime.timedelta(hours=48))
+ return self.cache.get(ADDON_NAME + '.resolveURL, url = %s'%url)
+ except Exception, e:
+ log("resolveURL Failed! " + str(e), xbmc.LOGERROR)
+
+
+ def playVideo(self, name, url, liz=None):
+ log('playVideo')
+ if not liz:
+ liz = xbmcgui.ListItem(name, path=url)
+ xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
+
+
+ def addLink(self, name, u, mode, infoList=False, infoArt=False, total=0):
+ name = name.encode("utf-8")
+ log('addLink, name = ' + name)
+ liz=xbmcgui.ListItem(name)
+ liz.setProperty('IsPlayable', 'true')
+ if infoList == False:
+ liz.setInfo(type="Video", infoLabels={"mediatype":"video","label":name,"title":name,"genre":"News"})
+ else:
+ liz.setInfo(type="Video", infoLabels=infoList)
+
+ if infoArt == False:
+ liz.setArt({'thumb':ICON,'fanart':FANART})
+ else:
+ liz.setArt(infoArt)
+ u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
+ xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,totalItems=total)
+
+
+ def addDir(self, name, u, mode, infoList=False, infoArt=False):
+ name = name.encode("utf-8")
+ log('addDir, name = ' + name)
+ liz=xbmcgui.ListItem(name)
+ liz.setProperty('IsPlayable', 'false')
+ if infoList == False:
+ liz.setInfo(type="Video", infoLabels={"mediatype":"video","label":name,"title":name,"genre":"News"})
+ else:
+ liz.setInfo(type="Video", infoLabels=infoList)
+ if infoArt == False:
+ liz.setArt({'thumb':ICON,'fanart':FANART})
+ else:
+ liz.setArt(infoArt)
+ u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
+ xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
+
+params=getParams()
+try:
+ url=urllib.unquote_plus(params["url"])
+except:
+ url=None
+try:
+ name=urllib.unquote_plus(params["name"])
+except:
+ name=None
+try:
+ mode=int(params["mode"])
+except:
+ mode=None
+
+log("Mode: "+str(mode))
+log("URL : "+str(url))
+log("Name: "+str(name))
+
+if mode==None: Newsy().buildMainMenu()
+elif mode == 0: Newsy().buildLiveLink()
+elif mode == 1: Newsy().buildRSS(int(url))
+elif mode == 9: Newsy().playVideo(name, url)
+
+xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_NONE )
+xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_LABEL )
+xbmcplugin.endOfDirectory(int(sys.argv[1]),cacheToDisc=True) \ No newline at end of file
diff --git a/plugin.video.newsy/resources/settings.xml b/plugin.video.newsy/resources/settings.xml
new file mode 100644
index 0000000..b1bea3b
--- /dev/null
+++ b/plugin.video.newsy/resources/settings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<settings>
+ <setting id="Enable_Debugging" type="bool" label="30000" default="false" />
+ <setting id="Video_Type" type="enum" label="30002" default="0" values="M3U8|MP4" />
+</settings>
diff --git a/plugin.video.nfl.gamepass/README.md b/plugin.video.nfl.gamepass/README.md
index 861a333..3ae1335 100644
--- a/plugin.video.nfl.gamepass/README.md
+++ b/plugin.video.nfl.gamepass/README.md
@@ -1,5 +1,15 @@
+# NOTE #
+
+NFL Game Pass has split into two services: Game Pass Europe and Game Pass
+International.
+
+This addon currently only supports Game Pass Europe. However, we are very
+interested in supporting Game Pass International. If you're a Python developer
+with a Game Pass International subscription and are interested in helping out,
+check out issue #313. It'd be great to get those subscriptions working again.
+
# NFL Game Pass Kodi Plugin #
-**version 0.10.2 — Daunte Culpepper Edition**
+**version 0.11.1 — Kenny Easley Edition**
Before reading any further, please understand that this addon is unofficial and
is not endorsed or supported by the NFL in any way. Not all features are
@@ -12,37 +22,36 @@ request. Patches and (constructive) input are always welcome.
## Any Dependencies? ##
-This addon requires Kodi Krypton or later. The latest version supporting Jarvis
-was 0.9.2.
+This addon requires Kodi Krypton or later.
This addon is available from the official Kodi repository, and when installed
from there, all dependencies are installed automatically. However, if you're
installing directly from the source, make sure the following dependencies are
installed:
- * xmltodict (http://mirrors.kodi.tv/addons/jarvis/script.module.xmltodict/)
* Requests 2.x (http://mirrors.kodi.tv/addons/jarvis/script.module.requests/)
* m3u8 >= 0.2.10 (http://mirrors.kodi.tv/addons/jarvis/script.module.m3u8/)
* which needs iso8601 (http://mirrors.kodi.tv/addons/jarvis/script.module.iso8601/)
## What is NFL Game Pass? ##
-NFL Game Pass is website that allows those with subscriptions to watch NFL
-games. Archives of old games stretch back to 2009, coaches film (22 man view) is
-available, as is audio from each team's radio network. Overall, it is a sweet
-service offered by the NFL for those of us who must have our American Football
-fix.
+NFL Game Pass is service that allows those with subscriptions to watch NFL
+games. Live games, archives of old games, NFL TV shows, NFL Network, and coaches
+tape (22 man view) are available. Overall, it is a sweet service offered by the
+NFL for those of us who must have our American Football fix.
-## What is Game Pass Domestic? ##
+## What is Game Pass Europe? ##
-NFL Game Pass Domestic is the USA (and parts of Canada and UK) version of Game
-Pass, but the service is blacked out during live games. Previously it lacked
-other features, but with the mid-2015 revamping of their service, it seems the
-two services have mostly converged (though we have yet to find a side-by-side
-comparison).
+Game Pass Europe uses WPP/Bruin as its streaming provider(s), and is currently
+the only service this addon supports.
-As most/all of the current developers are located outside of the Domestic
-regions, testing, bug reports, and patches from Game Pass Domestic subscribers
-is most appreciated.
+## What is Game Pass International? ##
+
+Game Pass International uses NeuLion as its streaming partner.
+
+As all of the current developers are located outside of the "International"
+regions, testing, bug reports, and patches from Game Pass International
+subscribers is most appreciated. Please checkout issue #313 if you're interested
+in helping out.
## Why write a plugin for Kodi? ##
@@ -54,11 +63,12 @@ to watch a game, nothing else.
## What features are currently supported? ##
+With the 2017 split of Game Pass's service, this list is out of date.
+
By now, most core features are supported.
- * Archived games from 2011 to 2014 (both full and condensed)
+ * Archived games from 2016 forward
* Live games
- * Coaches Film (22 man view)
* NFL Network - Live
* A Football Life
* NFL Films Presents
@@ -72,21 +82,11 @@ By now, most core features are supported.
* NFL Total Access
Currently unsupported features:
- * Archived games prior to 2011
- * Alternate team audio
- * Coaches Show
+ * Coaches Film (22 man view)
+ * Game Pass International
## Release names ##
Want a release to be named after your player/coach of choice? Contribute to the
project in some way (code, art, debugging, beer, brazen — yet effective —
flattery, etc), and we'll gladly name a future release after them.
-
-## Roadmap ##
-
-A rough roadmap follows:
-
-* Continue work towards feature completeness
-* Stabilize Game Pass Domestic support
-* Testing
-* Code cleanup
diff --git a/plugin.video.nfl.gamepass/addon.xml b/plugin.video.nfl.gamepass/addon.xml
index 268012b..3bb654c 100644
--- a/plugin.video.nfl.gamepass/addon.xml
+++ b/plugin.video.nfl.gamepass/addon.xml
@@ -5,33 +5,33 @@
marooned on an old version. -->
<addon id="plugin.video.nfl.gamepass"
name="NFL Game Pass"
- version="0.10.2"
- provider-name="Alexqw,divingmule,BaumSchorle,eriksoderblom">
+ version="0.11.1"
+ provider-name="Alexqw,divingmule,BaumSchorle,eriksoderblom,kaileu,emilsvennesson">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
<import addon="script.module.m3u8" version="0.2.10"/>
<import addon="script.module.requests" version="2.7.0"/>
- <import addon="script.module.xmltodict" version="0.9.0"/>
<import addon="xbmc.gui" version="5.12.0"/>
</requires>
<extension point="xbmc.python.script" library="default.py">
<provides>video</provides>
</extension>
<extension point="xbmc.addon.metadata">
- <summary lang="en">NFL Game Pass</summary>
- <description lang="en">Watch NFL Game Pass streams.</description>
+ <summary lang="en_GB">NFL Game Pass</summary>
+ <description lang="en_GB">Watch NFL Game Pass streams.</description>
<platform>all</platform>
<language>en</language>
<license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license>
<source>https://github.com/aqw/xbmc-gamepass</source>
<forum></forum>
- <disclaimer lang="en">This addon requires you to have a subscription to NFL Game Pass.[CR]Please note that these subscriptions are region restricted by the NFL.[CR]This addon is completely unofficial and is /not/ endorsed by the NFL in any way.</disclaimer>
- <news>2017.06.23 v0.10.2 -- Daunte Culpepper Edition
- + Temporarily fix addon crashing (emilsvennesson)
- + GamePass is moving to a new streaming partner. The old service will work
- + until July 31st. This fix points to the old service, and buys us time to
- + update everything for the new service.
- + Fix fanart not loading (emilsvennesson)
+ <disclaimer lang="en_GB">This addon requires you to have a subscription to NFL Game Pass.[CR]Please note that these subscriptions are region restricted by the NFL.[CR]This addon is completely unofficial and is /not/ endorsed by the NFL in any way.</disclaimer>
+ <news>2017.08.24 v0.11.1 -- Kenny Easley Edition
+ + Fix "everything is broken"; Game Pass broke their API again (emilsvennesson)
+ + Add groundwork for what will become a Team View (kaileu)
+ + Open Settings when login info is missing (pyrocumulus)
+ + Restore show/episode thumbnails (emilsvennesson)
+ + Updated German translation (sieversMartin)
+ + Code cleanup (emilsvennesson)
</news>
<assets>
<icon>resources/art/icon.png</icon>
diff --git a/plugin.video.nfl.gamepass/changelog.txt b/plugin.video.nfl.gamepass/changelog.txt
index 5385d57..774c7bc 100644
--- a/plugin.video.nfl.gamepass/changelog.txt
+++ b/plugin.video.nfl.gamepass/changelog.txt
@@ -1,3 +1,21 @@
+2017.08.24 v0.11.1 -- Kenny Easley Edition
++ Fix "everything is broken"; Game Pass broke their API again (emilsvennesson)
++ Add groundwork for what will become a Team View (kaileu)
++ Open Settings when login info is missing (pyrocumulus)
++ Restore show/episode thumbnails (emilsvennesson)
++ Updated German translation (sieversMartin)
++ Code cleanup (emilsvennesson)
+
+2017.08.17 v0.11.0 -- Jay Cutler Edition
++ NOTE: This addon currently does not support Game Pass International.
++ NOTE: Game Pass Europe moved to a new streaming partner. Not all features
++ are available yet or supported.
++ Support for Game Pass Europe (kaileu and emilsvennesson)
++ Updated Dutch translation (pyrocumulus)
++ Optional support for inputstream.adaptive plugin (but, contrary to the name,
++ no support yet for adaptive streaming)
++ Lots of cleanup (emilsvennesson, aqw, pyrocumulus)
+
2017.06.23 v0.10.2 -- Daunte Culpepper Edition
+ Temporarily fix addon crashing (emilsvennesson)
+ GamePass is moving to a new streaming partner. The old service will work
diff --git a/plugin.video.nfl.gamepass/default.py b/plugin.video.nfl.gamepass/default.py
index 7950cf9..7cb98d6 100644
--- a/plugin.video.nfl.gamepass/default.py
+++ b/plugin.video.nfl.gamepass/default.py
@@ -2,12 +2,10 @@
"""
A Kodi addon/skin for NFL Game Pass
"""
-import calendar
-from datetime import datetime
-import os
import sys
-import time
+import json
from traceback import format_exc
+from datetime import timedelta
import xbmc
import xbmcaddon
@@ -22,10 +20,11 @@ ADDON_PATH = xbmc.translatePath(addon.getAddonInfo('path'))
ADDON_PROFILE = xbmc.translatePath(addon.getAddonInfo('profile'))
LOGGING_PREFIX = '[%s-%s]' % (addon.getAddonInfo('id'), addon.getAddonInfo('version'))
+busydialog = xbmcgui.DialogBusy()
+
if not xbmcvfs.exists(ADDON_PROFILE):
xbmcvfs.mkdir(ADDON_PROFILE)
-cookie_file = os.path.join(ADDON_PROFILE, 'cookie_file')
username = addon.getSetting('email')
password = addon.getSetting('password')
@@ -43,7 +42,7 @@ if addon.getSetting('proxy_enabled') == 'true':
if addon.getSetting('proxy_auth') == 'false':
proxy_config['auth'] = None
-gp = pigskin(proxy_config, cookie_file=cookie_file, debug=True)
+gp = pigskin(proxy_config, debug=True)
def addon_log(string):
@@ -51,6 +50,17 @@ def addon_log(string):
xbmc.log(msg=msg, level=xbmc.LOGDEBUG)
+def show_busy_dialog():
+ busydialog.create()
+
+
+def hide_busy_dialog():
+ try:
+ busydialog.close()
+ except RuntimeError, e:
+ addon_log('Error closing busy dialog: %s' % e.message)
+
+
class GamepassGUI(xbmcgui.WindowXML):
def __init__(self, *args, **kwargs):
self.season_list = None
@@ -71,6 +81,7 @@ class GamepassGUI(xbmcgui.WindowXML):
self.list_refill = False
self.focusId = 100
self.seasons_and_weeks = gp.get_seasons_and_weeks()
+ self.has_inputstream_adaptive = self.has_inputstream_adaptive()
xbmcgui.WindowXML.__init__(self, *args, **kwargs)
self.action_previous_menu = (9, 10, 92, 216, 247, 257, 275, 61467, 61448)
@@ -82,9 +93,6 @@ class GamepassGUI(xbmcgui.WindowXML):
self.games_list = self.window.getControl(230)
self.live_list = self.window.getControl(240)
- if gp.subscription == 'domestic':
- self.window.setProperty('domestic', 'true')
-
if self.list_refill:
self.season_list.reset()
self.season_list.addItems(self.season_items)
@@ -98,7 +106,7 @@ class GamepassGUI(xbmcgui.WindowXML):
self.window.setProperty('NW_clicked', 'false')
self.window.setProperty('GP_clicked', 'false')
- xbmc.executebuiltin("Dialog.Close(busydialog)")
+ hide_busy_dialog()
try:
self.setFocus(self.window.getControl(self.focusId))
@@ -127,7 +135,7 @@ class GamepassGUI(xbmcgui.WindowXML):
"""List seasons"""
self.season_items = []
# sort so that years are first (descending) followed by text
- for season in sorted(gp.nflnSeasons, key=lambda x: (x[0].isdigit(), x), reverse=True):
+ for season in sorted(gp.nfln_seasons, key=lambda x: (x[0].isdigit(), x), reverse=True):
listitem = xbmcgui.ListItem(season)
self.season_items.append(listitem)
@@ -146,128 +154,68 @@ class GamepassGUI(xbmcgui.WindowXML):
def display_weeks_games(self):
"""Show games for a given season/week"""
self.games_items = []
- games = gp.get_weeks_games(self.selected_season, self.selected_week)
+ games = gp.get_weeks_games(self.selected_season, self.selected_season_type, self.selected_week)
+ for game in games:
+ game_id = '{0}-{1}-{2}'.format(game['visitorNickName'].lower(), game['homeNickName'].lower(), str(game['gameId']))
+ game_name_shrt = '[B]%s[/B] at [B]%s[/B]' % (game['visitorNickName'], game['homeNickName'])
+ game_name_full = '[B]%s %s[/B] at [B]%s %s[/B]' % (game['visitorCityState'], game['visitorNickName'], game['homeCityState'], game['homeNickName'])
+ listitem = xbmcgui.ListItem(game_name_shrt, game_name_full)
+
+ listitem.setProperty('is_game', 'true')
+ listitem.setProperty('is_show', 'false')
+
+ if game['phase'] == 'FINAL' or game['phase'] == 'FINAL_OVERTIME':
+ # show game duration only if user wants to see it
+ if addon.getSetting('hide_game_length') == 'false' and game['video']:
+ game_info = '%s [CR] Duration: %s' % (game['phase'], str(timedelta(seconds=int(float(game['video']['videoDuration'])))))
+ else:
+ game_info = game['phase']
+ else:
+ if addon.getSetting('time_notation') == '0': # 12-hour clock
+ datetime_format = '%A, %b %d - %I:%M %p'
+ else: # 24-hour clock
+ datetime_format = '%A, %b %d - %H:%M'
- date_time_format = '%Y-%m-%dT%H:%M:%S.000'
- if games:
- for game in games:
- if game['homeTeam']['id'] is None: # sometimes the first item is empty
- continue
+ datetime_obj = gp.parse_datetime(game['gameDateTimeUtc'], True)
+ game_info = datetime_obj.strftime(datetime_format)
- game_info = ''
- game_id = game['id']
- game_versions = []
+ if game['videoStatus'] == 'SCHEDULED':
+ isPlayable = 'false'
+ isBlackedOut = 'false'
+ elif game['videoStatus'] == 'LIVE':
+ game_info += '[CR]» Live «'
+ video_id = str(game['video']['videoId'])
+ isPlayable = 'true'
+ isBlackedOut = 'false'
+ listitem.setProperty('live_video_id', video_id)
+ else: # ONDEMAND
isPlayable = 'true'
isBlackedOut = 'false'
- home_team = game['homeTeam']
- away_team = game['awayTeam']
-
- # Pro-bowl doesn't have a team "name" only a team city, which is the
- # team name... wtf
- if game['homeTeam']['name'] is None:
- game_name_shrt = '[B]%s[/B] at [B]%s[/B]' % (away_team['city'], home_team['city'])
- game_name_full = game_name_shrt
- else:
- game_name_shrt = '[B]%s[/B] at [B]%s[/B]' % (away_team['name'], home_team['name'])
- game_name_full = '[B]%s %s[/B] at [B]%s %s[/B]' % (away_team['city'], away_team['name'], home_team['city'], home_team['name'])
-
- for key, value in {'Condensed': 'condensedId', 'Full': 'programId'}.items():
- if value in game:
- game_versions.append(key)
-
- if 'isLive' in game:
- game_versions.append('Live')
-
- if 'gameEndTimeGMT' in game:
- # Show game duration only if user wants to see it
- if addon.getSetting('hide_game_length') == 'false':
- try:
- start_time = datetime(*(time.strptime(game['gameTimeGMT'], date_time_format)[0:6]))
- end_time = datetime(*(time.strptime(game['gameEndTimeGMT'], date_time_format)[0:6]))
- game_info = 'Final [CR] Duration: %s' % time.strftime('%H:%M:%S', time.gmtime((end_time - start_time).seconds))
- except:
- addon_log(format_exc())
- if 'result' in game:
- game_info = 'Final'
- else:
- game_info = 'Final'
- else:
- if 'isLive' in game:
- game_info = '» Live «'
-
- try:
- if addon.getSetting('local_tz') == '0': # don't localize
- game_datetime = datetime(*(time.strptime(game['date'], date_time_format)[0:6]))
- game_info = game_datetime.strftime('%A, %b %d - %I:%M %p')
- else:
- game_gmt = time.strptime(game['gameTimeGMT'], date_time_format)
- secs = calendar.timegm(game_gmt)
- game_local = time.localtime(secs)
-
- if addon.getSetting('local_tz') == '1': # localize and use 12-hour clock
- game_info = time.strftime('%A, %b %d - %I:%M %p', game_local)
- else: # localize and use 24-hour clock
- game_info = time.strftime('%A, %b %d - %H:%M', game_local)
- except: # all else fails, just use their raw date value
- game_datetime = game['date'].split('T')
- game_info = game_datetime[0] + '[CR]' + game_datetime[1].split('.')[0] + ' ET'
-
- if 'hasProgram' not in game: # if subscription doesn't allow
- isPlayable = 'false'
- game_name_full = self.coloring(game_name_full, "disabled")
- game_name_shrt = self.coloring(game_name_shrt, "disabled")
- game_info = self.coloring(game_info, "disabled-info")
-
- try:
- if game['blocked'] == 'true':
- isPlayable = 'false'
- isBlackedOut = 'true'
- game_info = '» Blacked Out «'
- game_name_full = self.coloring(game_name_full, "disabled")
- game_name_shrt = self.coloring(game_name_shrt, "disabled")
- game_info = self.coloring(game_info, "disabled-info")
- except KeyError:
- pass
-
- listitem = xbmcgui.ListItem(game_name_shrt, game_name_full)
- listitem.setProperty('away_thumb', 'http://i.nflcdn.com/static/site/7.4/img/logos/teams-matte-144x96/%s.png' % away_team['id'])
- listitem.setProperty('home_thumb', 'http://i.nflcdn.com/static/site/7.4/img/logos/teams-matte-144x96/%s.png' % home_team['id'])
- listitem.setProperty('game_info', game_info)
- listitem.setProperty('is_game', 'true')
- listitem.setProperty('is_show', 'false')
- listitem.setProperty('isPlayable', isPlayable)
- listitem.setProperty('isBlackedOut', isBlackedOut)
- listitem.setProperty('game_id', game_id)
- listitem.setProperty('game_date', game['date'].split('T')[0])
- listitem.setProperty('game_versions', ' '.join(game_versions))
- self.games_items.append(listitem)
-
- self.games_list.addItems(self.games_items)
- else:
- dialog = xbmcgui.Dialog()
- dialog.ok(language(30021), language(30046))
+ listitem.setProperty('isPlayable', isPlayable)
+ listitem.setProperty('isBlackedOut', isBlackedOut)
+ listitem.setProperty('game_id', game_id)
+ listitem.setProperty('game_info', game_info)
+ listitem.setProperty('away_thumb', 'http://i.nflcdn.com/static/site/7.4/img/logos/teams-matte-144x96/%s.png' % game['visitorTeamAbbr'])
+ listitem.setProperty('home_thumb', 'http://i.nflcdn.com/static/site/7.4/img/logos/teams-matte-144x96/%s.png' % game['homeTeamAbbr'])
+ self.games_items.append(listitem)
+ self.games_list.addItems(self.games_items)
def display_seasons_weeks(self):
"""List weeks for a given season"""
- weeks = self.seasons_and_weeks[self.selected_season]
+ weeks_dict = self.seasons_and_weeks[self.selected_season]
- for week_code, week in sorted(weeks.iteritems()):
+ for week in weeks_dict:
+ if week['week_name'] == 'p':
+ title = language(30047).format(week['week_number'])
+ elif week['week_name'] == 'week':
+ title = language(30048).format(week['week_number'])
+ else:
+ title = week['week_name'].upper()
future = 'false'
- try:
- # convert EST to GMT by adding 6 hours
- week_date = week['@start'] + ' 06:00'
- # avoid super annoying bug http://forum.kodi.tv/showthread.php?tid=112916
- week_datetime = datetime(*(time.strptime(week_date, '%Y%m%d %H:%M')[0:6]))
- now_datetime = datetime.utcnow()
-
- if week_datetime > now_datetime:
- future = 'true'
- except KeyError: # some old seasons don't provide week dates
- pass
-
- listitem = xbmcgui.ListItem(week['@label'].title())
- listitem.setProperty('week_code', week_code)
+ listitem = xbmcgui.ListItem(title)
+ listitem.setProperty('week', week['week_number'])
+ listitem.setProperty('season_type', week['season_type'])
listitem.setProperty('future', future)
self.weeks_items.append(listitem)
self.weeks_list.addItems(self.weeks_items)
@@ -275,29 +223,32 @@ class GamepassGUI(xbmcgui.WindowXML):
def display_shows_episodes(self, show_name, season):
"""Show episodes for a given season/show"""
self.games_items = []
- items = gp.get_shows_episodes(show_name, season)
+ episodes = gp.get_shows_episodes(show_name, season)
- for i in items:
+ for episode in episodes:
try:
listitem = xbmcgui.ListItem('[B]%s[/B]' % show_name)
- listitem.setProperty('game_info', i['name'])
- listitem.setProperty('away_thumb', gp.image_url + i['image'])
- listitem.setProperty('url', i['publishPoint'])
- listitem.setProperty('id', i['id'])
- listitem.setProperty('type', i['type'])
+ listitem.setProperty('game_info', episode['title'])
+ listitem.setProperty('id', episode['videoId'])
listitem.setProperty('is_game', 'false')
listitem.setProperty('is_show', 'true')
listitem.setProperty('isPlayable', 'true')
+ listitem.setProperty('away_thumb', episode['videoThumbnail']['templateUrl'].replace('{formatInstructions}', 'c_thumb,q_auto,f_png'))
self.games_items.append(listitem)
except:
addon_log('Exception adding archive directory: %s' % format_exc())
- addon_log('Directory name: %s' % i['name'])
+ addon_log('Directory name: %s' % episode['title'])
self.games_list.addItems(self.games_items)
def play_url(self, url):
- xbmc.executebuiltin("Dialog.Close(busydialog)")
+ hide_busy_dialog()
self.list_refill = True
- xbmc.Player().play(url)
+ playitem = xbmcgui.ListItem(path=url)
+ if self.has_inputstream_adaptive and addon.getSetting('use_inputstream_adaptive') == 'true':
+ playitem.setProperty('inputstreamaddon', 'inputstream.adaptive')
+ playitem.setProperty('inputstream.adaptive.manifest_type', 'hls')
+ playitem.setProperty('inputstream.adaptive.stream_headers', url.split('|')[1])
+ xbmc.Player().play(item=url, listitem=playitem)
def init(self, level):
if level == 'season':
@@ -334,9 +285,9 @@ class GamepassGUI(xbmcgui.WindowXML):
"""
options = []
for bitrate in bitrates:
- options.append(bitrate + ' Kbps')
+ options.append(str(bitrate) + ' Kbps')
dialog = xbmcgui.Dialog()
- xbmc.executebuiltin("Dialog.Close(busydialog)")
+ hide_busy_dialog()
ret = dialog.select(language(30003), options)
if ret > -1:
return bitrates[ret]
@@ -346,7 +297,7 @@ class GamepassGUI(xbmcgui.WindowXML):
def select_bitrate(self, manifest_bitrates=None):
"""Returns a bitrate, while honoring the user's /preference/."""
bitrate_setting = int(addon.getSetting('preferred_bitrate'))
- bitrate_values = ['4500', '3000', '2400', '1600', '1200', '800', '400']
+ bitrate_values = ['3671533', '2394274', '1577316', '1117771', '760027', '555799', '402512']
highest = False
preferred_bitrate = None
@@ -372,33 +323,71 @@ class GamepassGUI(xbmcgui.WindowXML):
return self.ask_bitrate(bitrate_values)
def select_version(self, game_versions):
- """Returns a game version, while honoring the user's /preference/.
- Note: the full version is always available but not always the condensed.
- """
+ """Selects a game version and returns the video ID while honoring the user's /preference/."""
preferred_version = int(addon.getSetting('preferred_game_version'))
+ if preferred_version == 0:
+ selected_version = 'Game video'
+ elif preferred_version == 1:
+ selected_version = 'Condensed game'
+ elif preferred_version == 2:
+ selected_version = 'Coach film'
+ else:
+ selected_version = None
# user wants to be asked to select version
- if preferred_version == 2:
- versions = [language(30014)]
- if 'Condensed' in game_versions:
- versions.append(language(30015))
- if 'Coach' in game_versions:
- versions.append(language(30032))
+ # bring up selection when preferred game version is unavailable
+ if not selected_version or selected_version not in game_versions:
+ versions = game_versions.keys()
dialog = xbmcgui.Dialog()
- xbmc.executebuiltin("Dialog.Close(busydialog)")
- preferred_version = dialog.select(language(30016), versions)
-
- if preferred_version == 1 and 'Condensed' in game_versions:
- game_version = 'condensed'
- elif preferred_version == 2 and 'Coach' in game_versions:
- game_version = 'coach'
+ hide_busy_dialog()
+ answer = dialog.select(language(30016), versions)
+ if answer > -1:
+ selected_version = versions[answer]
+ addon_log('Selected version: %s' % selected_version)
+ else:
+ addon_log('Select version dialog was cancelled.')
+ return None
+
+ return game_versions[selected_version]
+
+ def has_inputstream_adaptive(self):
+ """Checks if InputStream Adaptive is installed and enabled."""
+ payload = {
+ 'jsonrpc': '2.0',
+ 'id': 1,
+ 'method': 'Addons.GetAddonDetails',
+ 'params': {
+ 'addonid': 'inputstream.adaptive',
+ 'properties': ['enabled']
+ }
+ }
+ response = xbmc.executeJSONRPC(json.dumps(payload))
+ data = json.loads(response)
+ if 'error' not in data and data['result']['addon']['enabled']:
+ addon_log('InputStream Adaptive is installed and enabled.')
+ return True
else:
- game_version = 'archive'
-
- if preferred_version > -1:
- return game_version
+ addon_log('InputStream Adaptive is not installed and/or enabled.')
+ if addon.getSetting('use_inputstream_adaptive') == 'true':
+ addon_log('Disabling InputStream Adaptive.')
+ addon.setSetting('use_inputstream_adaptive', 'false') # reset setting
+ return False
+
+ def select_stream_url(self, streams):
+ """Determine which stream URL to use from the dict."""
+ if streams:
+ if addon.getSetting('use_inputstream_adaptive') == 'true' and self.has_inputstream_adaptive:
+ stream_url = streams['manifest_url']
+ else:
+ bitrate = self.select_bitrate(streams['bitrates'].keys())
+ if bitrate:
+ stream_url = streams['bitrates'][bitrate]
+ else: # bitrate dialog was canceled
+ return None
+ return stream_url
else:
- return None
+ addon_log('streams dictionary was empty.')
+ return False
def onFocus(self, controlId): # pylint: disable=invalid-name
# save currently focused list
@@ -407,7 +396,7 @@ class GamepassGUI(xbmcgui.WindowXML):
def onClick(self, controlId): # pylint: disable=invalid-name
try:
- xbmc.executebuiltin("ActivateWindow(busydialog)")
+ show_busy_dialog()
if controlId in [110, 120, 130]:
self.games_list.reset()
self.weeks_list.reset()
@@ -427,8 +416,9 @@ class GamepassGUI(xbmcgui.WindowXML):
# display games of current week for usability purposes
cur_s_w = gp.get_current_season_and_week()
- self.selected_season = cur_s_w.keys()[0]
- self.selected_week = cur_s_w.values()[0]
+ self.selected_season = cur_s_w['season']
+ self.selected_season_type = cur_s_w['season_type']
+ self.selected_week = cur_s_w['week']
self.display_seasons()
try:
@@ -451,7 +441,7 @@ class GamepassGUI(xbmcgui.WindowXML):
self.live_list.addItems(self.live_items)
self.display_nfln_seasons()
- xbmc.executebuiltin("Dialog.Close(busydialog)")
+ hide_busy_dialog()
return
if self.main_selection == 'GamePass':
@@ -462,55 +452,29 @@ class GamepassGUI(xbmcgui.WindowXML):
self.display_seasons_weeks()
elif controlId == 220: # week is clicked
self.init('week/show')
- self.selected_week = self.weeks_list.getSelectedItem().getProperty('week_code')
+ self.selected_week = self.weeks_list.getSelectedItem().getProperty('week')
+ self.selected_season_type = self.weeks_list.getSelectedItem().getProperty('season_type')
self.display_weeks_games()
elif controlId == 230: # game is clicked
- selectedGame = self.games_list.getSelectedItem()
- if selectedGame.getProperty('isPlayable') == 'true':
+ selected_game = self.games_list.getSelectedItem()
+ if selected_game.getProperty('isPlayable') == 'true':
self.init('game/episode')
- game_id = selectedGame.getProperty('game_id')
- game_versions = selectedGame.getProperty('game_versions')
-
- if 'Live' in game_versions:
- if 'Final' in selectedGame.getProperty('game_info'):
- game_version = self.select_version(game_versions)
- if game_version == 'archive':
- game_version = 'dvr'
- else:
- game_version = 'live'
+ game_id = selected_game.getProperty('game_id')
+
+ if selected_game.getProperty('live_video_id'):
+ video_id = selected_game.getProperty('live_video_id')
else:
- # Check for coaches film availability
- if gp.check_for_coachestape(game_id, self.selected_season):
- game_versions = game_versions + ' Coach'
-
- game_version = self.select_version(game_versions)
- if game_version:
- if game_version == 'coach':
- xbmc.executebuiltin("ActivateWindow(busydialog)")
- coachesItems = []
- game_date = selectedGame.getProperty('game_date').replace('-', '/')
- self.playBackStop = False
-
- play_stream = gp.get_coaches_url(game_id, game_date, 'dummy')
- plays = gp.get_coaches_playIDs(game_id, self.selected_season)
- for playID in sorted(plays, key=int):
- cf_url = str(play_stream).replace('dummy', playID)
- item = xbmcgui.ListItem(plays[playID])
- item.setProperty('url', cf_url)
- coachesItems.append(item)
-
- self.list_refill = True
- xbmc.executebuiltin("Dialog.Close(busydialog)")
- coachGui = CoachesFilmGUI('script-gamepass-coach.xml', ADDON_PATH, plays=coachesItems)
- coachGui.doModal()
- del coachGui
- else:
- game_streams = gp.get_publishpoint_streams(game_id, 'game', game_version)
- bitrate = self.select_bitrate(game_streams.keys())
- if bitrate:
- game_url = game_streams[bitrate]
- self.play_url(game_url)
+ game_versions = gp.get_game_versions(game_id, self.selected_season)
+ video_id = self.select_version(game_versions)
+
+ if video_id:
+ stream_url = self.select_stream_url(gp.get_stream(video_id, 'game', username=username))
+ if stream_url:
+ self.play_url(stream_url)
+ elif stream_url is False:
+ dialog = xbmcgui.Dialog()
+ dialog.ok(language(30043), language(30045))
elif self.main_selection == 'NFL Network':
if controlId == 210: # season is clicked
@@ -526,41 +490,31 @@ class GamepassGUI(xbmcgui.WindowXML):
elif controlId == 230: # episode is clicked
self.init('game/episode')
video_id = self.games_list.getSelectedItem().getProperty('id')
- video_streams = gp.get_publishpoint_streams(video_id, 'video')
- if video_streams:
- addon_log('Video-Streams: %s' % video_streams)
- bitrate = self.select_bitrate(video_streams.keys())
- if bitrate:
- video_url = video_streams[bitrate]
- self.play_url(video_url)
- else:
+ episode_stream_url = self.select_stream_url(gp.get_stream(video_id, 'video', username=username))
+ if episode_stream_url:
+ self.play_url(episode_stream_url)
+ elif episode_stream_url is False:
dialog = xbmcgui.Dialog()
dialog.ok(language(30043), language(30045))
elif controlId == 240: # Live content (though not games)
show_name = self.live_list.getSelectedItem().getLabel()
if show_name == 'NFL RedZone - Live':
- rz_live_streams = gp.get_publishpoint_streams('redzone')
- if rz_live_streams:
- bitrate = self.select_bitrate(rz_live_streams.keys())
- if bitrate:
- rz_live_url = rz_live_streams[bitrate]
- self.play_url(rz_live_url)
- else:
+ rz_stream_url = self.select_stream_url(gp.get_stream('redzone', username=username))
+ if rz_stream_url:
+ self.play_url(rz_stream_url)
+ elif rz_stream_url is False:
dialog = xbmcgui.Dialog()
dialog.ok(language(30043), language(30045))
elif show_name == 'NFL Network - Live':
- nw_live_streams = gp.get_publishpoint_streams('nfl_network')
- if nw_live_streams:
- bitrate = self.select_bitrate(nw_live_streams.keys())
- if bitrate:
- nw_live_url = nw_live_streams[bitrate]
- self.play_url(nw_live_url)
- else:
+ nfln_live_stream = self.select_stream_url(gp.get_stream('nfl_network', username=username))
+ if nfln_live_stream:
+ self.play_url(nfln_live_stream)
+ elif nfln_live_stream is False:
dialog = xbmcgui.Dialog()
dialog.ok(language(30043), language(30045))
- xbmc.executebuiltin("Dialog.Close(busydialog)")
+ hide_busy_dialog()
except Exception: # catch anything that might fail
- xbmc.executebuiltin("Dialog.Close(busydialog)")
+ hide_busy_dialog()
addon_log(format_exc())
dialog = xbmcgui.Dialog()
@@ -573,7 +527,7 @@ class GamepassGUI(xbmcgui.WindowXML):
class CoachesFilmGUI(xbmcgui.WindowXML):
- def __init__(self, xmlFilename, scriptPath, plays, defaultSkin="Default", defaultRes="720p"): # pylint: disable=invalid-name
+ def __init__(self, xmlFilename, scriptPath, plays, defaultSkin='Default', defaultRes='720p'): # pylint: disable=invalid-name
self.playsList = None
self.playsItems = plays
@@ -590,7 +544,7 @@ class CoachesFilmGUI(xbmcgui.WindowXML):
self.playsList.addItems(self.playsItems)
self.setFocus(self.playsList)
url = self.playsList.getListItem(0).getProperty('url')
- xbmc.executebuiltin("Dialog.Close(busydialog)")
+ hide_busy_dialog()
xbmc.executebuiltin('PlayMedia(%s,False,1)' % url)
def onClick(self, controlId): # pylint: disable=invalid-name
@@ -598,22 +552,29 @@ class CoachesFilmGUI(xbmcgui.WindowXML):
url = self.playsList.getSelectedItem().getProperty('url')
xbmc.executebuiltin('PlayMedia(%s,False,1)' % url)
-if __name__ == "__main__":
+if __name__ == '__main__':
addon_log('script starting')
- xbmc.executebuiltin("Dialog.Close(busydialog)")
+ hide_busy_dialog()
+
+ if not username or not password:
+ dialog = xbmcgui.Dialog()
+ answer = dialog.ok(language(30021), language(30050))
+
+ if answer:
+ addon.openSettings()
+ username = addon.getSetting('email')
+ password = addon.getSetting('password')
+ else:
+ sys.exit(0)
try:
gp.login(username, password)
- except gp.LoginFailure as error:
+ except gp.GamePassError as error:
dialog = xbmcgui.Dialog()
- if error.value == 'Game Pass Domestic Blackout':
- addon_log('Game Pass Domestic is in blackout.')
- dialog.ok(language(30021),
- language(30022))
+ if error.value == 'error_unauthorised':
+ dialog.ok(language(30021), language(30023))
else:
- addon_log('login failed')
- dialog.ok(language(30021),
- language(30023))
+ dialog.ok(language(30021), error.value)
sys.exit(0)
except:
addon_log(format_exc())
diff --git a/plugin.video.nfl.gamepass/resources/language/German/strings.po b/plugin.video.nfl.gamepass/resources/language/resource.language.de_de/strings.po
index 19df51e..a51b62d 100644
--- a/plugin.video.nfl.gamepass/resources/language/German/strings.po
+++ b/plugin.video.nfl.gamepass/resources/language/resource.language.de_de/strings.po
@@ -23,7 +23,7 @@ msgstr "Passwort"
msgctxt "#30003"
msgid "Preferred Stream Quality"
-msgstr "Bevorzugte Stream Qualität"
+msgstr "Bevorzugte Streamqualität"
msgctxt "#30004"
msgid "Always Use Highest Bitrate"
@@ -63,7 +63,7 @@ msgstr "Vorher fragen"
msgctxt "#30013"
msgid "Preferred Game Version"
-msgstr "Bevorzugte Spiel Version"
+msgstr "Bevorzugte Spielversion"
msgctxt "#30014"
msgid "Full"
@@ -75,51 +75,51 @@ msgstr "Zusammengefasst"
msgctxt "#30016"
msgid "Choose a game version"
-msgstr "Wähle eine Spiel Version"
+msgstr "Wählen Sie eine Spielversion"
msgctxt "#30020"
-msgid "Date/time in local time"
-msgstr "Uhrzeit in lokaler Zeitzone"
+msgid "Time Notation"
+msgstr "Zeitformat"
msgctxt "#30021"
msgid "Error"
-msgstr ""
+msgstr "Fehler"
msgctxt "#30022"
msgid "Due to broadcast restrictions, NFL Game Pass Domestic is currently unavailable. Please try again later."
-msgstr ""
+msgstr "Aufgrund rechtlicher Einschränkungen steht NFL Game Pass Domestic zur Zeit nicht zur Verfügung. Bitte versuchen Sie es später noch einmal."
msgctxt "#30023"
msgid "Logging into NFL Game Pass failed. Make sure that your account information is correct and your subscription is valid."
-msgstr ""
+msgstr "Einloggen nicht erfolgreich. Bitte stellen Sie sicher, dass Ihre Accountangaben korrekt sind und Ihr Abo gültig ist."
msgctxt "#30024"
-msgid "Unexpected error ='(. Please enable debuging for both the addon and Kodi, and submit a bug report."
-msgstr ""
+msgid "Unexpected error ='(. Please enable debugging in Kodi and submit a bug report."
+msgstr "Unerwarteter Fehler ='(. Bitte schalten Sie den Debugmodus in Kodi ein und melden Sie den Fehler samt Bericht."
msgctxt "#30025"
msgid "Hide game length"
-msgstr ""
+msgstr "Spiellänge nicht anzeigen"
msgctxt "#30026"
msgid "No"
-msgstr ""
+msgstr "Nein"
msgctxt "#30027"
-msgid "Yes, with 12-hour clock (AM/PM)"
-msgstr ""
+msgid "12-hour clock (AM/PM)"
+msgstr "12-Stunden-Uhr (AM/PM)"
msgctxt "#30028"
-msgid "Yes, with 24-hour clock"
-msgstr ""
+msgid "24-hour clock"
+msgstr "24-Stunden-Uhr"
msgctxt "#30029"
msgid "General"
-msgstr ""
+msgstr "Allgemein"
msgctxt "#30030"
msgid "Display/Video"
-msgstr ""
+msgstr "Anzeige"
msgctxt "#30032"
msgid "Coaches Film"
@@ -127,15 +127,15 @@ msgstr ""
msgctxt "#30033"
msgid "Proxy Settings"
-msgstr ""
+msgstr "Proxyeinstellungen"
msgctxt "#30034"
msgid "Use an HTTP proxy to access Game Pass"
-msgstr ""
+msgstr "HTTP-Proxy für Zugang zum Game Pass nutzen"
msgctxt "#30035"
msgid "Protocol"
-msgstr ""
+msgstr "Protokoll"
msgctxt "#30036"
msgid "Server"
@@ -147,20 +147,44 @@ msgstr ""
msgctxt "#30038"
msgid "Username"
-msgstr ""
+msgstr "Benutzername"
msgctxt "#30039"
msgid "Password"
-msgstr ""
+msgstr "Passwort"
msgctxt "#30042"
msgid "Enable 'Basic' Authentication"
-msgstr ""
+msgstr "Schalte 'Basic'-Authentifizierung ein"
msgctxt "#30043"
msgid "There was a problem playing that stream"
-msgstr ""
+msgstr "Es gab ein Problem beim Abspielen des Streams"
msgctxt "#30044"
msgid "Some shows are known to not work. Please file a bug if the show is available and works in the official app."
-msgstr ""
+msgstr "Einige Sendungen laufen leider nicht. Bitte senden Sie einen Bugreport, sofern die Sendung verfügbar ist und in der offiziellen App funktioniert."
+
+msgctxt "#30045"
+msgid "No valid stream URL was found."
+msgstr "Es wurde keine gültige URL für den Stream gefunden."
+
+msgctxt "#30046"
+msgid "There is currently no data available for this week."
+msgstr "Es stehen zur Zeit keine Daten für diese Woche zur Verfügung."
+
+msgctxt "#30047"
+msgid "PRESEASON WEEK {0}"
+msgstr "PRESEASON WOCHE {0}"
+
+msgctxt "#30048"
+msgid "WEEK {0}"
+msgstr "WOCHE {0}"
+
+msgctxt "#30049"
+msgid "Use InputStream Adaptive"
+msgstr "Nutze InputStream Adaptive"
+
+msgctxt "#30050"
+msgid "Please enter the username and password for your NFL Game Pass subscription."
+msgstr "Bitte geben Sie Benutzernamen und Passwort für Ihr NFL Game Pass Abo ein."
diff --git a/plugin.video.nfl.gamepass/resources/language/English/strings.po b/plugin.video.nfl.gamepass/resources/language/resource.language.en_gb/strings.po
index 2303fe4..071b2c9 100644
--- a/plugin.video.nfl.gamepass/resources/language/English/strings.po
+++ b/plugin.video.nfl.gamepass/resources/language/resource.language.en_gb/strings.po
@@ -78,7 +78,7 @@ msgid "Choose a game version"
msgstr ""
msgctxt "#30020"
-msgid "Localize Game Date/Time"
+msgid "Time Notation"
msgstr ""
msgctxt "#30021"
@@ -94,7 +94,7 @@ msgid "Logging into NFL Game Pass failed. Make sure that your account informatio
msgstr ""
msgctxt "#30024"
-msgid "Unexpected error ='(. Please enable debuging for both the addon and Kodi, and submit a bug report."
+msgid "Unexpected error ='(. Please enable debugging in Kodi and submit a bug report."
msgstr ""
msgctxt "#30025"
@@ -106,11 +106,11 @@ msgid "No"
msgstr ""
msgctxt "#30027"
-msgid "Yes, with 12-hour clock (AM/PM)"
+msgid "12-hour clock (AM/PM)"
msgstr ""
msgctxt "#30028"
-msgid "Yes, with 24-hour clock"
+msgid "24-hour clock"
msgstr ""
msgctxt "#30029"
@@ -172,3 +172,19 @@ msgstr ""
msgctxt "#30046"
msgid "There is currently no data available for this week."
msgstr ""
+
+msgctxt "#30047"
+msgid "PRESEASON WEEK {0}"
+msgstr ""
+
+msgctxt "#30048"
+msgid "WEEK {0}"
+msgstr ""
+
+msgctxt "#30049"
+msgid "Use InputStream Adaptive"
+msgstr ""
+
+msgctxt "#30050"
+msgid "Please enter the username and password for your NFL Game Pass subscription."
+msgstr ""
diff --git a/plugin.video.nfl.gamepass/resources/language/Japanese/strings.po b/plugin.video.nfl.gamepass/resources/language/resource.language.ja_jp/strings.po
index fb818fb..55f8ebd 100644
--- a/plugin.video.nfl.gamepass/resources/language/Japanese/strings.po
+++ b/plugin.video.nfl.gamepass/resources/language/resource.language.ja_jp/strings.po
@@ -79,8 +79,8 @@ msgid "Choose a game version"
msgstr "再生バージョン選択"
msgctxt "#30020"
-msgid "Localize Game Date/Time"
-msgstr "現地時間"
+msgid "Time Notation"
+msgstr ""
msgctxt "#30021"
msgid "Error"
@@ -95,7 +95,7 @@ msgid "Logging into NFL Game Pass failed. Make sure that your account informatio
msgstr "NFL Game Passにログインできませんでした。アカウントの確認、または契約が有効か確認ください。"
msgctxt "#30024"
-msgid "Unexpected error ='(. Please enable debuging for both the addon and Kodi, and submit a bug report."
+msgid "Unexpected error ='(. Please enable debugging in Kodi and submit a bug report."
msgstr "予測不可エラー発生 ( T o T ) このアプリとKodiのデバッグを有効にして、バグをレポートしてください。"
msgctxt "#30025"
@@ -107,12 +107,12 @@ msgid "No"
msgstr "いいえ"
msgctxt "#30027"
-msgid "Yes, with 12-hour clock (AM/PM)"
-msgstr "はい、12時間制 (AM/PM)"
+msgid "12-hour clock (AM/PM)"
+msgstr "12時間制 (AM/PM)"
msgctxt "#30028"
-msgid "Yes, with 24-hour clock"
-msgstr "はい、24時間制"
+msgid "24-hour clock"
+msgstr "24時間制"
msgctxt "#30029"
msgid "General"
@@ -165,3 +165,27 @@ msgstr "再生に問題が発生しました"
msgctxt "#30044"
msgid "Some shows are known to not work. Please file a bug if the show is available and works in the official app."
msgstr "再生できない試合があります。公式アプリで再生できる場合、バグをレポートしてください。"
+
+msgctxt "#30045"
+msgid "No valid stream URL was found."
+msgstr ""
+
+msgctxt "#30046"
+msgid "There is currently no data available for this week."
+msgstr ""
+
+msgctxt "#30047"
+msgid "PRESEASON WEEK {0}"
+msgstr ""
+
+msgctxt "#30048"
+msgid "WEEK {0}"
+msgstr ""
+
+msgctxt "#30049"
+msgid "Use InputStream Adaptive"
+msgstr ""
+
+msgctxt "#30050"
+msgid "Please enter the username and password for your NFL Game Pass subscription."
+msgstr ""
diff --git a/plugin.video.nfl.gamepass/resources/language/Dutch/strings.po b/plugin.video.nfl.gamepass/resources/language/resource.language.nl_nl/strings.po
index 9f61d78..19ae8c8 100644
--- a/plugin.video.nfl.gamepass/resources/language/Dutch/strings.po
+++ b/plugin.video.nfl.gamepass/resources/language/resource.language.nl_nl/strings.po
@@ -78,8 +78,8 @@ msgid "Choose a game version"
msgstr "Kies een wedstrijd versie"
msgctxt "#30020"
-msgid "Date/time in local time"
-msgstr "Datum/tijd in lokale tijd"
+msgid "Time Notation"
+msgstr "Tijd Weergave"
msgctxt "#30021"
msgid "Error"
@@ -87,15 +87,15 @@ msgstr "Fout"
msgctxt "#30022"
msgid "Due to broadcast restrictions, NFL Game Pass Domestic is currently unavailable. Please try again later."
-msgstr "Vanwege uitzend beperkingen, NFL Game Pass Domestic is momenteel niet beschikbaar. Probeer het later opnieuw."
+msgstr "Vanwege uitzendbeperkingen is NFL Game Pass Domestic momenteel niet beschikbaar. Probeer het later opnieuw."
msgctxt "#30023"
msgid "Logging into NFL Game Pass failed. Make sure that your account information is correct and your subscription is valid."
-msgstr "Inloggen in NFL Game Pass mislukt. Zorg ervoor dat uw account informatie correct zijn en uw abonnement geldig is."
+msgstr "Inloggen bij NFL Game Pass is mislukt. Zorg ervoor dat uw accountgegevens correct zijn en uw abonnement geldig is."
msgctxt "#30024"
-msgid "Unexpected error ='(. Please enable debuging for both the addon and Kodi, and submit a bug report."
-msgstr ""
+msgid "Unexpected error ='(. Please enable debugging in Kodi and submit a bug report."
+msgstr "Onverwachte fout ='(. Schakel debug logging in voor zowel de addon als Kodi en verstuur een bug report."
msgctxt "#30025"
msgid "Hide game length"
@@ -106,12 +106,12 @@ msgid "No"
msgstr "Nee"
msgctxt "#30027"
-msgid "Yes, with 12-hour clock (AM/PM)"
-msgstr "Ja, met 12-uurs klok (AM/PM)"
+msgid "12-hour clock (AM/PM)"
+msgstr "12-uurs klok (AM/PM)"
msgctxt "#30028"
-msgid "Yes, with 24-hour clock"
-msgstr "Ja, met 24-uurs klok"
+msgid "24-hour clock"
+msgstr "24-uurs klok"
msgctxt "#30029"
msgid "General"
@@ -127,40 +127,64 @@ msgstr "Coaches Film"
msgctxt "#30033"
msgid "Proxy Settings"
-msgstr ""
+msgstr "Proxy Instellingen"
msgctxt "#30034"
msgid "Use an HTTP proxy to access Game Pass"
-msgstr ""
+msgstr "Gebruik een HTTP proxy om Game Pass te benaderen"
msgctxt "#30035"
msgid "Protocol"
-msgstr ""
+msgstr "Protocol"
msgctxt "#30036"
msgid "Server"
-msgstr ""
+msgstr "Server"
msgctxt "#30037"
msgid "Port"
-msgstr ""
+msgstr "Poort"
msgctxt "#30038"
msgid "Username"
-msgstr ""
+msgstr "Gebruikersnaam"
msgctxt "#30039"
msgid "Password"
-msgstr ""
+msgstr "Wachtwoord"
msgctxt "#30042"
msgid "Enable 'Basic' Authentication"
-msgstr ""
+msgstr "Gebruik 'Eenvoudige' Authenticatie"
msgctxt "#30043"
msgid "There was a problem playing that stream"
-msgstr ""
+msgstr "Er was een probleem bij het afspelen van de stream"
msgctxt "#30044"
msgid "Some shows are known to not work. Please file a bug if the show is available and works in the official app."
msgstr ""
+
+msgctxt "#30045"
+msgid "No valid stream URL was found."
+msgstr "Geen geldige stream URL gevonden."
+
+msgctxt "#30046"
+msgid "There is currently no data available for this week."
+msgstr "Er zijn op dit moment geen gegevens beschikbaar voor deze week."
+
+msgctxt "#30047"
+msgid "PRESEASON WEEK {0}"
+msgstr "VOORSEIZOEN WEEK {0}"
+
+msgctxt "#30048"
+msgid "WEEK {0}"
+msgstr "WEEK {0}"
+
+msgctxt "#30049"
+msgid "Use InputStream Adaptive"
+msgstr "Gebruik Inputstream Adaptive"
+
+msgctxt "#30050"
+msgid "Please enter the username and password for your NFL Game Pass subscription."
+msgstr "Vul de gebruikersnaam en wachtwoord in van uw NFL Game Pass abonnement."
diff --git a/plugin.video.nfl.gamepass/resources/language/Russian/strings.po b/plugin.video.nfl.gamepass/resources/language/resource.language.ru_ru/strings.po
index c5c9bfc..426f2d6 100644
--- a/plugin.video.nfl.gamepass/resources/language/Russian/strings.po
+++ b/plugin.video.nfl.gamepass/resources/language/resource.language.ru_ru/strings.po
@@ -78,8 +78,8 @@ msgid "Choose a game version"
msgstr "Выбирать вручную"
msgctxt "#30020"
-msgid "Localize Game Date/Time"
-msgstr "Локализировать время игр"
+msgid "Time Notation"
+msgstr ""
msgctxt "#30021"
msgid "Error"
@@ -94,7 +94,7 @@ msgid "Logging into NFL Game Pass failed. Make sure that your account informatio
msgstr "Не удалось зайти на NFL Game Pass. Убедитесь, что информация про аккаунт верна и ваша подписка действительна."
msgctxt "#30024"
-msgid "Unexpected error ='(. Please enable debuging for both the addon and Kodi, and submit a bug report."
+msgid "Unexpected error ='(. Please enable debugging in Kodi and submit a bug report."
msgstr "Неожиданная ошибка ='(. Пожалуйста включите дебаг для аддона и Kodi и отправьте баг репорт."
msgctxt "#30025"
@@ -106,12 +106,12 @@ msgid "No"
msgstr "Нет"
msgctxt "#30027"
-msgid "Yes, with 12-hour clock (AM/PM)"
-msgstr "Да, 12ч (AM/PM)"
+msgid "12-hour clock (AM/PM)"
+msgstr "12ч (AM/PM)"
msgctxt "#30028"
-msgid "Yes, with 24-hour clock"
-msgstr "Да, 24ч"
+msgid "24-hour clock"
+msgstr "24ч"
msgctxt "#30029"
msgid "General"
@@ -172,3 +172,23 @@ msgstr "Некоторые шоу могут не работать. Пожалу
msgctxt "#30045"
msgid "No valid stream URL was found."
msgstr "Не возможно найти URL для потока."
+
+msgctxt "#30046"
+msgid "There is currently no data available for this week."
+msgstr ""
+
+msgctxt "#30047"
+msgid "PRESEASON WEEK {0}"
+msgstr ""
+
+msgctxt "#30048"
+msgid "WEEK {0}"
+msgstr ""
+
+msgctxt "#30049"
+msgid "Use InputStream Adaptive"
+msgstr ""
+
+msgctxt "#30050"
+msgid "Please enter the username and password for your NFL Game Pass subscription."
+msgstr ""
diff --git a/plugin.video.nfl.gamepass/resources/language/Ukrainian/strings.po b/plugin.video.nfl.gamepass/resources/language/resource.language.uk_ua/strings.po
index 383af0b..0b28a25 100644
--- a/plugin.video.nfl.gamepass/resources/language/Ukrainian/strings.po
+++ b/plugin.video.nfl.gamepass/resources/language/resource.language.uk_ua/strings.po
@@ -78,8 +78,8 @@ msgid "Choose a game version"
msgstr "Вибирати версію гри"
msgctxt "#30020"
-msgid "Localize Game Date/Time"
-msgstr "Локалізувати час гри"
+msgid "Time Notation"
+msgstr ""
msgctxt "#30021"
msgid "Error"
@@ -94,7 +94,7 @@ msgid "Logging into NFL Game Pass failed. Make sure that your account informatio
msgstr "Неможливо увійти до NFL Game Pass. Переконайтесь що інформація про аккаунт корректа і ваша підписка дійсна."
msgctxt "#30024"
-msgid "Unexpected error ='(. Please enable debuging for both the addon and Kodi, and submit a bug report."
+msgid "Unexpected error ='(. Please enable debugging in Kodi and submit a bug report."
msgstr "Неочікувана помилка ='(. Будь ласка ввімкніть дебаг для аддону та Kodi і відправте баг репорт."
msgctxt "#30025"
@@ -106,12 +106,12 @@ msgid "No"
msgstr "Ні"
msgctxt "#30027"
-msgid "Yes, with 12-hour clock (AM/PM)"
-msgstr "Так, 12г (AM/PM)"
+msgid "12-hour clock (AM/PM)"
+msgstr "12г (AM/PM)"
msgctxt "#30028"
-msgid "Yes, with 24-hour clock"
-msgstr "Так, 24г"
+msgid "24-hour clock"
+msgstr "24г"
msgctxt "#30029"
msgid "General"
@@ -172,3 +172,23 @@ msgstr "Деякі шоу можуть не працювати. Будь лас
msgctxt "#30045"
msgid "No valid stream URL was found."
msgstr "Неможливо знайти URL для потоку."
+
+msgctxt "#30046"
+msgid "There is currently no data available for this week."
+msgstr ""
+
+msgctxt "#30047"
+msgid "PRESEASON WEEK {0}"
+msgstr ""
+
+msgctxt "#30048"
+msgid "WEEK {0}"
+msgstr ""
+
+msgctxt "#30049"
+msgid "Use InputStream Adaptive"
+msgstr ""
+
+msgctxt "#30050"
+msgid "Please enter the username and password for your NFL Game Pass subscription."
+msgstr ""
diff --git a/plugin.video.nfl.gamepass/resources/lib/pigskin.py b/plugin.video.nfl.gamepass/resources/lib/pigskin.py
index 96e24de..ac2fe78 100644
--- a/plugin.video.nfl.gamepass/resources/lib/pigskin.py
+++ b/plugin.video.nfl.gamepass/resources/lib/pigskin.py
@@ -2,36 +2,32 @@
A Kodi-agnostic library for NFL Game Pass
"""
import codecs
-import cookielib
-import hashlib
-import random
-import m3u8
-import re
+import uuid
import sys
+import json
+import calendar
+import time
import urllib
-from traceback import format_exc
-from uuid import getnode as get_mac
-from urlparse import urlsplit
+import xml.etree.ElementTree as ET
+from datetime import datetime, timedelta
import requests
-import xmltodict
-
+import m3u8
class pigskin(object):
- def __init__(self, proxy_config, cookie_file, debug=False):
+ def __init__(self, proxy_config, debug=False):
self.debug = debug
- self.subscription = ''
- self.base_url = 'https://gp.nfl.com/nflgp'
- self.servlets_url = 'https://gp.nfl.com/nflgp/servlets'
- self.simpleconsole_url = self.servlets_url + '/simpleconsole'
- self.boxscore_url = ''
- self.image_url = ''
- self.locEDLBaseUrl = ''
- self.non_seasonal_shows = {}
- self.seasonal_shows = {}
- self.nflnSeasons = []
-
+ self.base_url = 'https://www.nflgamepass.com'
+ self.user_agent = 'Firefox'
self.http_session = requests.Session()
+ self.access_token = None
+ self.refresh_token = None
+ self.config = self.make_request(self.base_url + '/api/en/content/v1/web/config', 'get')
+ self.client_id = self.config['modules']['API']['CLIENT_ID']
+ self.nfln_shows = {}
+ self.nfln_seasons = []
+ self.parse_shows()
+
if proxy_config is not None:
proxy_url = self.build_proxy_url(proxy_config)
if proxy_url != '':
@@ -39,44 +35,11 @@ class pigskin(object):
'http': proxy_url,
'https': proxy_url,
}
- self.cookie_jar = cookielib.LWPCookieJar(cookie_file)
- try:
- self.cookie_jar.load(ignore_discard=True, ignore_expires=True)
- except IOError:
- pass
- self.http_session.cookies = self.cookie_jar
-
- # get needed URLs from simpleconsole
- # no auth needed, so we can get this info without invoking a login
- url = self.simpleconsole_url
- post_data = {'isFlex': 'true'}
- sc_data = self.make_request(url=url, method='post', payload=post_data)
- try:
- url_dict = xmltodict.parse(sc_data)
- self.boxscore_url = url_dict['result']['pbpFeedPrefix']
- self.image_url = url_dict['result']['config']['locProgramImage']
- self.locEDLBaseUrl = url_dict['result']['config']['locEDL'].replace('/edl/nflgp/', '')
-
- self.log('boxscore url: %s' % self.boxscore_url)
- self.log('image url: %s' % self.image_url)
- self.log('locEDLBaseUrl: %s' % self.locEDLBaseUrl)
- except xmltodict.expat.ExpatError:
- self.log('Failed to parse contents of the "simpleconsole".')
- self.log('pigskin __init__-ing failed. Time to debug!')
- return None
-
- # get subscription type
- if '<isGPDomestic>' in sc_data:
- self.subscription = 'domestic'
- self.log('NFL Game Pass Domestic detected.')
- else:
- self.subscription = 'international'
- self.log('NFL Game Pass International detected.')
self.log('Debugging enabled.')
self.log('Python Version: %s' % sys.version)
- class LoginFailure(Exception):
+ class GamePassError(Exception):
def __init__(self, value):
self.value = value
@@ -95,6 +58,43 @@ class pigskin(object):
except:
pass
+ def make_request(self, url, method, params=None, payload=None, headers=None):
+ """Make an HTTP request. Return the response."""
+ self.log('Request URL: %s' % url)
+ self.log('Method: %s' % method)
+ if params:
+ self.log('Params: %s' % params)
+ if payload:
+ self.log('Payload: %s' % payload)
+ if headers:
+ self.log('Headers: %s' % headers)
+
+ if method == 'get':
+ req = self.http_session.get(url, params=params, headers=headers)
+ elif method == 'put':
+ req = self.http_session.put(url, params=params, data=payload, headers=headers)
+ else: # post
+ req = self.http_session.post(url, params=params, data=payload, headers=headers)
+ self.log('Response code: %s' % req.status_code)
+ self.log('Response: %s' % req.content)
+
+ return self.parse_response(req)
+
+ def parse_response(self, req):
+ """Try to load JSON data into dict and raise potential errors."""
+ try:
+ response = json.loads(req.content)
+ except ValueError: # if response is not json
+ response = req.content
+
+ if isinstance(response, dict):
+ for key in response.keys():
+ if key.lower() == 'message':
+ if response[key]: # raise all messages as GamePassError if message is not empty
+ raise self.GamePassError(response[key])
+
+ return response
+
def build_proxy_url(self, config):
proxy_url = ''
@@ -129,393 +129,278 @@ class pigskin(object):
return proxy_url
- def check_for_coachestape(self, game_id, season):
- """Return whether coaches tape is available for a given game."""
- url = self.boxscore_url + '/' + season + '/' + game_id + '.xml'
- boxscore = self.make_request(url=url, method='get')
-
- try:
- boxscore_dict = xmltodict.parse(boxscore, encoding='cp1252')
- except xmltodict.expat.ExpatError:
- try:
- boxscore_dict = xmltodict.parse(boxscore)
- except xmltodict.expat.ExpatError:
- return False
-
- try:
- if boxscore_dict['dataset']['@coach'] == 'true':
- return True
- else:
- return False
- except KeyError:
- return False
-
- def check_for_subscription(self):
- """Return whether a subscription and user name are detected. Determines
- whether a login was successful."""
- url = self.simpleconsole_url
- post_data = {'isFlex': 'true'}
- sc_data = self.make_request(url=url, method='post', payload=post_data)
-
- if '</userName>' not in sc_data:
- self.log('No user name detected in Game Pass response.')
- return False
- elif '</subscription>' not in sc_data:
- self.log('No subscription detected in Game Pass response.')
- return False
- else:
- self.log('Subscription and user name detected in Game Pass response.')
- return True
-
- def gen_plid(self):
- """Return a "unique" MD5 hash. Getting the video path requires a plid,
- which looks like MD5 and always changes. Reusing a plid does not work,
- so our guess is that it's a id for each instance of the player.
+ def login(self, username, password):
+ """Blindly authenticate to Game Pass. Use has_subscription() to
+ determine success.
"""
- rand = random.getrandbits(10)
- mac_address = str(get_mac())
- md5 = hashlib.md5(str(rand) + mac_address)
- return md5.hexdigest()
-
- def get_coaches_playIDs(self, game_id, season):
- """Return a dict of play IDs with associated play descriptions."""
- playIDs = {}
- url = self.boxscore_url + '/' + season + '/' + game_id + '.xml'
- boxscore = self.make_request(url=url, method='get')
-
- try:
- boxscore_dict = xmltodict.parse(boxscore, encoding='cp1252')
- except xmltodict.expat.ExpatError:
- try:
- boxscore_dict = xmltodict.parse(boxscore)
- except xmltodict.expat.ExpatError:
- return False
-
- for row in boxscore_dict['dataset']['table']['row']:
- playIDs[row['@PlayID']] = row['@PlayDescription']
+ url = self.config['modules']['API']['LOGIN']
+ post_data = {
+ 'username': username,
+ 'password': password,
+ 'client_id': self.client_id,
+ 'grant_type': 'password'
+ }
+ data = self.make_request(url, 'post', payload=post_data)
+ self.access_token = data['access_token']
+ self.refresh_token = data['refresh_token']
+ self.check_for_subscription()
- return playIDs
+ return True
- def get_coaches_url(self, game_id, game_date, event_id):
- """Return the URL for a coaches-film play."""
- self.get_current_season_and_week() # set cookies
- url = self.servlets_url + '/publishpoint'
+ def check_for_subscription(self):
+ """Returns True if a subscription is detected. Raises error_unauthorised on failure."""
+ url = self.config['modules']['API']['USER_PROFILE']
+ headers = {'Authorization': 'Bearer {0}'.format(self.access_token)}
+ self.make_request(url, 'get', headers=headers)
- post_data = {'id': game_id, 'type': 'game', 'nt': '1', 'gt': 'coach',
- 'event': event_id, 'bitrate': '1600', 'gdate': game_date}
- headers = {'User-Agent': 'iPad'}
- coach_data = self.make_request(url=url, method='post', payload=post_data, headers=headers)
- coach_dict = xmltodict.parse(coach_data)['result']
+ return True
- return coach_dict['path']
+ def refresh_tokens(self):
+ """Refreshes authorization tokens."""
+ url = self.config['modules']['API']['LOGIN']
+ post_data = {
+ 'refresh_token': self.refresh_token,
+ 'client_id': self.client_id,
+ 'grant_type': 'refresh_token'
+ }
+ data = self.make_request(url, 'post', payload=post_data)
+ self.access_token = data['access_token']
+ self.refresh_token = data['refresh_token']
- def get_current_season_and_week(self):
- """Return the current season and week_code (e.g. 210) in a dict."""
- url = self.simpleconsole_url
- post_data = {'isFlex': 'true'}
- sc_data = self.make_request(url=url, method='post', payload=post_data)
+ return True
- sc_dict = xmltodict.parse(sc_data)['result']
- current_s_w = {sc_dict['currentSeason']: sc_dict['currentWeek']}
- return current_s_w
+ def get_seasons_and_weeks(self):
+ """Return a multidimensional array of all seasons and weeks."""
+ seasons_and_weeks = {}
- def parse_shows(self, sc_dict):
- """Parse return from /simpleconsole request to build shows list dynamically"""
try:
- # All (nearly) NFL Network Shows
- show_dict = {}
- for show in sc_dict['nflnShows']['show']:
- name = show['name']
- season_dict = {}
-
- for season in show['seasons']['season']:
- if isinstance(season, dict):
- season_id = season['@catId']
- season_name = season['#text']
- else:
- season_id = show['seasons']['season']['@catId']
- season_name = show['seasons']['season']['#text']
-
- # Trim season name to just the year if year is present
- # Common season names: '2014', 'Season 2014', and 'Archives'
- try:
- season_name = re.findall(r"\d{4}(?!\d)", season_name)[0]
- except IndexError:
- pass
-
- season_dict[season_name] = season_id
-
- if season_name not in self.nflnSeasons:
- self.nflnSeasons.append(season_name)
-
- show_dict[name] = season_dict
-
- # RedZone is "special" and is returned separately in the XML
- rz_dict = {}
- for season in sc_dict['redZoneCats']['cat']:
- rz_dict[season['@season']] = season['@id']
-
- if season['@season'] not in self.nflnSeasons:
- self.nflnSeasons.append(season['@season'])
-
- show_dict['RedZone Archives'] = rz_dict
+ url = self.config['modules']['ROUTES_DATA_PROVIDERS']['games']
+ seasons = self.make_request(url, 'get')
+ except:
+ self.log('Acquiring season and week data failed.')
+ raise
- self.seasonal_shows.update(show_dict)
+ try:
+ for season in seasons['modules']['mainMenu']['seasonStructureList']:
+ weeks = []
+ year = str(season['season'])
+ for season_type in season['seasonTypes']:
+ for week in season_type['weeks']:
+ week_dict = {
+ 'week_number': str(week['number']),
+ 'week_name': week['weekNameAbbr'],
+ 'season_type': season_type['seasonType']
+ }
+ weeks.append(week_dict)
+
+ seasons_and_weeks[year] = weeks
except KeyError:
- self.log('Parsing shows failed')
+ self.log('Parsing season and week data failed.')
raise
- def get_publishpoint_streams(self, video_id, stream_type=None, game_type=None):
- """Return the URL for a stream."""
- streams = {}
- self.get_current_season_and_week() # set cookies
- url = self.servlets_url + '/publishpoint'
-
- if video_id == 'nfl_network':
- post_data = {'id': '1', 'type': 'channel', 'nt': '1'}
- elif video_id == 'redzone':
- post_data = {'id': '2', 'type': 'channel', 'nt': '1'}
- elif stream_type == 'game':
- post_data = {'id': video_id, 'type': stream_type, 'nt': '1', 'gt': game_type}
- else:
- post_data = {'id': video_id, 'type': stream_type, 'nt': '1'}
-
- headers = {'User-Agent': 'iPad'}
- m3u8_data = self.make_request(url=url, method='post', payload=post_data, headers=headers)
- m3u8_dict = xmltodict.parse(m3u8_data)['result']
- self.log('NFL Dict %s' % m3u8_dict)
-
- m3u8_url = m3u8_dict['path'].replace('_ipad', '')
- m3u8_param = m3u8_url.split('?', 1)[-1]
- # I /hate/ lying with User-Agent.
- # Huge points for making this work without lying.
- m3u8_header = {'Cookie': 'nlqptid=' + m3u8_param,
- 'User-Agent': 'Safari/537.36 Mozilla/5.0 AppleWebKit/537.36 Chrome/31.0.1650.57',
- 'Accept-encoding': 'identity, gzip, deflate',
- 'Connection': 'keep-alive'}
+ return seasons_and_weeks
+ def get_current_season_and_week(self):
+ """Return the current season, season type, and week in a dict."""
try:
- m3u8_manifest = self.make_request(url=m3u8_url, method='get')
+ url = self.config['modules']['ROUTES_DATA_PROVIDERS']['games']
+ seasons = self.make_request(url, 'get')
except:
- m3u8_manifest = False
-
- if m3u8_manifest:
- m3u8_obj = m3u8.loads(m3u8_manifest)
- if m3u8_obj.is_variant: # if this m3u8 contains links to other m3u8s
- for playlist in m3u8_obj.playlists:
- bitrate = int(playlist.stream_info.bandwidth) / 1000
- streams[str(bitrate)] = m3u8_url[:m3u8_url.rfind('/') + 1] + playlist.uri + '?' + m3u8_url.split('?')[1] + '|' + urllib.urlencode(m3u8_header)
- else:
- streams['sole available'] = m3u8_url
-
- return streams
-
- def get_shows(self, season):
- """Return a list of all shows for a season."""
- seasons_shows = self.non_seasonal_shows.keys()
- for show_name, show_codes in self.seasonal_shows.items():
- if season in show_codes:
- seasons_shows.append(show_name)
-
- return sorted(seasons_shows)
-
- def get_shows_episodes(self, show_name, season=None):
- """Return a list of episodes for a show. Return empty list if none are
- found or if an error occurs.
- """
- url = self.servlets_url + '/browse'
- try:
- cid = self.seasonal_shows[show_name][season]
- except KeyError:
- try:
- cid = self.non_seasonal_shows[show_name]
- except KeyError:
- return []
-
- if show_name == 'NFL RedZone Archives':
- ps = 17
- else:
- ps = 50
+ self.log('Acquiring season and week data failed.')
+ raise
- post_data = {
- 'isFlex': 'true',
- 'cid': cid,
- 'pm': 0,
- 'ps': ps,
- 'pn': 1
+ current_s_w = {
+ 'season': seasons['modules']['meta']['currentContext']['currentSeason'],
+ 'season_type': seasons['modules']['meta']['currentContext']['currentSeasonType'],
+ 'week': str(seasons['modules']['meta']['currentContext']['currentWeek'])
}
- archive_data = self.make_request(url=url, method='post', payload=post_data)
- archive_dict = xmltodict.parse(archive_data)['result']
+ return current_s_w
+ def get_weeks_games(self, season, season_type, week):
try:
- items = archive_dict['programs']['program']
- # if only one episode is returned, we explicitly put it into a list
- if isinstance(items, dict):
- items = [items]
- return items
- except TypeError:
- return []
+ url = self.config['modules']['ROUTES_DATA_PROVIDERS']['games_detail'].replace(':seasonType', season_type).replace(':season', season).replace(':week', week)
+ games_data = self.make_request(url, 'get')
+ # collect the games from all keys in 'modules' that has 'content' as a key
+ games = [g for x in games_data['modules'].keys() if 'content' in games_data['modules'][x] for g in games_data['modules'][x]['content']]
+ except:
+ self.log('Acquiring games data failed.')
+ raise
- def get_seasons_and_weeks(self):
- """Return a multidimensional array of all seasons and weeks."""
- seasons_and_weeks = {}
+ return sorted(games, key=lambda x: x['gameDateTimeUtc'])
+ def get_team_games(self, season, team=None):
try:
- url = self.locEDLBaseUrl + '/mobile/weeks_v2.xml'
- s_w_data = self.make_request(url=url, method='get')
- s_w_data_dict = xmltodict.parse(s_w_data)
+ url = self.config['modules']['ROUTES_DATA_PROVIDERS']['teams']
+ teams = self.make_request(url, 'get')
+ if team is None:
+ return teams
+ else:
+ # look for the team name
+ for conference in teams['modules']:
+ if 'content' in teams['modules'][conference]:
+ for teamname in teams['modules'][conference]['content']:
+ if team == teamname['fullName']:
+ team = teamname['seoname']
+ break;
+ else:
+ return None
+
+ url = self.config['modules']['ROUTES_DATA_PROVIDERS']['team_detail'].replace(':team', team)
+ games_data = self.make_request(url, 'get')
+ # collect games from all keys in 'modules' for a specific season
+ games = [g for x in games_data['modules'].keys() if x == 'videos'+season for g in games_data['modules'][x]['content']]
+
except:
- self.log('Acquiring season and week data failed.')
+ self.log('Acquiring Team games data failed.')
raise
- try:
- for season in s_w_data_dict['seasons']['season']:
- year = season['@season']
- season_dict = {}
-
- for week in season['week']:
- if week['@section'] == "pre": # preseason
- week_code = '1' + week['@value'].zfill(2)
- season_dict[week_code] = week
- else: # regular season and post season
- week_code = '2' + week['@value'].zfill(2)
- season_dict[week_code] = week
-
- seasons_and_weeks[year] = season_dict
- except KeyError:
- self.log('Parsing season and week data failed.')
- raise
+ return sorted(games, key=lambda x: x['gameDateTimeUtc'])
- return seasons_and_weeks
+ def get_game_versions(self, game_id, season):
+ """Return a dict of available game versions for a single game."""
+ game_versions = {}
+ url = self.config['modules']['ROUTES_DATA_PROVIDERS']['game_page'].replace(':season', season).replace(':gameslug', game_id)
+ data = self.make_request(url, 'get')['modules']['singlegame']['content'][0]
+ for key in data.keys():
+ if isinstance(data[key], dict) and 'videoId' in data[key]:
+ game_versions[data[key]['kind']] = data[key]['videoId']
- def get_weeks_games(self, season, week_code):
- """Return a list of games for a week."""
- url = self.servlets_url + '/games'
- post_data = {
- 'isFlex': 'true',
- 'season': season,
- 'week': week_code
- }
+ self.log('Game versions found for {0}: {1}'.format(game_id, ', '.join(game_versions.keys())))
+ return game_versions
- game_data = self.make_request(url=url, method='post', payload=post_data)
- game_data_dict = xmltodict.parse(game_data)['result']
- if game_data_dict['games']:
- games = game_data_dict['games']['game']
- # if only one game is returned, we explicitly put it into a list
- if isinstance(games, dict):
- games = [games]
-
- return games
- else:
- return None
+ def get_stream(self, video_id, game_type=None, username=None):
+ """Return the URL for a stream."""
+ self.refresh_tokens()
- def login(self, username=None, password=None):
- """Complete login process for Game Pass. Errors (auth issues, blackout,
- etc) are raised as LoginFailure.
- """
- if self.check_for_subscription():
- self.log('Already logged into Game Pass %s' % self.subscription)
+ if video_id == 'nfl_network':
+ diva_config_url = self.config['modules']['DIVA']['HTML5']['SETTINGS']['Live24x7']
+ url = self.config['modules']['ROUTES_DATA_PROVIDERS']['network']
+ response = self.make_request(url, 'get')
+ video_id = response['modules']['networkLiveVideo']['content'][0]['videoId']
else:
- if username and password:
- self.log('Not (yet) logged into %s' % self.subscription)
- self.login_to_account(username, password)
- if not self.check_for_subscription():
- raise self.LoginFailure('%s login failed' % self.subscription)
- elif self.subscription == 'domestic' and self.service_blackout():
- raise self.LoginFailure('Game Pass Domestic Blackout')
+ if game_type == 'live':
+ diva_config_url = self.config['modules']['DIVA']['HTML5']['SETTINGS']['LiveNoData']
else:
- self.log('No username and password supplied.')
- raise self.LoginFailure('No username and password supplied.')
+ diva_config_url = self.config['modules']['DIVA']['HTML5']['SETTINGS']['VodNoData']
+
+ diva_config_data = self.make_request(diva_config_url.replace('device', 'html5'), 'get')
+ diva_config_root = ET.fromstring(diva_config_data)
+ for i in diva_config_root.iter('parameter'):
+ if i.attrib['name'] == 'processingUrlCallPath':
+ processing_url = i.attrib['value']
+ elif i.attrib['name'] == 'videoDataPath':
+ stream_request_url = i.attrib['value'].replace('{V.ID}', video_id)
+ akamai_xml_data = self.make_request(stream_request_url, 'get')
+ akamai_xml_root = ET.fromstring(akamai_xml_data)
+ for i in akamai_xml_root.iter('videoSource'):
+ if i.attrib['format'] == 'ChromeCast':
+ for text in i.itertext():
+ if 'http' in text:
+ m3u8_url = text
+ break
- def login_to_account(self, username, password):
- """Blindly authenticate to Game Pass. Use check_for_subscription() to
- determine success.
- """
- url = self.base_url + '/secure/nfllogin'
post_data = {
- 'username': username,
- 'password': password
+ 'Type': '1',
+ 'User': '',
+ 'VideoId': video_id,
+ 'VideoSource': m3u8_url,
+ 'VideoKind': 'Video',
+ 'AssetState': '3',
+ 'PlayerType': 'HTML5',
+ 'other': '{0}|{1}|web|{1}|undefined|{2}' .format(str(uuid.uuid4()), self.access_token, self.user_agent, username)
}
- self.make_request(url=url, method='post', payload=post_data)
- def make_request(self, url, method, payload=None, headers=None):
- """Make an http request. Return the response."""
- self.log('Request URL: %s' % url)
- self.log('Headers: %s' % headers)
+ response = self.make_request(processing_url, 'post', payload=json.dumps(post_data))
- try:
- if method == 'get':
- req = self.http_session.get(url, params=payload, headers=headers, allow_redirects=False)
- else: # post
- req = self.http_session.post(url, data=payload, headers=headers, allow_redirects=False)
- req.raise_for_status()
- self.log('Response code: %s' % req.status_code)
- self.log('Response: %s' % req.content)
- self.cookie_jar.save(ignore_discard=True, ignore_expires=False)
- return req.content
- except requests.exceptions.HTTPError as error:
- self.log('An HTTP error occurred: %s' % error)
- raise
- except requests.exceptions.ProxyError:
- self.log('Error connecting to proxy server')
- raise
- except requests.exceptions.ConnectionError as error:
- self.log('Connection Error: - %s' % error.message)
- raise
- except requests.exceptions.RequestException as error:
- self.log('Error: - %s' % error.value)
- raise
+ return self.parse_m3u8_manifest(response['ContentUrl'])
- def parse_manifest(self, manifest):
- """Return a dict of the supplied XML manifest. Builds and adds
- "full_url" for convenience.
- """
+ def parse_m3u8_manifest(self, manifest_url):
+ """Return the manifest URL along with its bitrate."""
streams = {}
- manifest_dict = xmltodict.parse(manifest)
-
- for stream in manifest_dict['channel']['streamDatas']['streamData']:
- try:
- url_path = stream['@url']
- bitrate = url_path[(url_path.rindex('_') + 1):url_path.rindex('.')]
- try:
- stream['full_url'] = 'http://%s%s.m3u8' % (stream['httpservers']['httpserver']['@name'], url_path)
- except TypeError: # if multiple servers are returned, use the first in the list
- stream['full_url'] = 'http://%s%s.m3u8' % (stream['httpservers']['httpserver'][0]['@name'], url_path)
-
- streams[bitrate] = stream
- except KeyError:
- self.log(format_exc())
+ m3u8_header = {
+ 'Connection': 'keep-alive',
+ 'User-Agent': self.user_agent
+ }
+ streams['manifest_url'] = manifest_url + '|' + urllib.urlencode(m3u8_header)
+ streams['bitrates'] = {}
+ m3u8_manifest = self.make_request(manifest_url, 'get')
+ m3u8_obj = m3u8.loads(m3u8_manifest)
+ for playlist in m3u8_obj.playlists:
+ bitrate = int(playlist.stream_info.bandwidth) / 1000
+ streams['bitrates'][bitrate] = manifest_url[:manifest_url.rfind('/manifest') + 1] + playlist.uri + '?' + manifest_url.split('?')[1] + '|' + urllib.urlencode(m3u8_header)
return streams
def redzone_on_air(self):
"""Return whether RedZone Live is currently broadcasting."""
- url = self.simpleconsole_url
- post_data = {'isFlex': 'true'}
- sc_data = self.make_request(url=url, method='post', payload=post_data)
+ url = self.config['modules']['ROUTES_DATA_PROVIDERS']['redzone']
+ response = self.make_request(url, 'get')
+ if not response['modules']['redZoneLive']['content']:
+ return False
+ else:
+ return True
- sc_dict = xmltodict.parse(sc_data)['result']
+ def parse_shows(self):
+ """Dynamically parse the NFL Network shows into a dict."""
+ show_dict = {}
+ url = self.config['modules']['API']['NETWORK_PROGRAMS']
+ response = self.make_request(url, 'get')
+
+ for show in response['modules']['programs']:
+ season_dict = {}
+ for season in show['seasons']:
+ season_name = season['value']
+ season_id = season['slug']
+ season_dict[season_name] = season_id
+ if season_name not in self.nfln_seasons:
+ self.nfln_seasons.append(season_name)
+ show_dict[show['title']] = season_dict
+ self.nfln_shows.update(show_dict)
- # Dynamically parse NFL-Network shows
- self.parse_shows(sc_dict)
+ def get_shows(self, season):
+ """Return a list of all shows for a season."""
+ seasons_shows = []
- # Check if RedZone is Live
- if sc_dict['rzPhase'] in ('pre', 'in'):
- self.log('RedZone is on air.')
- return True
- else:
- self.log('RedZone is not on air.')
- return False
+ for show_name, show_codes in self.nfln_shows.items():
+ if season in show_codes:
+ seasons_shows.append(show_name)
- def service_blackout(self):
- """Return whether Game Pass is blacked out."""
- url = self.base_url + '/secure/schedule'
- blackout_message = ('Due to broadcast restrictions, NFL Game Pass is currently unavailable.'
- ' Please check back later.')
- service_data = self.make_request(url=url, method='get')
+ return sorted(seasons_shows)
- if blackout_message in service_data:
- return True
+ def get_shows_episodes(self, show_name, season=None):
+ """Return a list of episodes for a show. Return empty list if none are
+ found or if an error occurs."""
+ url = self.config['modules']['API']['NETWORK_PROGRAMS']
+ programs = self.make_request(url, 'get')['modules']['programs']
+ for show in programs:
+ if show_name == show['title']:
+ selected_show = show
+ break
+ season_slug = [x['slug'] for x in selected_show['seasons'] if season == x['value']][0]
+ request_url = self.config['modules']['API']['NETWORK_EPISODES']
+ episodes_url = request_url.replace(':seasonSlug', season_slug).replace(':tvShowSlug', selected_show['slug'])
+ episodes_data = self.make_request(episodes_url, 'get')['modules']['archive']['content']
+ for episode in episodes_data:
+ if not episode['videoThumbnail']['templateUrl']: # set programs thumbnail as episode thumbnail
+ episode['videoThumbnail']['templateUrl'] = [x['thumbnail']['templateUrl'] for x in programs if x['slug'] == episode['nflprogram']][0]
+
+ return episodes_data
+
+ def parse_datetime(self, date_string, localize=False):
+ """Parse NFL Game Pass date string to datetime object."""
+ date_time_format = '%Y-%m-%dT%H:%M:%S.%fZ'
+ datetime_obj = datetime(*(time.strptime(date_string, date_time_format)[0:6]))
+ if localize:
+ return self.utc_to_local(datetime_obj)
else:
- return False
+ return datetime_obj
+
+ @staticmethod
+ def utc_to_local(utc_dt):
+ """Convert UTC time to local time."""
+ # get integer timestamp to avoid precision lost
+ timestamp = calendar.timegm(utc_dt.timetuple())
+ local_dt = datetime.fromtimestamp(timestamp)
+ assert utc_dt.resolution >= timedelta(microseconds=1)
+ return local_dt.replace(microsecond=utc_dt.microsecond)
diff --git a/plugin.video.nfl.gamepass/resources/settings.xml b/plugin.video.nfl.gamepass/resources/settings.xml
index ee5512f..dbbc5b7 100644
--- a/plugin.video.nfl.gamepass/resources/settings.xml
+++ b/plugin.video.nfl.gamepass/resources/settings.xml
@@ -4,9 +4,10 @@
<setting id="password" type="text" label="30002" default="" option="hidden" visible="!eq(-1,)" enable="!eq(-1,)"/>
</category>
<category label="30030">
- <setting id="preferred_bitrate" type="select" label="30003" lvalues="30004|30005|30006|30007|30008|30009|30010|30011|30012" default="8"/>
- <setting id="preferred_game_version" type="select" label="30013" lvalues="30014|30015|30012" default="0"/>
- <setting id="local_tz" type="enum" label="30020" lvalues="30026|30027|30028" default="0"/>
+ <setting id="use_inputstream_adaptive" type="bool" label="30049" default="false"/>
+ <setting id="preferred_bitrate" type="select" label="30003" lvalues="30004|30005|30006|30007|30008|30009|30010|30011|30012" visible="eq(-1,false)" default="8"/>
+ <setting id="preferred_game_version" type="select" label="30013" lvalues="30014|30015|30032|30012" default="3"/>
+ <setting id="time_notation" type="enum" label="30020" lvalues="30027|30028" default="1"/>
<setting id="hide_game_length" type="bool" label="30025" default="false"/>
</category>
<category label="30033">
diff --git a/plugin.video.playonbrowser/LICENSE.md b/plugin.video.playonbrowser/LICENSE.md
new file mode 100644
index 0000000..733c072
--- /dev/null
+++ b/plugin.video.playonbrowser/LICENSE.md
@@ -0,0 +1,675 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ {one line to give the program's name and a brief idea of what it does.}
+ Copyright (C) {year} {name of author}
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ {project} Copyright (C) {year} {fullname}
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+
diff --git a/plugin.video.playonbrowser/README.md b/plugin.video.playonbrowser/README.md
new file mode 100644
index 0000000..0c3cd70
--- /dev/null
+++ b/plugin.video.playonbrowser/README.md
@@ -0,0 +1,5 @@
+# plugin.video.playonbrowser
+Provides a native interface to browsing m.playon.tv in your local network.
+
+### STRM
+One of the reasons I created this was so I can use MyLibrary with this addon so I do not have refresh every hour incase the process restarts or other scenarios cause the Ids to change.
diff --git a/plugin.video.playonbrowser/addon.xml b/plugin.video.playonbrowser/addon.xml
new file mode 100644
index 0000000..dfebf3f
--- /dev/null
+++ b/plugin.video.playonbrowser/addon.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<addon id="plugin.video.playonbrowser" name="PlayOn Browser" version="2.0.1" provider-name="Lunatixz">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="script.module.simplecache" version="1.0.0"/>
+ <import addon="script.module.xmltodict" version="0.9.0"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource" library="default.py">
+ <provides>video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <summary lang="en_GB">Browse PlayOn from Kodi.</summary>
+ <description lang="en_GB">PlayOn is a streaming media brand and software suite that enables users to view and record videos from numerous online content providers.</description>
+ <disclaimer lang="en_GB">Requires Playon Server Software</disclaimer>
+ <platform>all</platform>
+ <license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license>
+ <forum>http://forum.kodi.tv/showthread.php?tid=233136</forum>
+ <website>https://www.playon.tv</website>
+ <source>https://github.com/Lunatixz/XBMC_Addons/tree/master/plugin.video.playonbrowser</source>
+ <news>>v.2.0.1[CR]- Fixed PlayLater playback[CR]v.2.0.0[CR]- Refactored and optimized Code.[CR]- Added PlayLater Recording via Context Menu.</news>
+ <assets>
+ <icon>resources/images/icon.png</icon>
+ <fanart>resources/images/fanart.jpg</fanart>
+ <screenshot>resources/images/screenshot01.png</screenshot>
+ <screenshot>resources/images/screenshot02.png</screenshot>
+ <screenshot>resources/images/screenshot03.png</screenshot>
+ <screenshot>resources/images/screenshot04.png</screenshot>
+ </assets>
+ </extension>
+</addon> \ No newline at end of file
diff --git a/plugin.video.playonbrowser/default.py b/plugin.video.playonbrowser/default.py
new file mode 100644
index 0000000..5c206ad
--- /dev/null
+++ b/plugin.video.playonbrowser/default.py
@@ -0,0 +1,339 @@
+# Copyright (C) 2017 Lunatixz
+#
+#
+# This file is part of Playon Browser
+#
+# Playon Browser is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Playon Browser is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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 Playon Browser. If not, see <http://www.gnu.org/licenses/>.
+
+import sys, os, re, random, traceback, json, xmltodict, collections
+import urllib, urllib2, socket, datetime
+import xbmc, xbmcplugin, xbmcaddon, xbmcgui
+
+from simplecache import SimpleCache
+
+# Plugin Info
+ADDON_ID = 'plugin.video.playonbrowser'
+REAL_SETTINGS = xbmcaddon.Addon(id=ADDON_ID)
+ADDON_NAME = REAL_SETTINGS.getAddonInfo('name')
+SETTINGS_LOC = REAL_SETTINGS.getAddonInfo('profile')
+ADDON_PATH = REAL_SETTINGS.getAddonInfo('path').decode('utf-8')
+ADDON_VERSION = REAL_SETTINGS.getAddonInfo('version')
+ICON = REAL_SETTINGS.getAddonInfo('icon')
+FANART = REAL_SETTINGS.getAddonInfo('fanart')
+LANGUAGE = REAL_SETTINGS.getLocalizedString
+
+# Globals
+TIMEOUT = 30
+PLAYON_DATA = '/data/data.xml'
+BASE_VIDEO_URL = "%s/%s/main.m3u8"
+BASE_ID_URL = "%s/data/data.xml?id=%s"
+BASE_UPNP = REAL_SETTINGS.getSetting("playonUPNPid").rstrip('/')
+BASE_URL = REAL_SETTINGS.getSetting("playonserver").rstrip('/')
+DEBUG = REAL_SETTINGS.getSetting("debug") == "true"
+KODILIBRARY = False #todo strm contextMenu
+URLTYPE = {0:'m3u8',1:'upnp',2:'ext'}[int(REAL_SETTINGS.getSetting('playonmedia'))]
+PTVL_RUNNING = xbmcgui.Window(10000).getProperty('PseudoTVRunning') == "True"
+
+
+def log(msg, level=xbmc.LOGDEBUG):
+ if DEBUG == True or level == xbmc.LOGERROR:
+ if level == xbmc.LOGERROR:
+ msg += ' ,' + traceback.format_exc()
+ xbmc.log(ADDON_ID + '-' + ADDON_VERSION + '-' + (msg), level)
+
+def getParams():
+ param=[]
+ if len(sys.argv[2])>=2:
+ params=sys.argv[2]
+ cleanedparams=params.replace('?','')
+ if (params[len(params)-1]=='/'):
+ params=params[0:len(params)-2]
+ pairsofparams=cleanedparams.split('&')
+ param={}
+ for i in range(len(pairsofparams)):
+ splitparams={}
+ splitparams=pairsofparams[i].split('=')
+ if (len(splitparams))==2:
+ param[splitparams[0]]=splitparams[1]
+ return param
+
+def folderIcon(val):
+ log('folderIcon')
+ return random.choice(['/images/folders/folder_%s_0.png' %val,'/images/folders/folder_%s_1.png' %val])
+
+def parseSEinfo(label):
+ season = -1
+ episode = -1
+ pattern1 = re.compile(r"""(?:s|season)(?:\s)(?P<s>\d+)(?:e|x|episode|\n)(?:\s)(?P<ep>\d+) # s 01e 02""" , re.VERBOSE)
+ pattern2 = re.compile(r"""(?:s|season)(?P<s>\d+)(?:e|x|episode|\n)(?:\s)(?P<ep>\d+) # s01e 02""" , re.VERBOSE)
+ pattern3 = re.compile(r"""(?:s|season)(?:\s)(?P<s>\d+)(?:e|x|episode|\n)(?P<ep>\d+) # s 01e02""" , re.VERBOSE)
+ pattern4 = re.compile(r"""(?:s|season)(?P<s>\d+)(?:e|x|episode|\n)(?P<ep>\d+) # s01e02""" , re.VERBOSE)
+ pattern5 = re.compile(r"""(?:s|season)(?P<s>\d+)(?:.*)(?:e|x|episode|\n)(?P<ep>\d+) # s01 random123 e02""" , re.VERBOSE)
+ pattern6 = re.compile(r"""(?:s|season)(?:\s)(?P<s>\d+)(?:.*)(?:e|x|episode|\n)(?:\s)(?P<ep>\d+) # s 01 random123 e 02""", re.VERBOSE)
+ pattern7 = re.compile(r"""(?:s|season)(?:\s)(?P<s>\d+)(?:.*)(?:e|x|episode|\n)(?P<ep>\d+) # s 01 random123 e02""" , re.VERBOSE)
+ pattern8 = re.compile(r"""(?:s|season)(?P<s>\d+)(?:.*)(?:e|x|episode|\n)(?:\s)(?P<ep>\d+) # s01 random123 e 02""" , re.VERBOSE)
+ patterns = [pattern1, pattern2, pattern3, pattern4, pattern5, pattern6, pattern7, pattern8 ]
+
+ for idx, p in enumerate(patterns):
+ m = re.search(p, label)
+ if m:
+ season = int( m.group('s'))
+ episode = int( m.group('ep'))
+ log("parseSEinfo, return S:" + str(season) +',E:'+ str(episode))
+ return season, episode
+
+
+socket.setdefaulttimeout(TIMEOUT)
+class PlayOn:
+ def __init__(self):
+ self.cache = SimpleCache()
+ random.seed()
+ if URLTYPE == 'upnp': self.chkUPNP()
+
+
+ def openURL(self, url):
+ log('openURL, url = ' + str(url))
+ try:
+ cacheResponse = self.cache.get(ADDON_NAME + '.openURL, url = %s'%url)
+ if not cacheResponse:
+ request = urllib2.Request(url)
+ request.add_header('User-Agent','Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)')
+ response = urllib2.urlopen(request, timeout=TIMEOUT).read()
+ self.cache.set(ADDON_NAME + '.openURL, url = %s'%url, response, expiration=datetime.timedelta(hours=1))
+ if url == BASE_URL + PLAYON_DATA:
+ self.chkIP(response)
+ return self.cache.get(ADDON_NAME + '.openURL, url = %s'%url)
+ except urllib2.URLError, e:
+ log("openURL Failed! " + str(e), xbmc.LOGERROR)
+ except socket.timeout, e:
+ log("openURL Failed! " + str(e), xbmc.LOGERROR)
+ except Exception, e:
+ log("openURL Failed! " + str(e), xbmc.LOGERROR)
+ xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30010), ICON, 5000)
+
+
+ def chkIP(self, response):
+ results = xmltodict.parse(response)
+ if results:
+ if 'catalog' in results:
+ try:
+ ServerName = results['catalog']['@name']
+ ServerVer = 'PlayOn v.%s'%results['catalog']['@server']
+ ServerMSG = "Connected to [B]%s %s[/B]"%(ServerName,ServerVer)
+ log('chkIP, ServerName = ' + ServerName)
+ log('chkIP, ServerVer = ' + ServerVer)
+ REAL_SETTINGS.setSetting("playonServerid",ServerMSG)
+ xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30011)%ServerName, ICON, 5000)
+ except:
+ pass
+ else:
+ xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30012), ICON, 5000)
+
+
+ def getUPNP(self):
+ """ Check if upnp id is valid. """
+ url = BASE_UPNP
+ json_query = ('{"jsonrpc":"2.0","method":"Files.GetDirectory","params":{"directory":"%s"},"id":1}'%url)
+ data = json.loads(xbmc.executeJSONRPC(json_query))
+ try:
+ if not data['result']['files'][0]['file'].endswith('/playonprovider/'):
+ url = ''
+ except Exception,e:
+ url = ''
+ log('getUPNP, Failed! ' + str(e))
+ log('getUPNP, url = ' + url)
+ return url
+
+
+ def chkUPNP(self):
+ """ Query json, locate 'playon server' path, else prompt. """
+ log('chkUPNP')
+ if len(self.getUPNP()) > 0:
+ return
+ else:
+ json_query = ('{"jsonrpc":"2.0","method":"Files.GetDirectory","params":{"directory":"upnp://"},"id":1}')
+ data = json.loads(xbmc.executeJSONRPC(json_query))
+ if data and 'result' in data and 'files' in data['result']:
+ for item in data['result']['files']:
+ if (item['label']).lower().startswith('playon'):
+ REAL_SETTINGS.setSetting("playonUPNPid",item['file'].rstrip('/'))
+ xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30013), ICON, 5000)
+ BASE_UPNP = item['file']
+ REAL_SETTINGS.setSetting("playonUPNPid",BASE_UPNP.rstrip('/'))
+ elif PTVL_RUNNING == False:
+ BASE_UPNP = xbmcgui.Dialog().browse(0, LANGUAGE(30014), 'files', '', False, False, 'upnp://')
+ if BASE_UPNP != -1:
+ REAL_SETTINGS.setSetting("playonUPNPid",BASE_UPNP.rstrip('/'))
+ else:
+ xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30010), ICON, 5000)
+
+
+ def buildItemMenu(self, uri=PLAYON_DATA):
+ log('buildItemMenu, uri = ' + uri)
+ try:
+ genSTRM = False
+ results = []
+ ranNum = random.randrange(9)
+ response = dict(xmltodict.parse(self.openURL(BASE_URL + uri)))
+ if response and 'catalog' in response and 'group' in response['catalog']:
+ results = response['catalog']['group']
+ elif response and 'group' in response and response['group']['@href'] == uri:
+ results = response['group']['group']
+ genSTRM = True
+ if isinstance(results,collections.OrderedDict):
+ results = [dict(results)]
+
+ for item in results:
+ try:
+ if isinstance(item,collections.OrderedDict):
+ item = dict(item)
+ if item['@type'] == 'folder':
+ name = item['@name'].replace('PlayOn','[B]- PlayOn[/B]').replace('PlayMark','[B]- PlayMark[/B]')
+ thumb = BASE_URL + ((item.get('@art','').replace('&size=tiny','&size=large')) or folderIcon(ranNum))
+ self.addDir(name,item['@href'] ,1,thumb, genSTRM)
+ elif item['@type'] == 'video':
+ self.addLink(item['@name'],item['@href'],9,len(results))
+ except Exception, e:
+ log("buildItemMenu Failed! " + str(e), xbmc.LOGERROR)
+ except Exception, e:
+ log("buildItemMenu Failed! " + str(e), xbmc.LOGERROR)
+
+
+ def playLater(self, name, uri):
+ log('playLater, uri = ' + uri)
+ response = dict(xmltodict.parse(self.openURL(BASE_URL + uri)))
+ if response and 'result' in response:
+ result = dict(response['result'])
+ if result['status'] == "true":
+ msg = result['msg'].replace('The media item',name)
+ xbmcgui.Dialog().notification(ADDON_NAME, msg, ICON, 5000)
+
+
+ def playVideo(self, name, uri):
+ log('playVideo, uri = ' + uri)
+ liz = self.buildListitem(uri)
+ xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
+
+
+ def buildListitem(self, uri, contextMenu=[]):
+ result = {}
+ infoList = {}
+ response = dict(xmltodict.parse(self.openURL(BASE_URL + uri)))
+ if response and 'group' in response and response['group']['@href'] == uri:
+ result = dict(response['group'])
+ tvshowtitle = (dict(result.get('series','')).get('@name','') or None)
+ title = (result.get('@name','') or dict(result['media_title'])['@name'] or dict(result['media'])['@name'])
+ label = title
+ mType = 'movie'
+ if tvshowtitle is not None:
+ if tvshowtitle not in title:
+ label = '%s - %s'%(tvshowtitle,title)
+ season, episode = parseSEinfo(title)
+ infoList['season'] = int(season)
+ infoList['episode'] = int(episode)
+ mType = 'episode'
+ plot = (result.get('@description','') or dict(result.get('description','')).get('@name','') or '')
+ thumb = BASE_URL + (result.get('@art','') or dict(result.get('media','')).get('@art','') or ICON).replace('&size=tiny','&size=large')
+ try:
+ aired = (dict(result.get('date','')).get('@name','') or datetime.datetime.now().strftime('%m/%d/%Y'))
+ aired = (datetime.datetime.strptime(aired, '%m/%d/%Y')).strftime('%Y-%m-%d')
+ except:
+ aired = datetime.datetime.now().strftime('%Y-%m-%d')
+ timeData = (dict(result.get('time','')).get('@name','') or '')
+ playLater = dict(result.get('media_playlater','')).get('@src','')
+ contextMenu = contextMenu + [('Add to PlayLater','XBMC.RunPlugin(%s)'%(sys.argv[0]+"?url="+urllib.quote_plus(playLater)+"&mode="+str(8)+"&name="+urllib.quote_plus(label.encode("utf-8"))))]
+
+ if len(timeData) > 0:
+ timeList = timeData.split(':')
+ hours = int(timeList[0])
+ mins = int(timeList[1])
+ secs = int(timeList[2])
+ duration = ((hours * 60 * 60) + (mins * 60) + secs)
+ else:
+ duration = 0
+
+ if URLTYPE == 'm3u8' and 'playlaterrecordings' not in result['@href']:
+ url = BASE_VIDEO_URL%(BASE_URL,result['@href'].split('?id=')[1])
+ elif URLTYPE == 'ext' or 'playlaterrecordings' in result['@href']:
+ url = BASE_URL + '/' + dict(result['media'])['@src']
+ else:
+ url = BASE_UPNP + '/' + dict(result['media'])['@src'].split('.')[0].split('/')[0] + '/'
+
+ log('playVideo, url = ' + url)
+ liz=xbmcgui.ListItem(name, path=url)
+ liz.addContextMenuItems(contextMenu)
+ infoList = {"mediatype":mType,"label":label,"title":label,"tvshowtitle":tvshowtitle,"plot":plot,"duration":duration,"aired":aired}
+ infoArt = {"thumb":thumb,"poster":thumb,"icon":ICON,"fanart":FANART}
+ liz.setInfo(type="Video", infoLabels=infoList)
+ liz.setArt(infoArt)
+ liz.setProperty("IsPlayable","true")
+ liz.setProperty("IsInternetStream","true")
+ return liz
+
+
+ def addLink(self, name, u, mode, total=0):
+ name = name.encode("utf-8")
+ log('addLink, name = ' + name)
+ contextMenu = [('Add to Library','XBMC.RunPlugin(%s)'%(sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(7)+"&name="+urllib.quote_plus(name)))]
+ liz = self.buildListitem(u)
+ u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
+ xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,totalItems=total)
+
+
+ def addDir(self, name, u, mode, thumb=ICON, strm=False):
+ name = name.encode("utf-8")
+ log('addDir, name = ' + name)
+ liz=xbmcgui.ListItem(name)
+ # if strm:
+ # contextMenu = [('Add to Library','XBMC.RunPlugin(%s)'%(sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(7)+"&name="+urllib.quote_plus(name)))]
+ # liz.addContextMenuItems(contextMenu)
+ liz.setProperty('IsPlayable', 'false')
+ liz.setInfo(type="Video", infoLabels={"mediatype":"video","label":name,"title":name})
+ liz.setArt({'thumb':thumb,'fanart':FANART})
+ u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
+ xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
+
+
+ def genSTRMS(self, name, uri):
+ log('genSTRMS, name = ' + name)
+ #todo
+
+
+params=getParams()
+try:
+ url=urllib.unquote_plus(params["url"])
+except:
+ url=None
+try:
+ name=urllib.unquote_plus(params["name"])
+except:
+ name=None
+try:
+ mode=int(params["mode"])
+except:
+ mode=None
+
+log("Mode: "+str(mode))
+log("URL : "+str(url))
+log("Name: "+str(name))
+
+if mode==None: PlayOn().buildItemMenu()
+if mode==1: PlayOn().buildItemMenu(url)
+if mode==7: PlayOn().genSTRMS(name, url)
+if mode==8: PlayOn().playLater(name, url)
+if mode==9: PlayOn().playVideo(name, url)
+
+xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_NONE )
+xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_LABEL )
+xbmcplugin.endOfDirectory(int(sys.argv[1]),cacheToDisc=True) \ No newline at end of file
diff --git a/plugin.video.playonbrowser/resources/images/fanart.jpg b/plugin.video.playonbrowser/resources/images/fanart.jpg
new file mode 100644
index 0000000..ac22b86
--- /dev/null
+++ b/plugin.video.playonbrowser/resources/images/fanart.jpg
Binary files differ
diff --git a/plugin.video.playonbrowser/resources/images/icon.png b/plugin.video.playonbrowser/resources/images/icon.png
new file mode 100644
index 0000000..e8e9d4e
--- /dev/null
+++ b/plugin.video.playonbrowser/resources/images/icon.png
Binary files differ
diff --git a/plugin.video.playonbrowser/resources/images/screenshot01.png b/plugin.video.playonbrowser/resources/images/screenshot01.png
new file mode 100644
index 0000000..d65ee20
--- /dev/null
+++ b/plugin.video.playonbrowser/resources/images/screenshot01.png
Binary files differ
diff --git a/plugin.video.playonbrowser/resources/images/screenshot02.png b/plugin.video.playonbrowser/resources/images/screenshot02.png
new file mode 100644
index 0000000..a9ab868
--- /dev/null
+++ b/plugin.video.playonbrowser/resources/images/screenshot02.png
Binary files differ
diff --git a/plugin.video.playonbrowser/resources/images/screenshot03.png b/plugin.video.playonbrowser/resources/images/screenshot03.png
new file mode 100644
index 0000000..3462d27
--- /dev/null
+++ b/plugin.video.playonbrowser/resources/images/screenshot03.png
Binary files differ
diff --git a/plugin.video.playonbrowser/resources/images/screenshot04.png b/plugin.video.playonbrowser/resources/images/screenshot04.png
new file mode 100644
index 0000000..01e427b
--- /dev/null
+++ b/plugin.video.playonbrowser/resources/images/screenshot04.png
Binary files differ
diff --git a/plugin.video.playonbrowser/resources/language/resource.language.en_gb/strings.po b/plugin.video.playonbrowser/resources/language/resource.language.en_gb/strings.po
new file mode 100644
index 0000000..3758c91
--- /dev/null
+++ b/plugin.video.playonbrowser/resources/language/resource.language.en_gb/strings.po
@@ -0,0 +1,61 @@
+# Playon Browser Media Center language file
+# Addon Name: Playon Browser
+# Addon id: plugin.video.playonbrowser
+# Addon Provider: Lunatixz
+msgid ""
+msgstr ""
+"Project-Id-Version: plugin.video.playonbrowser Addons\n"
+"Report-Msgid-Bugs-To: http://forum.kodi.tv/showthread.php?tid=233136\n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Lunatixz Translation Team\n"
+"Language-Team: English (http://www.transifex.com/projects/p/xbmc-addons/language/en/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "#30000"
+msgid "Enable Debugging [Log errors]"
+msgstr ""
+
+msgctxt "#30001"
+msgid "Navigate to m.playon.tv in a browser to get the resolved IP."
+msgstr ""
+
+msgctxt "#30002"
+msgid "Playon IP:Port"
+msgstr ""
+
+msgctxt "#30003"
+msgid "Preferred Playback Method"
+msgstr ""
+
+msgctxt "#30004"
+msgid "UPNP Server"
+msgstr ""
+
+msgctxt "#30005"
+msgid ""
+msgstr ""
+
+msgctxt "#30010"
+msgid "Something Went Wrong..."
+msgstr ""
+
+msgctxt "#30011"
+msgid "Connect to PlayOn: %s"
+msgstr ""
+
+msgctxt "#30012"
+msgid "Please Check Playon Server and IP:Port settings."
+msgstr ""
+
+msgctxt "#30013"
+msgid "Found Playon UPNP Server"
+msgstr ""
+
+msgctxt "#30014"
+msgid "Navigate to UPNP, locate Playon Server"
+msgstr ""
diff --git a/plugin.video.playonbrowser/resources/settings.xml b/plugin.video.playonbrowser/resources/settings.xml
new file mode 100644
index 0000000..eeac839
--- /dev/null
+++ b/plugin.video.playonbrowser/resources/settings.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<settings>
+
+ <setting label="30001" type="lsep"/>
+ <setting label="30002" type="text" id="playonserver" default="http://localhost:54479"/>
+ <setting label="30005" type="text" id="playonServerid" default="" enable="false"/>
+ <setting label="30003" type="enum" id="playonmedia" default="0" values="M3U8|UPNP" />
+ <setting label="30004" type="text" id="playonUPNPid" default="" enable="false" visible="eq(-1,1)"/>
+ <setting label="30000" type="bool" id="debug" default="false"/>
+</settings> \ No newline at end of file
diff --git a/plugin.video.plutotv/addon.xml b/plugin.video.plutotv/addon.xml
index fbdd490..870bcbd 100644
--- a/plugin.video.plutotv/addon.xml
+++ b/plugin.video.plutotv/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<addon id="plugin.video.plutotv" version="1.0.6" name="Pluto.TV" provider-name="Lunatixz">
+<addon id="plugin.video.plutotv" version="1.0.7" name="Pluto.TV" provider-name="Lunatixz">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
<import addon="script.module.simplecache" version="1.0.0"/>
@@ -18,7 +18,7 @@
<source>https://github.com/Lunatixz/XBMC_Addons/tree/master/plugin.video.plutotv</source>
<website>http://pluto.tv/</website>
<forum>http://forum.kodi.tv/showthread.php?tid=315513</forum>
- <news>v1.0.1[CR]- Fixed login cache issue.[CR]v1.0.2[CR]- Fixed cookie issue on android devices.[CR]- Updated cache life.[CR]v1.0.3[CR]- Fixed Menu and Tweaked cache.[CR]v1.0.4[CR]- Added Region Selection and Improved Region Filter[CR]- Added Startup Wizard and Improved Login Verification.[CR]v1.0.5[CR]- Fixed Android Login[CR]v1.0.6[CR]- Added Guest Login.[CR]- Added Geoblock warning.</news>
+ <news>[CR]v1.0.7[CR]- Improved browsing speed[CR]- General tweaks and improvements.[CR]v1.0.6[CR]- Added Guest Login.[CR]- Added Geoblock warning.[CR]v1.0.5[CR]- Fixed Android Login[CR]v1.0.4[CR]- Added Region Selection and Improved Region Filter[CR]- Added Startup Wizard and Improved Login Verification.[CR]v1.0.3[CR]- Fixed Menu and Tweaked cache.[CR]v1.0.2[CR]- Fixed cookie issue on android devices.[CR]- Updated cache life.[CR]v1.0.1[CR]- Fixed login cache issue.</news>
<assets>
<icon>resources/images/icon.png</icon>
<fanart>resources/images/fanart.jpg</fanart>
diff --git a/plugin.video.plutotv/default.py b/plugin.video.plutotv/default.py
index 515dcde..0ebc54d 100644
--- a/plugin.video.plutotv/default.py
+++ b/plugin.video.plutotv/default.py
@@ -17,485 +17,7 @@
# along with PlutoTV. If not, see <http://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
-import os, sys, time, datetime, net, re, traceback
-import urllib, socket, json, urlresolver, collections
-import xbmc, xbmcgui, xbmcplugin, xbmcvfs, xbmcaddon
-from simplecache import SimpleCache
-
-# Plugin Info
-ADDON_ID = 'plugin.video.plutotv'
-REAL_SETTINGS = xbmcaddon.Addon(id=ADDON_ID)
-ADDON_NAME = REAL_SETTINGS.getAddonInfo('name')
-SETTINGS_LOC = REAL_SETTINGS.getAddonInfo('profile')
-ADDON_PATH = REAL_SETTINGS.getAddonInfo('path').decode('utf-8')
-ADDON_VERSION = REAL_SETTINGS.getAddonInfo('version')
-ICON = REAL_SETTINGS.getAddonInfo('icon')
-FANART = REAL_SETTINGS.getAddonInfo('fanart')
-LANGUAGE = REAL_SETTINGS.getLocalizedString
-
-## GLOBALS ##
-TIMEOUT = 15
-USER_EMAIL = REAL_SETTINGS.getSetting('User_Email')
-PASSWORD = REAL_SETTINGS.getSetting('User_Password')
-USER_REGION = REAL_SETTINGS.getSetting("Select_Country")
-FIT_REGION = False if USER_REGION == 'US' else True
-DEBUG = REAL_SETTINGS.getSetting('Enable_Debugging') == 'true'
-COOKIE_JAR = xbmc.translatePath(os.path.join(SETTINGS_LOC, "cookiejar.lwp"))
-PTVL_RUN = xbmcgui.Window(10000).getProperty('PseudoTVRunning') == 'True'
-HIDE_PLUTO = PTVL_RUN
-IGNORE_KEYS = ['pluto.tv','plutotv','pluto tv','promo']
-YTURL = 'plugin://plugin.video.youtube/play/?video_id='
-VMURL = 'plugin://plugin.video.vimeo/play/?video_id='
-BASE_URL = 'http://pluto.tv/'#'http://silo.pluto.tv/'
-BASE_API = 'https://api.pluto.tv/v1'
-BASE_LINEUP = 'https://api.pluto.tv/v1/channels.json'
-BASE_GUIDE = 'https://api.pluto.tv/v1/timelines/%s.000Z/%s.000Z/matrix.json'
-BASE_CLIPS = 'https://api.pluto.tv/v2/episodes/%s/clips.json'
-PLUTO_MENU = [("Channel Guide" , BASE_LINEUP, 0),
- ("Browse Channels", BASE_LINEUP, 1)]
-
-def log(msg, level=xbmc.LOGDEBUG):
- if DEBUG == True:
- if level == xbmc.LOGERROR:
- msg += ' ,' + traceback.format_exc()
- xbmc.log(ADDON_ID + '-' + ADDON_VERSION + '-' + stringify(msg), level)
-
-def stringify(string):
- if isinstance(string, list):
- string = stringify(string[0])
- elif isinstance(string, (int, float, long, complex, bool)):
- string = str(string)
- if isinstance(string, basestring):
- if not isinstance(string, unicode):
- string = unicode(string, 'utf-8')
- elif isinstance(string, unicode):
- string = string.encode('ascii', 'ignore')
- else:
- string = string.encode('utf-8', 'ignore')
- return string
-
-def inputDialog(heading=ADDON_NAME, default='', key=xbmcgui.INPUT_ALPHANUM, opt=0, close=0):
- retval = xbmcgui.Dialog().input(heading, default, key, opt, close)
- if len(retval) > 0:
- return retval
-
-def yesnoDialog(str1, str2='', str3='', header=ADDON_NAME, yes='', no='', autoclose=0):
- return xbmcgui.Dialog().yesno(header, str1, str2, str3, no, yes, autoclose)
-
-def getParams():
- param=[]
- if len(sys.argv[2])>=2:
- params=sys.argv[2]
- cleanedparams=params.replace('?','')
- if (params[len(params)-1]=='/'):
- params=params[0:len(params)-2]
- pairsofparams=cleanedparams.split('&')
- param={}
- for i in range(len(pairsofparams)):
- splitparams={}
- splitparams=pairsofparams[i].split('=')
- if (len(splitparams))==2:
- param[splitparams[0]]=splitparams[1]
- return param
-
-socket.setdefaulttimeout(TIMEOUT)
-class PlutoTV():
- def __init__(self):
- log('__init__')
- self.net = net.Net()
- self.cache = SimpleCache()
- self.categoryMenu = self.getCategories()
- self.mediaType = self.getMediaTypes()
-
-
- def login(self):
- log('login')
- #ignore guest login
- if USER_EMAIL == LANGUAGE(30009):
- return
-
- if len(USER_EMAIL) > 0:
- header_dict = {}
- header_dict['Accept'] = 'application/json, text/javascript, */*; q=0.01'
- header_dict['Host'] = 'api.pluto.tv'
- header_dict['Connection'] = 'keep-alive'
- header_dict['Referer'] = 'http://pluto.tv/'
- header_dict['Origin'] = 'http://pluto.tv'
- header_dict['User-Agent'] = 'Mozilla/5.0 (Windows NT 6.2; rv:24.0) Gecko/20100101 Firefox/24.0'
-
- try:
- #remove COOKIE_JAR Folder
- xbmcvfs.rmdir(COOKIE_JAR)
- except:
- pass
-
- if xbmcvfs.exists(COOKIE_JAR) == False:
- try:
- xbmcvfs.mkdirs(SETTINGS_LOC)
- f = xbmcvfs.File(COOKIE_JAR, 'w')
- f.close()
- except:
- log('login, Unable to create the storage directory', xbmc.LOGERROR)
-
- form_data = ({'optIn': 'true', 'password': PASSWORD,'synced': 'false', 'userIdentity': USER_EMAIL})
- self.net.set_cookies(COOKIE_JAR)
- try:
- loginlink = json.loads(self.net.http_POST(BASE_API + '/auth/local', form_data=form_data, headers=header_dict).content.encode("utf-8").rstrip())
- if loginlink and loginlink['email'].lower() == USER_EMAIL.lower():
- xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30006) + loginlink['displayName'], ICON, 4000)
- self.net.save_cookies(COOKIE_JAR)
- else:
- xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30007), ICON, 4000)
- except Exception,e:
- log('login, Unable to create the storage directory ' + str(e), xbmc.LOGERROR)
-
- else:
- #firstrun wizard
- if yesnoDialog(LANGUAGE(30008),no=LANGUAGE(30009), yes=LANGUAGE(30010)):
- REAL_SETTINGS.setSetting('User_Email',inputDialog(LANGUAGE(30001)))
- REAL_SETTINGS.setSetting('User_Password',inputDialog(LANGUAGE(30002)))
- else:
- REAL_SETTINGS.setSetting('User_Email',LANGUAGE(30009))
- xbmc.executebuiltin('RunScript("' + ADDON_PATH + '/country.py' + '")')
-
-
- def openURL(self, url):
- log('openURL, url = ' + url)
- try:
- header_dict = {}
- header_dict['Accept'] = 'application/json, text/javascript, */*; q=0.01'
- header_dict['Host'] = 'api.pluto.tv'
- header_dict['Connection'] = 'keep-alive'
- header_dict['Referer'] = 'http://pluto.tv/'
- header_dict['Origin'] = 'http://pluto.tv'
- header_dict['User-Agent'] = 'Mozilla/5.0 (Windows NT 6.2; rv:24.0) Gecko/20100101 Firefox/24.0'
- self.net.set_cookies(COOKIE_JAR)
- trans_table = ''.join( [chr(i) for i in range(128)] + [' '] * 128 )
- cacheResponse = self.cache.get(ADDON_NAME + '.openURL, url = %s'%url)
- if not cacheResponse:
- try:
- req = self.net.http_GET(url, headers=header_dict).content.encode("utf-8", 'ignore')
- except:
- req = self.net.http_GET(url, headers=header_dict).content.translate(trans_table)
- self.net.save_cookies(COOKIE_JAR)
- self.cache.set(ADDON_NAME + '.openURL, url = %s'%url, json.loads(stringify(req)), expiration=datetime.timedelta(hours=1))
- return self.cache.get(ADDON_NAME + '.openURL, url = %s'%url)
- except Exception,e:
- log('openURL, Unable to open url ' + str(e), xbmc.LOGERROR)
- xbmcgui.Dialog().notification(ADDON_NAME, 'Unable to Connect, Check User Credentials', ICON, 4000)
- return []
-
-
- def mainMenu(self):
- log('mainMenu')
- self.login()
- for item in PLUTO_MENU:
- self.addDir(*item)
-
-
- def browseMenu(self):
- log('browseMenu')
- for item in self.categoryMenu:
- self.addDir(*item)
-
-
- def getCategories(self):
- log('getCategories')
- collect= []
- lineup = []
- data = self.openURL(BASE_LINEUP)
- for channel in data:
- collect.append(channel['category'])
- counter = collections.Counter(collect)
- for key, value in sorted(counter.iteritems()):
- lineup.append(("%s"%(key), BASE_LINEUP, 2))
- lineup.insert(0,("Featured" , BASE_LINEUP, 2))
- lineup.insert(2,("All Channels", BASE_LINEUP, 2))
- return lineup
-
-
- def getMediaTypes(self):
- mediaType = {}
- for type in self.categoryMenu:
- type = type[0]
- if type == 'Movies':
- mediaType[type] = 'movie'
- elif type == 'TV':
- mediaType[type] = 'episodes'
- elif type == 'Music + Radio':
- mediaType[type] = 'musicvideo'
- else:
- mediaType[type] = 'video'
- return mediaType
-
-
- def browse(self, chname, url):
- log('browse, chname = ' + chname)
- geowarn = False
- data = (self.openURL(url))
- for channel in data:
- id = channel['_id']
- cat = channel['category']
- number = channel['number']
- region = channel['regionFilter']['include']
- exclude = channel['regionFilter']['exclude']
- name = channel['name']
- plot = channel['description']
- feat = (channel.get('featured','') or 0) == -1
-
- if FIT_REGION == True and (USER_REGION in exclude or USER_REGION not in region):
- if geowarn == False:
- geowarn = True
- xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30004), ICON, 4000)
- continue
-
- thumb = ICON
- if 'thumbnail' in channel:
- thumb = (channel['thumbnail']['path'] or ICON)
- land = FANART
- if 'featuredImage' in channel:
- land = (channel['featuredImage']['path'] or FANART)
- logo = ICON
- if 'logo' in channel:
- logo = (channel['logo']['path'] or ICON)
-
- if chname == "All Channels":
- title = "%s - %s: %s" % (cat, number, name)
- infoLabels ={"mediatype":self.mediaType[cat],"label":title ,"title":title ,"plot":plot, "code":number, "genre":cat, "imdbnumber":id}
- infoArt ={"thumb":thumb,"poster":thumb,"fanart":land,"icon":logo,"logo":logo}
- self.addDir(title, id, 8, infoLabels, infoArt)
- elif chname == "Featured" and feat == True:
- title = "%s - %s: %s" % (cat, number, name)
- infoLabels ={"mediatype":self.mediaType[cat],"label":title ,"title":title ,"plot":plot, "code":number, "genre":cat, "imdbnumber":id}
- infoArt ={"thumb":thumb,"poster":thumb,"fanart":land,"icon":logo,"logo":logo}
- self.addDir(title, id, 8, infoLabels, infoArt)
-
- elif chname.lower() == cat.lower():
- title = "%s: %s" % (number, name)
- infoLabels ={"mediatype":self.mediaType[cat],"label":title ,"title":title ,"plot":plot, "code":number, "genre":cat, "imdbnumber":id}
- infoArt ={"thumb":thumb,"poster":thumb,"fanart":land,"icon":logo,"logo":logo}
- self.addDir(title, id, 8, infoLabels, infoArt)
-
-
- def pagination(self, seq, rowlen):
- for start in xrange(0, len(seq), rowlen):
- yield seq[start:start+rowlen]
-
-
- def browseGuide(self, start=0, end=24):
- log('browseGuide')
- geowarn = False
- start = 0 if start == BASE_LINEUP else int(start)
- data = (self.openURL(BASE_LINEUP))
- data = list(self.pagination(data, end))
- start = 0 if start >= len(data) else start
- for channel in data[start]:
- chid = channel['_id']
- chcat = channel['category']
- chnum = channel['number']
- region = channel['regionFilter']['include']
- exclude = channel['regionFilter']['exclude']
- chname = channel['name']
- chplot = channel['description']
- chthumb = (channel['thumbnail']['path'] or ICON)
- feat = (channel.get('featured','') or 0) == -1
-
- if FIT_REGION == True and (USER_REGION in exclude or USER_REGION not in region):
- if geowarn == False:
- geowarn = True
- xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30004), ICON, 4000)
- continue
-
- t1 = datetime.datetime.now().strftime('%Y-%m-%dT%H:00:00')
- t2 = (datetime.datetime.now() + datetime.timedelta(hours=8)).strftime('%Y-%m-%dT%H:00:00')
- link = (self.openURL(BASE_GUIDE % (t1,t2)))
- item = link[chid][0]
- epid = (item['episode']['_id'])
- epname = item['episode']['name']
- epplot = item['episode']['description']
- epgenre = item['episode']['genre']
- epdur = int(item['episode']['duration'] or '0') // 1000
- live = item['episode']['liveBroadcast']
- thumb = chthumb #(item['episode']['thumbnail']['path'] or chthumb) #site doesn't update missing episode thumbs
-
- title = "%s: %s - %s" % (chnum, chname, epname)
- infoLabels ={"mediatype":self.mediaType[chcat],"label":title ,"title":title ,"plot":epplot, "code":epid, "genre":epgenre, "imdbnumber":chid, "duration":epdur}
- infoArt ={"thumb":thumb,"poster":thumb,"fanart":FANART,"icon":ICON,"logo":ICON}
- self.addLink(title, chid, 9, infoLabels, infoArt, end)
- start += 1
- self.addDir('>> Next', '%s'%(start), 0)
-
-
- def resolveURL(self, provider, url):
- log('resolveURL, provider = ' + provider)
- if provider == 'jwplatform' or url[-4:] == 'm3u8':
- return url
- elif provider == 'youtube':
- if len(re.findall('http[s]?://www.youtube.com/watch', url)) > 0:
- return YTURL + url.split('/watch?v=')[1]
- elif len(re.findall('http[s]?://youtu.be/', url)) > 0:
- return YTURL + url.split('/youtu.be/')[1]
- elif provider == 'vimeo':
- if len(re.findall('http[s]?://vimeo.com/', url)) > 0:
- return VMURL + url.split('/vimeo.com/')[1]
- return urlresolver.resolve(url)
-
-
- def playChannel(self, name, url):
- log('playChannel')
- if PTVL_RUN == True:
- return
-
- origurl = url
- playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
- playlist.clear()
-
- t1 = datetime.datetime.now().strftime('%Y-%m-%dT%H:00:00')
- t2 = (datetime.datetime.now() + datetime.timedelta(hours=8)).strftime('%Y-%m-%dT%H:00:00')
- link = (self.openURL(BASE_GUIDE % (t1,t2)))
- item = link[origurl][0]
- id = item['episode']['_id']
- ch_start = datetime.datetime.fromtimestamp(time.mktime(time.strptime(item["start"].replace('.000Z','').replace('T',' '), "%Y-%m-%d %H:%M:%S")))
- ch_timediff = (datetime.datetime.now() - ch_start).seconds
-
- data = (self.openURL(BASE_CLIPS %(id)))
- dur_sum = 0
- for idx, field in enumerate(data):
- url = (field['url'] or field['code'])
- name = field['name']
- thumb = (field['thumbnail'] or ICON)
- provider = field['provider']
- url = self.resolveURL(provider, url)
- dur = int(field['duration'] or '0') // 1000
- dur_start = dur_sum
- dur_sum += dur
-
- if HIDE_PLUTO == True and any(k in name.lower() for k in IGNORE_KEYS):
- continue
-
- liz=xbmcgui.ListItem(name, path=url)
- infoList = {"mediatype":"video","label":name,"title":name,"duration":dur}
- infoArt = {"thumb":thumb,"poster":thumb,"icon":ICON,"fanart":FANART}
- liz.setInfo(type="Video", infoLabels=infoList)
- liz.setArt(infoArt)
- liz.setProperty("IsPlayable","true")
- liz.setProperty("IsInternetStream",str(field['liveBroadcast']).lower())
-
- if dur_start < ch_timediff and dur_sum > ch_timediff:
- vid_offset = ch_timediff - dur_start
- liz.setProperty('ResumeTime', str(vid_offset))
- playlist.add(url, liz, idx)
- xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
-
-
- def playContent(self, name, url):
- log('playContent')
- origurl = url
- t1 = datetime.datetime.now().strftime('%Y-%m-%dT%H:00:00')
- t2 = (datetime.datetime.now() + datetime.timedelta(hours=8)).strftime('%Y-%m-%dT%H:00:00')
- link = (self.openURL(BASE_GUIDE % (t1,t2)))
- item = link[origurl][0]
- id = item['episode']['_id']
- ch_start = datetime.datetime.fromtimestamp(time.mktime(time.strptime(item["start"].replace('.000Z','').replace('T',' '), "%Y-%m-%d %H:%M:%S")))
- ch_timediff = (datetime.datetime.now() - ch_start).seconds
- data = (self.openURL(BASE_CLIPS %(id)))
- dur_sum = 0
-
- for idx, field in enumerate(data):
- url = (field['url'] or field['code'])
- name = field['name']
- thumb = (field['thumbnail'] or ICON)
- provider = field['provider']
- url = self.resolveURL(provider, url)
- dur = int(field['duration'] or '0') // 1000
- dur_start = dur_sum
- dur_sum += dur
-
- if HIDE_PLUTO == True and any(k in name.lower() for k in IGNORE_KEYS):
- continue
-
- liz=xbmcgui.ListItem(name, path=url)
- infoList = {"mediatype":"video","label":name,"title":name,"duration":dur}
- infoArt = {"thumb":thumb,"poster":thumb,"icon":ICON,"fanart":FANART}
- liz.setInfo(type="Video", infoLabels=infoList)
- liz.setArt(infoArt)
- liz.setProperty("IsPlayable","true")
- liz.setProperty("IsInternetStream",str(field['liveBroadcast']).lower())
-
- if dur_start < ch_timediff and dur_sum > ch_timediff:
- vid_offset = ch_timediff - dur_start
- liz.setProperty('ResumeTime', str(vid_offset) )
- self.addLink(name, url, 7, infoList, infoArt, len(data))
-
-
- def playVideo(self, name, url, list=None):
- log('playVideo')
- if not list:
- list = xbmcgui.ListItem(name, path=url)
- xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, list)
-
-
- def addLink(self, name, u, mode, infoList=False, infoArt=False, total=0):
- name = stringify(name)
- log('addLink, name = ' + name)
- liz=xbmcgui.ListItem(name)
- liz.setProperty('IsPlayable', 'true')
- if infoList == False:
- liz.setInfo(type="Video", infoLabels={"mediatype":"video","label":name,"title":name})
- else:
- liz.setInfo(type="Video", infoLabels=infoList)
-
- if infoArt == False:
- liz.setArt({'thumb':ICON,'fanart':FANART})
- else:
- liz.setArt(infoArt)
- u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
- xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,totalItems=total)
-
-
- def addDir(self, name, u, mode, infoList=False, infoArt=False):
- name = stringify(name)
- log('addDir, name = ' + name)
- liz=xbmcgui.ListItem(name)
- liz.setProperty('IsPlayable', 'false')
- if infoList == False:
- liz.setInfo(type="Video", infoLabels={"mediatype":"video","label":name,"title":name} )
- else:
- liz.setInfo(type="Video", infoLabels=infoList)
- if infoArt == False:
- liz.setArt({'thumb':ICON,'fanart':FANART})
- else:
- liz.setArt(infoArt)
- u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
- xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
-
-params=getParams()
-try:
- url=urllib.unquote_plus(params["url"])
-except:
- url=None
-try:
- name=urllib.unquote_plus(params["name"])
-except:
- name=None
-try:
- mode=int(params["mode"])
-except:
- mode=None
-
-log("Mode: "+str(mode))
-log("URL : "+str(url))
-log("Name: "+str(name))
-
-if mode==None: PlutoTV().mainMenu()
-elif mode == 0: PlutoTV().browseGuide(url)
-elif mode == 1: PlutoTV().browseMenu()
-elif mode == 2: PlutoTV().browse(name, url)
-elif mode == 7: PlutoTV().playVideo(name, url)
-elif mode == 8: PlutoTV().playContent(name, url)
-elif mode == 9: PlutoTV().playChannel(name, url)
-
-xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_NONE )
-xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_LABEL )
-xbmcplugin.endOfDirectory(int(sys.argv[1]),cacheToDisc=True) \ No newline at end of file
+#entrypoint
+if __name__ == '__main__':
+ from resources.lib import plutotv \ No newline at end of file
diff --git a/plugin.video.plutotv/resources/__init__.py b/plugin.video.plutotv/resources/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.plutotv/resources/__init__.py
diff --git a/plugin.video.plutotv/resources/lib/__init__.py b/plugin.video.plutotv/resources/lib/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.plutotv/resources/lib/__init__.py
diff --git a/plugin.video.plutotv/resources/lib/plutotv.py b/plugin.video.plutotv/resources/lib/plutotv.py
new file mode 100644
index 0000000..bcc7388
--- /dev/null
+++ b/plugin.video.plutotv/resources/lib/plutotv.py
@@ -0,0 +1,493 @@
+# Copyright (C) 2017 Lunatixz
+#
+#
+# This file is part of PlutoTV.
+#
+# PlutoTV is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# PlutoTV is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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 PlutoTV. If not, see <http://www.gnu.org/licenses/>.
+
+# -*- coding: utf-8 -*-
+import os, sys, time, datetime, net, re, traceback
+import urllib, socket, json, urlresolver, collections
+import xbmc, xbmcgui, xbmcplugin, xbmcvfs, xbmcaddon
+
+from simplecache import SimpleCache
+
+# Plugin Info
+ADDON_ID = 'plugin.video.plutotv'
+REAL_SETTINGS = xbmcaddon.Addon(id=ADDON_ID)
+ADDON_NAME = REAL_SETTINGS.getAddonInfo('name')
+SETTINGS_LOC = REAL_SETTINGS.getAddonInfo('profile')
+ADDON_PATH = REAL_SETTINGS.getAddonInfo('path').decode('utf-8')
+ADDON_VERSION = REAL_SETTINGS.getAddonInfo('version')
+ICON = REAL_SETTINGS.getAddonInfo('icon')
+FANART = REAL_SETTINGS.getAddonInfo('fanart')
+LANGUAGE = REAL_SETTINGS.getLocalizedString
+
+## GLOBALS ##
+TIMEOUT = 15
+USER_EMAIL = REAL_SETTINGS.getSetting('User_Email')
+PASSWORD = REAL_SETTINGS.getSetting('User_Password')
+USER_REGION = REAL_SETTINGS.getSetting("Select_Country")
+FIT_REGION = False if USER_REGION == 'US' else True
+DEBUG = REAL_SETTINGS.getSetting('Enable_Debugging') == 'true'
+COOKIE_JAR = xbmc.translatePath(os.path.join(SETTINGS_LOC, "cookiejar.lwp"))
+PTVL_RUN = xbmcgui.Window(10000).getProperty('PseudoTVRunning') == 'True'
+HIDE_PLUTO = PTVL_RUN
+IGNORE_KEYS = ['pluto.tv','plutotv','pluto tv','promo']
+YTURL = 'plugin://plugin.video.youtube/play/?video_id='
+VMURL = 'plugin://plugin.video.vimeo/play/?video_id='
+BASE_URL = 'http://pluto.tv/'#'http://silo.pluto.tv/'
+BASE_API = 'https://api.pluto.tv/v1'
+BASE_LINEUP = 'https://api.pluto.tv/v1/channels.json'
+BASE_GUIDE = 'https://api.pluto.tv/v1/timelines/%s.000Z/%s.000Z/matrix.json'
+BASE_CLIPS = 'https://api.pluto.tv/v2/episodes/%s/clips.json'
+PLUTO_MENU = [("Channel Guide" , BASE_LINEUP, 0),
+ ("Browse Channels", BASE_LINEUP, 1)]
+
+def log(msg, level=xbmc.LOGDEBUG):
+ if DEBUG == True:
+ if level == xbmc.LOGERROR:
+ msg += ' ,' + traceback.format_exc()
+ xbmc.log(ADDON_ID + '-' + ADDON_VERSION + '-' + msg, level)
+
+def inputDialog(heading=ADDON_NAME, default='', key=xbmcgui.INPUT_ALPHANUM, opt=0, close=0):
+ retval = xbmcgui.Dialog().input(heading, default, key, opt, close)
+ if len(retval) > 0:
+ return retval
+
+def yesnoDialog(str1, str2='', str3='', header=ADDON_NAME, yes='', no='', autoclose=0):
+ return xbmcgui.Dialog().yesno(header, str1, str2, str3, no, yes, autoclose)
+
+def getParams():
+ param=[]
+ if len(sys.argv[2])>=2:
+ params=sys.argv[2]
+ cleanedparams=params.replace('?','')
+ if (params[len(params)-1]=='/'):
+ params=params[0:len(params)-2]
+ pairsofparams=cleanedparams.split('&')
+ param={}
+ for i in range(len(pairsofparams)):
+ splitparams={}
+ splitparams=pairsofparams[i].split('=')
+ if (len(splitparams))==2:
+ param[splitparams[0]]=splitparams[1]
+ return param
+
+socket.setdefaulttimeout(TIMEOUT)
+class PlutoTV():
+ def __init__(self):
+ log('__init__')
+ self.net = net.Net()
+ self.cache = SimpleCache()
+ self.categoryMenu = self.getCategories()
+ self.mediaType = self.getMediaTypes()
+
+
+ def login(self):
+ log('login')
+ #ignore guest login
+ if USER_EMAIL == LANGUAGE(30009):
+ return
+
+ if len(USER_EMAIL) > 0:
+ header_dict = {}
+ header_dict['Accept'] = 'application/json, text/javascript, */*; q=0.01'
+ header_dict['Host'] = 'api.pluto.tv'
+ header_dict['Connection'] = 'keep-alive'
+ header_dict['Referer'] = 'http://pluto.tv/'
+ header_dict['Origin'] = 'http://pluto.tv'
+ header_dict['User-Agent'] = 'Mozilla/5.0 (Windows NT 6.2; rv:24.0) Gecko/20100101 Firefox/24.0'
+
+ try:
+ #remove COOKIE_JAR Folder
+ xbmcvfs.rmdir(COOKIE_JAR)
+ except:
+ pass
+
+ if xbmcvfs.exists(COOKIE_JAR) == False:
+ try:
+ xbmcvfs.mkdirs(SETTINGS_LOC)
+ f = xbmcvfs.File(COOKIE_JAR, 'w')
+ f.close()
+ except:
+ log('login, Unable to create the storage directory', xbmc.LOGERROR)
+
+ form_data = ({'optIn': 'true', 'password': PASSWORD,'synced': 'false', 'userIdentity': USER_EMAIL})
+ self.net.set_cookies(COOKIE_JAR)
+ try:
+ loginlink = json.loads(self.net.http_POST(BASE_API + '/auth/local', form_data=form_data, headers=header_dict).content.encode("utf-8").rstrip())
+ if loginlink and loginlink['email'].lower() == USER_EMAIL.lower():
+ xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30006) + loginlink['displayName'], ICON, 4000)
+ self.net.save_cookies(COOKIE_JAR)
+ else:
+ xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30007), ICON, 4000)
+ except Exception,e:
+ log('login, Unable to create the storage directory ' + str(e), xbmc.LOGERROR)
+
+ else:
+ #firstrun wizard
+ if yesnoDialog(LANGUAGE(30008),no=LANGUAGE(30009), yes=LANGUAGE(30010)):
+ REAL_SETTINGS.setSetting('User_Email',inputDialog(LANGUAGE(30001)))
+ REAL_SETTINGS.setSetting('User_Password',inputDialog(LANGUAGE(30002)))
+ else:
+ REAL_SETTINGS.setSetting('User_Email',LANGUAGE(30009))
+ xbmc.executebuiltin('RunScript("' + ADDON_PATH + '/country.py' + '")')
+
+
+ def openURL(self, url):
+ log('openURL, url = ' + url)
+ try:
+ header_dict = {}
+ header_dict['Accept'] = 'application/json, text/javascript, */*; q=0.01'
+ header_dict['Host'] = 'api.pluto.tv'
+ header_dict['Connection'] = 'keep-alive'
+ header_dict['Referer'] = 'http://pluto.tv/'
+ header_dict['Origin'] = 'http://pluto.tv'
+ header_dict['User-Agent'] = 'Mozilla/5.0 (Windows NT 6.2; rv:24.0) Gecko/20100101 Firefox/24.0'
+ self.net.set_cookies(COOKIE_JAR)
+ trans_table = ''.join( [chr(i) for i in range(128)] + [' '] * 128 )
+ cacheResponse = self.cache.get(ADDON_NAME + '.openURL, url = %s'%url)
+ if not cacheResponse:
+ try:
+ req = self.net.http_GET(url, headers=header_dict).content.encode("utf-8", 'ignore')
+ except:
+ req = (self.net.http_GET(url, headers=header_dict).content.translate(trans_table)).encode("utf-8")
+ self.net.save_cookies(COOKIE_JAR)
+ self.cache.set(ADDON_NAME + '.openURL, url = %s'%url, req, expiration=datetime.timedelta(hours=1))
+ response = self.cache.get(ADDON_NAME + '.openURL, url = %s'%url)
+ if isinstance(response, basestring):
+ response = json.loads(response)
+ return response
+ except Exception,e:
+ log('openURL, Unable to open url ' + str(e), xbmc.LOGERROR)
+ xbmcgui.Dialog().notification(ADDON_NAME, 'Unable to Connect, Check User Credentials', ICON, 4000)
+ return []
+
+
+ def mainMenu(self):
+ log('mainMenu')
+ self.login()
+ for item in PLUTO_MENU:
+ self.addDir(*item)
+
+
+ def browseMenu(self):
+ log('browseMenu')
+ for item in self.categoryMenu:
+ self.addDir(*item)
+
+
+ def getCategories(self):
+ log('getCategories')
+ collect= []
+ lineup = []
+ data = self.openURL(BASE_LINEUP)
+ for channel in data:
+ collect.append(channel['category'])
+ counter = collections.Counter(collect)
+ for key, value in sorted(counter.iteritems()):
+ lineup.append(("%s"%(key), BASE_LINEUP, 2))
+ lineup.insert(0,("Featured" , BASE_LINEUP, 2))
+ lineup.insert(2,("All Channels", BASE_LINEUP, 2))
+ return lineup
+
+
+ def getMediaTypes(self):
+ mediaType = {}
+ for type in self.categoryMenu:
+ type = type[0]
+ if type == 'Movies':
+ mediaType[type] = 'movie'
+ elif type == 'TV':
+ mediaType[type] = 'episodes'
+ elif type == 'Music + Radio':
+ mediaType[type] = 'musicvideo'
+ else:
+ mediaType[type] = 'video'
+ return mediaType
+
+
+ def browse(self, chname, url):
+ log('browse, chname = ' + chname)
+ geowarn = False
+ data = (self.openURL(url))
+ for channel in data:
+ id = channel['_id']
+ cat = channel['category']
+ number = channel['number']
+ region = channel['regionFilter']['include']
+ exclude = channel['regionFilter']['exclude']
+ name = channel['name']
+ plot = channel['description']
+ feat = (channel.get('featured','') or 0) == -1
+
+ if FIT_REGION == True and (USER_REGION in exclude or USER_REGION not in region):
+ if geowarn == False:
+ geowarn = True
+ xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30004), ICON, 4000)
+ continue
+
+ thumb = ICON
+ if 'thumbnail' in channel:
+ thumb = (channel['thumbnail'].get('path',ICON) or ICON)
+ land = FANART
+ if 'featuredImage' in channel:
+ land = (channel['featuredImage'].get('path',FANART) or FANART)
+ logo = ICON
+ if 'logo' in channel:
+ logo = (channel['logo']['path'] or ICON)
+
+ if chname == "All Channels":
+ title = "%s - %s: %s" % (cat, number, name)
+ infoLabels ={"mediatype":self.mediaType[cat],"label":title ,"title":title ,"plot":plot, "code":number, "genre":cat, "imdbnumber":id}
+ infoArt ={"thumb":thumb,"poster":thumb,"fanart":land,"icon":logo,"logo":logo}
+ self.addDir(title, id, 8, infoLabels, infoArt)
+ elif chname == "Featured" and feat == True:
+ title = "%s - %s: %s" % (cat, number, name)
+ infoLabels ={"mediatype":self.mediaType[cat],"label":title ,"title":title ,"plot":plot, "code":number, "genre":cat, "imdbnumber":id}
+ infoArt ={"thumb":thumb,"poster":thumb,"fanart":land,"icon":logo,"logo":logo}
+ self.addDir(title, id, 8, infoLabels, infoArt)
+
+ elif chname.lower() == cat.lower():
+ title = "%s: %s" % (number, name)
+ infoLabels ={"mediatype":self.mediaType[cat],"label":title ,"title":title ,"plot":plot, "code":number, "genre":cat, "imdbnumber":id}
+ infoArt ={"thumb":thumb,"poster":thumb,"fanart":land,"icon":logo,"logo":logo}
+ self.addDir(title, id, 8, infoLabels, infoArt)
+
+
+ def pagination(self, seq, rowlen):
+ for start in xrange(0, len(seq), rowlen):
+ yield seq[start:start+rowlen]
+
+
+ def browseGuide(self, start=0, end=14):
+ log('browseGuide')
+ geowarn = False
+ start = 0 if start == BASE_LINEUP else int(start)
+ data = (self.openURL(BASE_LINEUP))
+ data = list(self.pagination(data, end))
+ start = 0 if start >= len(data) else start
+ for channel in data[start]:
+ chid = channel['_id']
+ chcat = channel['category']
+ chnum = channel['number']
+ region = channel['regionFilter']['include']
+ exclude = channel['regionFilter']['exclude']
+ chname = channel['name']
+ chplot = channel['description']
+ chthumb = ICON
+ if 'thumbnail' in channel:
+ chthumb = (channel['thumbnail'].get('path',ICON) or ICON)
+ feat = (channel.get('featured','') or 0) == -1
+
+ if FIT_REGION == True and (USER_REGION in exclude or USER_REGION not in region):
+ if geowarn == False:
+ geowarn = True
+ xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30004), ICON, 4000)
+ continue
+
+ t1 = datetime.datetime.now().strftime('%Y-%m-%dT%H:00:00')
+ t2 = (datetime.datetime.now() + datetime.timedelta(hours=8)).strftime('%Y-%m-%dT%H:00:00')
+ link = (self.openURL(BASE_GUIDE % (t1,t2)))
+ item = link[chid][0]
+ epid = (item['episode']['_id'])
+ epname = item['episode']['name']
+ epplot = item['episode']['description']
+ epgenre = item['episode']['genre']
+ epdur = int(item['episode']['duration'] or '0') // 1000
+ live = item['episode']['liveBroadcast']
+ thumb = chthumb #(item['episode']['thumbnail']['path'] or chthumb) #site doesn't update missing episode thumbs
+
+ title = "%s: %s - %s" % (chnum, chname, epname)
+ infoLabels ={"mediatype":self.mediaType[chcat],"label":title ,"title":title ,"plot":epplot, "code":epid, "genre":epgenre, "imdbnumber":chid, "duration":epdur}
+ infoArt ={"thumb":thumb,"poster":thumb,"fanart":FANART,"icon":ICON,"logo":ICON}
+ self.addLink(title, chid, 9, infoLabels, infoArt, end)
+ start += 1
+ self.addDir('>> Next', '%s'%(start), 0)
+
+
+ def resolveURL(self, provider, url):
+ log('resolveURL, provider = ' + provider)
+ if provider == 'jwplatform' or url[-4:] == 'm3u8':
+ return url
+ elif provider == 'youtube':
+ if len(re.findall('http[s]?://www.youtube.com/watch', url)) > 0:
+ return YTURL + url.split('/watch?v=')[1]
+ elif len(re.findall('http[s]?://youtu.be/', url)) > 0:
+ return YTURL + url.split('/youtu.be/')[1]
+ elif provider == 'vimeo':
+ if len(re.findall('http[s]?://vimeo.com/', url)) > 0:
+ return VMURL + url.split('/vimeo.com/')[1]
+ return urlresolver.resolve(url)
+
+
+ def playChannel(self, name, url):
+ log('playChannel')
+ if PTVL_RUN == True:
+ return
+
+ origurl = url
+ playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
+ playlist.clear()
+
+ t1 = datetime.datetime.now().strftime('%Y-%m-%dT%H:00:00')
+ t2 = (datetime.datetime.now() + datetime.timedelta(hours=8)).strftime('%Y-%m-%dT%H:00:00')
+ link = (self.openURL(BASE_GUIDE % (t1,t2)))
+ item = link[origurl][0]
+ id = item['episode']['_id']
+ ch_start = datetime.datetime.fromtimestamp(time.mktime(time.strptime((item["start"].split('.')[0]), "%Y-%m-%dT%H:%M:%S")))
+ ch_timediff = (datetime.datetime.now() - ch_start).seconds
+
+ data = (self.openURL(BASE_CLIPS %(id)))
+ dur_sum = 0
+ for idx, field in enumerate(data):
+ url = (field['url'] or field['code'])
+ name = field['name']
+ thumb = (field['thumbnail'] or ICON)
+ provider = field['provider']
+ url = self.resolveURL(provider, url)
+ dur = int(field['duration'] or '0') // 1000
+ dur_start = dur_sum
+ dur_sum += dur
+
+ if HIDE_PLUTO == True and any(k in name.lower() for k in IGNORE_KEYS):
+ continue
+
+ liz=xbmcgui.ListItem(name, path=url)
+ infoList = {"mediatype":"video","label":name,"title":name,"duration":dur}
+ infoArt = {"thumb":thumb,"poster":thumb,"icon":ICON,"fanart":FANART}
+ liz.setInfo(type="Video", infoLabels=infoList)
+ liz.setArt(infoArt)
+ liz.setProperty("IsPlayable","true")
+ liz.setProperty("IsInternetStream",str(field['liveBroadcast']).lower())
+
+ if dur_start < ch_timediff and dur_sum > ch_timediff:
+ vid_offset = ch_timediff - dur_start
+ liz.setProperty('ResumeTime', str(vid_offset))
+ if len(data) > 1:
+ playlist.add(url, liz, idx)
+ xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
+
+
+ def playContent(self, name, url):
+ log('playContent')
+ origurl = url
+ t1 = datetime.datetime.now().strftime('%Y-%m-%dT%H:00:00')
+ t2 = (datetime.datetime.now() + datetime.timedelta(hours=8)).strftime('%Y-%m-%dT%H:00:00')
+ link = (self.openURL(BASE_GUIDE % (t1,t2)))
+ item = link[origurl][0]
+ id = item['episode']['_id']
+ ch_start = datetime.datetime.fromtimestamp(time.mktime(time.strptime((item["start"].split('.')[0]), "%Y-%m-%dT%H:%M:%S")))
+ ch_timediff = (datetime.datetime.now() - ch_start).seconds
+ data = (self.openURL(BASE_CLIPS %(id)))
+ dur_sum = 0
+
+ for idx, field in enumerate(data):
+ url = (field['url'] or field['code'])
+ name = field['name']
+ thumb = (field['thumbnail'] or ICON)
+ provider = field['provider']
+ url = self.resolveURL(provider, url)
+ dur = int(field['duration'] or '0') // 1000
+ dur_start = dur_sum
+ dur_sum += dur
+
+ if HIDE_PLUTO == True and any(k in name.lower() for k in IGNORE_KEYS):
+ continue
+
+ liz=xbmcgui.ListItem(name, path=url)
+ infoList = {"mediatype":"video","label":name,"title":name,"duration":dur}
+ infoArt = {"thumb":thumb,"poster":thumb,"icon":ICON,"fanart":FANART}
+ liz.setInfo(type="Video", infoLabels=infoList)
+ liz.setArt(infoArt)
+ liz.setProperty("IsPlayable","true")
+ liz.setProperty("IsInternetStream",str(field['liveBroadcast']).lower())
+
+ if dur_start < ch_timediff and dur_sum > ch_timediff:
+ vid_offset = ch_timediff - dur_start
+ liz.setProperty('ResumeTime', str(vid_offset) )
+ self.addLink(name, url, 7, infoList, infoArt, len(data))
+
+
+ def playVideo(self, name, url, list=None):
+ log('playVideo')
+ if not list:
+ list = xbmcgui.ListItem(name, path=url)
+ xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, list)
+
+
+ def addLink(self, name, u, mode, infoList=False, infoArt=False, total=0):
+ name = name.encode("utf-8")
+ log('addLink, name = ' + name)
+ liz=xbmcgui.ListItem(name)
+ liz.setProperty('IsPlayable', 'true')
+ if infoList == False:
+ liz.setInfo(type="Video", infoLabels={"mediatype":"video","label":name,"title":name})
+ else:
+ liz.setInfo(type="Video", infoLabels=infoList)
+
+ if infoArt == False:
+ liz.setArt({'thumb':ICON,'fanart':FANART})
+ else:
+ liz.setArt(infoArt)
+ u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
+ xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,totalItems=total)
+
+
+ def addDir(self, name, u, mode, infoList=False, infoArt=False):
+ name = name.encode("utf-8")
+ log('addDir, name = ' + name)
+ liz=xbmcgui.ListItem(name)
+ liz.setProperty('IsPlayable', 'false')
+ if infoList == False:
+ liz.setInfo(type="Video", infoLabels={"mediatype":"video","label":name,"title":name} )
+ else:
+ liz.setInfo(type="Video", infoLabels=infoList)
+ if infoArt == False:
+ liz.setArt({'thumb':ICON,'fanart':FANART})
+ else:
+ liz.setArt(infoArt)
+ u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
+ xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
+
+params=getParams()
+try:
+ url=urllib.unquote_plus(params["url"])
+except:
+ url=None
+try:
+ name=urllib.unquote_plus(params["name"])
+except:
+ name=None
+try:
+ mode=int(params["mode"])
+except:
+ mode=None
+
+log("Mode: "+str(mode))
+log("URL : "+str(url))
+log("Name: "+str(name))
+
+if mode==None: PlutoTV().mainMenu()
+elif mode == 0: PlutoTV().browseGuide(url)
+elif mode == 1: PlutoTV().browseMenu()
+elif mode == 2: PlutoTV().browse(name, url)
+elif mode == 7: PlutoTV().playVideo(name, url)
+elif mode == 8: PlutoTV().playContent(name, url)
+elif mode == 9: PlutoTV().playChannel(name, url)
+
+xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_NONE )
+xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_LABEL )
+xbmcplugin.endOfDirectory(int(sys.argv[1]),cacheToDisc=True) \ No newline at end of file
diff --git a/plugin.video.psvue/addon.xml b/plugin.video.psvue/addon.xml
index b932f84..e467072 100644
--- a/plugin.video.psvue/addon.xml
+++ b/plugin.video.psvue/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.video.psvue" name="PS Vue" version="2017.7.2" provider-name="eracknaphobia">
+<addon id="plugin.video.psvue" name="PS Vue" version="2017.10.10" provider-name="eracknaphobia">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
<import addon="script.module.requests" version="2.9.1"/>
@@ -13,7 +13,7 @@
<description lang="en_GB">PlayStation™Vue is a TV service that streams live TV, movies, and sports on a variety of your favorite devices without a cable or satellite subscription. With powerful features that allow you to save thousands of hours of your favorite shows without recording conflicts, and Premium channels that can be purchased individually or with a multi-channel plan, TV has never been the same. No annual contracts, no conflicts, no problems.</description>
<disclaimer lang="en_GB">Requires a valid subscription to PS Vue which is currently only available in the US</disclaimer>
<news>
-- Bug fix
+- Fix Login Errors
</news>
<language>en</language>
<platform>all</platform>
diff --git a/plugin.video.psvue/main.py b/plugin.video.psvue/main.py
index d6e68b9..48fb34b 100644
--- a/plugin.video.psvue/main.py
+++ b/plugin.video.psvue/main.py
@@ -4,29 +4,35 @@ params=get_params()
url=None
name=None
mode=None
-show_id=None
-
-try:
- url=urllib.unquote_plus(params["url"])
-except:
- pass
-try:
- name=urllib.unquote_plus(params["name"])
-except:
- pass
-try:
- mode=int(params["mode"])
-except:
- pass
-try:
- show_id=params["show_id"]
-except:
- pass
+airing_id='null'
+channel_id='null'
+program_id='null'
+series_id='null'
+tms_id='null'
+
+try: url=urllib.unquote_plus(params["url"])
+except: pass
+try: name=urllib.unquote_plus(params["name"])
+except: pass
+try: mode=int(params["mode"])
+except: pass
+try: airing_id=params["airing_id"]
+except: pass
+try: channel_id=params["channel_id"]
+except: pass
+try: program_id=params["program_id"]
+except: pass
+try: series_id=params["series_id"]
+except: pass
+try: tms_id=params["tms_id"]
+except: pass
check_device_id()
+
sony = SONY()
+
if mode < 998:
if ADDON.getSetting(id='last_auth') != '':
last_auth = stringToDate(ADDON.getSetting(id='last_auth'), "%Y-%m-%dT%H:%M:%S.%fZ")
@@ -34,10 +40,14 @@ if mode < 998:
else:
sony.check_auth()
+
if mode == None and mode < 998:
- if ADDON.getSetting(id='default_profile') == '': sony.get_profiles()
+ if ADDON.getSetting(id='default_profile') == '' or ADDON.getSetting(id='always_ask_profile') == 'true': sony.get_profiles()
main_menu()
+elif mode == 30:
+ all_channels()
+
elif mode == 50:
timeline()
@@ -45,7 +55,7 @@ elif mode == 100:
my_shows()
elif mode == 150:
- list_episodes(show_id)
+ list_episodes(program_id)
elif mode == 200:
favorite_channels()
@@ -53,6 +63,9 @@ elif mode == 200:
elif mode == 300:
live_tv()
+elif mode == 350:
+ on_demand(channel_id)
+
elif mode == 400:
sports()
@@ -65,12 +78,16 @@ elif mode == 600:
elif mode == 700:
featured()
+elif mode == 750:
+ search()
+
elif mode == 800:
sony.get_profiles()
main_menu()
elif mode == 900:
- get_stream(url)
+ get_stream(url, airing_id, channel_id, program_id, series_id, tms_id)
+
elif mode == 998:
sys.exit()
@@ -85,7 +102,26 @@ elif mode == 1000:
ADDON.setSetting(id='deviceId', value='')
sony.notification_msg(LOCAL_STRING(30006), LOCAL_STRING(30007))
-if mode != None and mode != 800:
+elif mode == 1001:
+ ids ={
+ 'channel_id': channel_id,
+ 'program_id': program_id,
+ 'series_id': series_id,
+ 'tms_id': tms_id
+ }
+ sony.add_to_favorites(ids)
+
+elif mode == 1002:
+ ids ={
+ 'channel_id': channel_id,
+ 'program_id': program_id,
+ 'series_id': series_id,
+ 'tms_id': tms_id
+ }
+ sony.remove_from_favorites(ids)
+
+
+if mode != None and mode != 800 and mode != 750:
xbmcplugin.endOfDirectory(addon_handle, cacheToDisc=False)
elif mode == 800:
xbmcplugin.endOfDirectory(addon_handle, updateListing=True)
diff --git a/plugin.video.psvue/resources/language/resource.language.en_gb/strings.po b/plugin.video.psvue/resources/language/resource.language.en_gb/strings.po
index 65ca71d..a39fc08 100644
--- a/plugin.video.psvue/resources/language/resource.language.en_gb/strings.po
+++ b/plugin.video.psvue/resources/language/resource.language.en_gb/strings.po
@@ -33,7 +33,7 @@ msgid "Logout"
msgstr ""
msgctxt "#30004"
-msgid "Change Profile"
+msgid "Set Default Profile"
msgstr ""
msgctxt "#30005"
@@ -121,7 +121,62 @@ msgctxt "#30209"
msgid "Could not retrieve the reqpayload"
msgstr ""
-
msgctxt "#30210"
msgid "Choose Profile"
msgstr ""
+
+msgctxt "#30211"
+msgid "Search"
+msgstr ""
+
+msgctxt "#30212"
+msgid "Profile"
+msgstr ""
+
+msgctxt "#30213"
+msgid "Always Ask Profile"
+msgstr ""
+
+msgctxt "#30214"
+msgid "Timeline"
+msgstr ""
+
+msgctxt "#30215"
+msgid "My Shows"
+msgstr ""
+
+msgctxt "#30216"
+msgid "Favorite Channels"
+msgstr ""
+
+msgctxt "#30217"
+msgid "Live TV"
+msgstr ""
+
+msgctxt "#30218"
+msgid "Sports"
+msgstr ""
+
+msgctxt "#30219"
+msgid "Kids"
+msgstr ""
+
+msgctxt "#30220"
+msgid "Recently Watched"
+msgstr ""
+
+msgctxt "#30221"
+msgid "Featured"
+msgstr ""
+
+msgctxt "#30222"
+msgid "Search"
+msgstr ""
+
+msgctxt "#30223"
+msgid "Main Menu"
+msgstr ""
+
+msgctxt "#30224"
+msgid "All Channels"
+msgstr ""
diff --git a/plugin.video.psvue/resources/lib/ps_vue.py b/plugin.video.psvue/resources/lib/ps_vue.py
index 9a54770..280406b 100644
--- a/plugin.video.psvue/resources/lib/ps_vue.py
+++ b/plugin.video.psvue/resources/lib/ps_vue.py
@@ -10,14 +10,21 @@ from sony import SONY
def main_menu():
- addDir(LOCAL_STRING(30100), 50, ICON)
- addDir(LOCAL_STRING(30101), 100, ICON)
- addDir(LOCAL_STRING(30102), 200, ICON)
- addDir(LOCAL_STRING(30103), 300, ICON)
- addDir(LOCAL_STRING(30104), 400, ICON)
- addDir(LOCAL_STRING(30105), 500, ICON)
- addDir(LOCAL_STRING(30106), 600, ICON)
- addDir(LOCAL_STRING(30107), 700, ICON)
+ if ADDON.getSetting(id='all_chan_visible') == 'true': addDir(LOCAL_STRING(30224), 30, ICON)
+ if ADDON.getSetting(id='timeline_visible') == 'true': addDir(LOCAL_STRING(30100), 50, ICON)
+ if ADDON.getSetting(id='myshows_visible') == 'true': addDir(LOCAL_STRING(30101), 100, ICON)
+ if ADDON.getSetting(id='fav_visible') == 'true': addDir(LOCAL_STRING(30102), 200, ICON)
+ if ADDON.getSetting(id='live_visible') == 'true': addDir(LOCAL_STRING(30103), 300, ICON)
+ if ADDON.getSetting(id='sports_visible') == 'true': addDir(LOCAL_STRING(30104), 400, ICON)
+ if ADDON.getSetting(id='kids_visible') == 'true': addDir(LOCAL_STRING(30105), 500, ICON)
+ if ADDON.getSetting(id='recent_visible') == 'true': addDir(LOCAL_STRING(30106), 600, ICON)
+ if ADDON.getSetting(id='featured_visible') == 'true': addDir(LOCAL_STRING(30107), 700, ICON)
+ if ADDON.getSetting(id='search_visible') == 'true': addDir(LOCAL_STRING(30211), 750, ICON)
+
+
+def all_channels():
+ json_source = get_json(EPG_URL + '/browse/items/channels/filter/all/sort/channeltype/offset/0/size/500')
+ list_channels(json_source['body']['items'])
def timeline():
@@ -25,19 +32,23 @@ def timeline():
def my_shows():
- json_source = get_json(EPG_URL + '/browse/items/favorites/filter/shows/sort/title/offset/0/size/100')
+ json_source = get_json(EPG_URL + '/browse/items/favorites/filter/shows/sort/title/offset/0/size/500')
list_shows(json_source['body']['items'])
def favorite_channels():
- json_source = get_json(EPG_URL + '/browse/items/favorites/filter/channels/sort/name/offset/0/size/100')
+ json_source = get_json(EPG_URL + '/browse/items/favorites/filter/channels/sort/name/offset/0/size/500')
list_channels(json_source['body']['items'])
def live_tv():
- json_source = get_json(EPG_URL + '/browse/items/now_playing/filter/all/sort/channel/offset/0/size/100')
+ json_source = get_json(EPG_URL + '/browse/items/now_playing/filter/all/sort/channel/offset/0/size/500')
list_channels(json_source['body']['items'])
+def on_demand(channel_id):
+ json_source = get_json(EPG_URL + '/details/channel/'+channel_id+'/popular/offset/0/size/500')
+ list_shows(json_source['body']['popular'])
+
def sports():
json_source = get_json(EPG_URL + '/programs?size=10&offset=0&filter=ds-sports')
@@ -59,6 +70,14 @@ def featured():
list_shows(json_source['body']['items'])
+def search():
+ dialog = xbmcgui.Dialog()
+ search_txt = dialog.input('Enter search text', type=xbmcgui.INPUT_ALPHANUM)
+ if search_txt == '': sys.exit()
+ json_source = get_json(EPG_URL + '/search/'+search_txt+'/offset/0/size/100')
+ list_shows(json_source['body']['programs'])
+
+
def list_timeline():
url = 'https://sentv-user-ext.totsuko.tv/sentv_user_ext/ws/v2/profile/ids'
json_source = get_json(url)
@@ -99,7 +118,15 @@ def list_show(show):
if image['width'] >= 1080: fanart = image['src']
if icon != ICON and fanart != FANART: break
title = show['title']
- show_id = str(show['id'])
+
+ airing_id = 'null'
+ if 'airing_id' in show: airing_id = str(show['airing_id'])
+ channel_id = 'null'
+ if 'channel_id' in show: channel_id = str(show['channel_id'])
+ program_id = str(show['id'])
+ series_id = 'null'
+ if 'series_id' in show: series_id = str(show['series_id'])
+ tms_id = str(show['tms_id'])
genre = ''
for item in show['genres']:
@@ -109,20 +136,27 @@ def list_show(show):
plot = get_dict_item('series_synopsis', show)
if plot == '': plot = get_dict_item('synopsis', show)
+ info = {
+ 'plot': plot,
+ 'tvshowtitle': title,
+ 'title': title,
+ 'originaltitle': title,
+ 'genre': genre
+ }
- # if watched = true look in airing for last time code
- # "last_timecode": "00:10:54",
+ show_info = {
+ 'airing_id': airing_id,
+ 'channel_id': channel_id,
+ 'program_id': program_id,
+ 'series_id': series_id,
+ 'tms_id': tms_id
+ }
- # channel_url = CHANNEL_URL+'/'+show_id
- # show_url = 'https://media-framework.totsuko.tv/media-framework/media/v2.1/stream/airing/'+airing_id
+ addShow(title, 150, icon, fanart, info, show_info)
- info = {'plot': plot, 'tvshowtitle': title, 'title': title, 'originaltitle': title, 'genre': genre}
- # addStream(title,show_url,title,icon,fanart,info)
- addDir(title, 150, icon, fanart, info, show_id)
-
-def list_episodes(show_id):
- url = EPG_URL + '/details/items/program/' + show_id + '/episodes/offset/0/size/20'
+def list_episodes(program_id):
+ url = EPG_URL + '/details/items/program/' + program_id + '/episodes/offset/0/size/20'
json_source = get_json(url)
@@ -135,7 +169,6 @@ def list_episodes(show_id):
def list_episode(show):
- # if str(show['playable']).upper() == 'FALSE': return
fanart = FANART
icon = ICON
for image in show['urls']:
@@ -148,8 +181,24 @@ def list_episode(show):
show_title = show['title']
title = show['display_episode_title']
airing_id = str(show['airings'][0]['airing_id'])
+
+ #airing_id = 'null'
+ #if 'airing_id' in show: airing_id = str(show['airings'][0]['airing_id'])
+ channel_id = 'null'
+ if 'channel_id' in show['channel']: channel_id = str(show['channel']['channel_id'])
+ program_id = str(show['id'])
+ series_id = 'null'
+ if 'series_id' in show: series_id = str(show['series_id'])
+ tms_id = str(show['tms_id'])
+
airing_date = show['airing_date']
airing_date = stringToDate(airing_date, "%Y-%m-%dT%H:%M:%S.%fZ")
+ airing_enddate = str(show['airings'][0]['airing_enddate'])
+ airing_enddate = stringToDate(airing_enddate, "%Y-%m-%dT%H:%M:%S.%fZ")
+
+ duration = airing_enddate - airing_date
+ #xbmc.log("DURATION = "+ str(duration.total_seconds()))
+
airing_date = UTCToLocal(airing_date)
broadcast_date = ''
if 'broadcast_date' in show:
@@ -166,21 +215,49 @@ def list_episode(show):
if str(show['playable']).upper() == 'FALSE':
# Add airing date/time to title
- # airing = airing.strftime('%H:%M')
title = title + ' ' + airing_date.strftime('%m/%d/%y') + ' ' + airing_date.strftime('%I:%M %p').lstrip('0')
+ # Add resumetime if applicable
+ resumetime=''
+ try:
+ resumetime = str(show['airings'][0]['last_timecode'])
+ xbmc.log("RESUME TIME = "+resumetime)
+ h,m,s = resumetime.split(':')
+ resumetime = str(int(h) * 3600 + int(m) * 60 + int(s))
+ except: pass
+ #xbmc.log("RESUME TIME IN Seconds = "+resumetime)
+ #xbmc.log("TOTAL TIME IN Seconds = "+str(int(duration.total_seconds())))
- # if watched = true look in airing for last time code
- # "last_timecode": "00:10:54",
-
- # channel_url = CHANNEL_URL+'/'+show_id
show_url = 'https://media-framework.totsuko.tv/media-framework/media/v2.1/stream/airing/' + airing_id
- info = {'plot': plot, 'tvshowtitle': show_title, 'title': title, 'originaltitle': title, 'genre': genre, 'aired': airing_date.strftime('%Y-%m-%d')}
+ info = {
+ 'plot': plot,
+ 'tvshowtitle': show_title,
+ 'title': title,
+ 'originaltitle': title,
+ 'mediatype': 'episode',
+ 'genre': genre,
+ 'aired': airing_date.strftime('%Y-%m-%d'),
+ 'duration': str(int(duration.total_seconds()))
+ }
if broadcast_date != '': info['premiered'] = broadcast_date.strftime('%Y-%m-%d')
+ properties = {
+
+ 'totaltime': str(int(duration.total_seconds())),
+ 'resumetime': resumetime,
+ 'IsPlayable': str(show['playable']).lower()
+ }
+
+ show_info = {
+ 'airing_id': airing_id,
+ 'channel_id': channel_id,
+ 'program_id': program_id,
+ 'series_id': series_id,
+ 'tms_id': tms_id
+ }
- addStream(title, show_url, title, icon, fanart, info)
+ addStream(title, show_url, title, icon, fanart, info, properties, show_info)
def list_channels(json_source):
@@ -204,6 +281,7 @@ def list_channel(channel):
title = channel['title']
channel_id = str(channel['id'])
+
genre = ''
for item in channel['genres']:
if genre != '': genre += ', '
@@ -215,9 +293,31 @@ def list_channel(channel):
channel_url = CHANNEL_URL + '/' + channel_id
- info = {'season':season, 'episode':episode, 'plot': plot, 'tvshowtitle': title, 'title': title, 'originaltitle': title, 'genre': genre}
-
- addStream(title, channel_url, title, icon, fanart, info)
+ info = {
+ 'season':season,
+ 'episode':episode,
+ 'plot': plot,
+ 'tvshowtitle': title,
+ 'title': title,
+ 'originaltitle': title,
+ 'genre': genre
+ }
+
+ properties = {
+ 'IsPlayable': 'true'
+ }
+
+ show_info = {
+ 'channel_id': channel_id
+ }
+
+ if 'channel_type' in channel:
+ if channel['channel_type'] != 'vod':
+ addStream(title, channel_url, title, icon, fanart, info, properties, show_info)
+ else:
+ addDir(title, 350, icon, fanart, channel_id)
+ else:
+ addStream(title, channel_url, title, icon, fanart, info, properties, show_info)
def get_dict_item(key, dictionary):
@@ -227,44 +327,64 @@ def get_dict_item(key, dictionary):
return ''
-def get_stream(url):
+def get_stream(url, airing_id, channel_id, program_id, series_id, tms_id):
headers = {"Accept": "*/*",
"Content-type": "application/x-www-form-urlencoded",
"Origin": "https://vue.playstation.com",
"Accept-Language": "en-US,en;q=0.8",
"Referer": "https://vue.playstation.com/watch/live",
"Accept-Encoding": "deflate",
- "User-Agent": UA_ANDROID,
+ "User-Agent": UA_ANDROID_TV,
"Connection": "Keep-Alive",
- 'reqPayload': ADDON.getSetting(id='reqPayload')
+ 'reqPayload': ADDON.getSetting(id='reqPayload'),
+ "X-Requested-With": "com.snei.vue.atv"
}
r = requests.get(url, headers=headers, cookies=load_cookies(), verify=VERIFY)
json_source = r.json()
stream_url = json_source['body']['video']
- stream_url += '|User-Agent='
- stream_url += 'Adobe Primetime/1.4 Dalvik/2.1.0 (Linux; U; Android 6.0.1 Build/MOB31H)'
- stream_url += '&Cookie=reqPayload=' + urllib.quote('"' + ADDON.getSetting(id='reqPayload') + '"')
+ headers = '|User-Agent='
+ headers += 'Adobe Primetime/1.4 Dalvik/2.1.0 (Linux; U; Android 6.0.1 Build/MOB31H)'
+ headers += '&Cookie=reqPayload=' + urllib.quote('"' + ADDON.getSetting(id='reqPayload') + '"')
+ listitem = xbmcgui.ListItem()
+ listitem.setMimeType("application/x-mpegURL")
+
+ if xbmc.getCondVisibility('System.HasAddon(inputstream.adaptive)'):
+ listitem.setProperty('inputstreamaddon', 'inputstream.adaptive')
+ listitem.setProperty('inputstream.adaptive.manifest_type', 'hls')
+ listitem.setProperty('inputstream.adaptive.stream_headers', headers)
+ listitem.setProperty('inputstream.adaptive.license_key', headers)
+ else:
+ stream_url += headers
+
+
+ listitem.setPath(stream_url)
- listitem = xbmcgui.ListItem(path=stream_url)
- # listitem.setProperty('ResumeTime', '600')
- # listitem.setProperty('setResumePoint', '600')
xbmcplugin.setResolvedUrl(addon_handle, True, listitem)
# Seek to time
+
+ #Give the stream sometime to start before checking
'''
monitor = xbmc.Monitor()
- monitor.waitForAbort(3000)
- if xbmc.Player().isPlayingVideo():
- xbmc.Player().seekTime(600)
+ monitor.waitForAbort(10)
+ xbmc.log("Is playing video? " + str(xbmc.Player().isPlayingVideo()))
+ while xbmc.Player().isPlayingVideo() and not monitor.abortRequested():
+ xbmc.log("Still playing...")
+ monitor.waitForAbort(3)
+
+ xbmc.log("We're done, write info back to ps servers!!!")
+ sony = SONY()
+ sony.put_resume_time(airing_id, channel_id, program_id, series_id, tms_id)
'''
+
def get_json(url):
headers = {'Accept': '*/*',
'reqPayload': ADDON.getSetting(id='reqPayload'),
- 'User-Agent': UA_ANDROID,
+ 'User-Agent': UA_ANDROID_TV,
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'en-US',
'X-Requested-With': 'com.snei.vue.android'
@@ -337,30 +457,56 @@ def UTCToLocal(utc_dt):
return local_dt.replace(microsecond=utc_dt.microsecond)
-def addDir(name, mode, icon, fanart=None, info=None, show_id=None):
+def addDir(name, mode, icon, fanart=None, channel_id=None):
u = sys.argv[0] + "?mode=" + str(mode)
- if show_id != None: u += '&show_id=' + show_id
-
+ if channel_id != None: u += "&channel_id="+channel_id
liz = xbmcgui.ListItem(name)
if fanart == None: fanart = FANART
liz.setArt({'icon': icon, 'thumb': icon, 'fanart': fanart})
- if info != None:
- liz.setInfo(type="Video", infoLabels=info)
-
ok = xbmcplugin.addDirectoryItem(handle=addon_handle, url=u, listitem=liz, isFolder=True)
xbmcplugin.setContent(addon_handle, 'tvshows')
return ok
-def addStream(name, link_url, title, icon, fanart, info=None):
+def addShow(name, mode, icon, fanart, info, show_info):
+ u = sys.argv[0] + "?mode=" + str(mode)
+ u += '&program_id=' + show_info['program_id']
+
+ liz = xbmcgui.ListItem(name)
+ if fanart == None: fanart = FANART
+ liz.setArt({'icon': icon, 'thumb': icon, 'fanart': fanart})
+ liz.setInfo(type="Video", infoLabels=info)
+ show_values =''
+ for key, value in show_info.iteritems():
+ show_values += '&' + key + '=' + value
+
+ context_items = [('Add To My Shows', 'RunPlugin(plugin://plugin.video.psvue/?mode=1001'+show_values+')'),
+ ('Remove From My Shows', 'RunPlugin(plugin://plugin.video.psvue/?mode=1002'+show_values+')')]
+ liz.addContextMenuItems(context_items)
+ ok = xbmcplugin.addDirectoryItem(handle=addon_handle, url=u, listitem=liz, isFolder=True)
+ xbmcplugin.setContent(addon_handle, 'tvshows')
+
+
+def addStream(name, link_url, title, icon, fanart, info=None, properties=None, show_info=None):
u = sys.argv[0] + "?url=" + urllib.quote_plus(link_url) + "&mode=" + str(900)
+ #xbmc.log(str(info))
liz = xbmcgui.ListItem(name)
liz.setArt({'icon': icon, 'thumb': icon, 'fanart': fanart})
- liz.setProperty("IsPlayable", "true")
- # liz.setProperty('setResumePoint', '1200')
- liz.setInfo(type="Video", infoLabels={"Title": title, 'mediatype': 'episode'})
- if info != None:
- liz.setInfo(type="Video", infoLabels=info)
+ if info != None: liz.setInfo(type="Video", infoLabels=info)
+ if properties != None:
+ for key, value in properties.iteritems():
+ liz.setProperty(key,value)
+ xbmc.log(str(show_info))
+ if show_info != None:
+ show_values =''
+ for key, value in show_info.iteritems():
+ show_values += '&' + key + '=' + value
+ u += show_values
+ if len(show_info) == 1:
+ #Only add this option for channels not episodes
+ context_items = [('Add To Favorites Channels', 'RunPlugin(plugin://plugin.video.psvue/?mode=1001'+show_values+')'),
+ ('Remove From Favorites Channels', 'RunPlugin(plugin://plugin.video.psvue/?mode=1002'+show_values+')')]
+ liz.addContextMenuItems(context_items)
ok = xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=u, listitem=liz, isFolder=False)
xbmcplugin.setContent(addon_handle, 'tvshows')
return ok
@@ -400,7 +546,6 @@ def check_device_id():
DEVICE_ID = ADDON.getSetting(id='deviceId')
-
addon_handle = int(sys.argv[1])
ADDON = xbmcaddon.Addon()
ROOTDIR = ADDON.getAddonInfo('path')
@@ -410,6 +555,7 @@ ICON = os.path.join(ROOTDIR, "resources", "icon.png")
ADDON_PATH_PROFILE = xbmc.translatePath(ADDON.getAddonInfo('profile'))
UA_ANDROID = 'Mozilla/5.0 (Linux; Android 6.0.1; Build/MOB31H; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/44.0.2403.119 Safari/537.36'
+UA_ANDROID_TV = 'Mozilla/5.0 (Linux; Android 6.0.1; Hub Build/MHC19J; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/61.0.3163.98 Safari/537.36'
CHANNEL_URL = 'https://media-framework.totsuko.tv/media-framework/media/v2.1/stream/channel'
EPG_URL = 'https://epg-service.totsuko.tv/epg_service_sony/service/v2'
-VERIFY = False
+VERIFY = True
diff --git a/plugin.video.psvue/resources/lib/sony.py b/plugin.video.psvue/resources/lib/sony.py
index 1c11ad7..3088aed 100644
--- a/plugin.video.psvue/resources/lib/sony.py
+++ b/plugin.video.psvue/resources/lib/sony.py
@@ -6,14 +6,19 @@ from datetime import datetime
class SONY():
addon = xbmcaddon.Addon()
api_url = 'https://auth.api.sonyentertainmentnetwork.com/2.0'
+ user_action_url = 'https://sentv-user-action.totsuko.tv/sentv_user_action/ws/v2'
device_id = ''
+ device_type = 'android_tv'
localized = addon.getLocalizedString
login_client_id = '71a7beb8-f21a-47d9-a604-2e71bee24fe0'
+ andriod_tv_client_id = '0a5fe341-cb16-47d9-991e-0110fff49713'
npsso = ''
password = ''
req_client_id = 'dee6a88d-c3be-4e17-aec5-1018514cee40'
ua_android = 'Mozilla/5.0 (Linux; Android 6.0.1; Build/MOB31H; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/44.0.2403.119 Safari/537.36'
+ ua_android_tv = 'Mozilla/5.0 (Linux; Android 6.0.1; Hub Build/MHC19J; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/61.0.3163.98 Safari/537.36'
ua_sony = 'com.sony.snei.np.android.sso.share.oauth.versa.USER_AGENT'
+ themis = 'https://themis.dl.playstation.net/themis/destro/redirect.html'
username = ''
verify = False
@@ -72,11 +77,12 @@ class SONY():
"Origin": "https://id.sonyentertainmentnetwork.com",
"Accept-Language": "en-US,en;q=0.8",
"Accept-Encoding": "deflate",
- "User-Agent": self.ua_android,
+ "User-Agent": self.ua_android_tv,
+ "X-Requested-With": "com.snei.vue.atv",
"Connection": "Keep-Alive"
}
- payload = 'authentication_type=password&username='+urllib.quote_plus(self.username)+'&password='+urllib.quote_plus(self.password)+'&client_id='+self.login_client_id
+ payload = 'authentication_type=password&username='+urllib.quote_plus(self.username)+'&password='+urllib.quote_plus(self.password)+'&client_id='+self.andriod_tv_client_id
r = requests.post(url, headers=headers, cookies=self.load_cookies(), data=payload, verify=self.verify)
json_source = r.json()
self.save_cookies(r.cookies)
@@ -110,7 +116,7 @@ class SONY():
"Origin": "https://id.sonyentertainmentnetwork.com",
"Accept-Language": "en-US,en;q=0.8",
"Accept-Encoding": "deflate",
- "User-Agent": self.ua_android,
+ "User-Agent": self.ua_android_tv,
"Connection": "Keep-Alive",
"Referer": "https://id.sonyentertainmentnetwork.com/signin/?service_entity=urn:service-entity:psn&ui=pr&service_logo=ps&response_type=code&scope=psn:s2s&client_id="+self.req_client_id+"&request_locale=en_US&redirect_uri=https://io.playstation.com/playstation/psn/acceptLogin&error=login_required&error_code=4165&error_description=User+is+not+authenticated"
}
@@ -139,7 +145,8 @@ class SONY():
"User-Agent": self.ua_sony,
"Content-Type": "application/x-www-form-urlencoded",
"Connection": "Keep-Alive",
- "Accept-Encoding": "gzip"
+ "Accept-Encoding": "gzip",
+ "X-Requested-With": "com.snei.vue.atv"
}
r = requests.delete(url, headers=headers, cookies=self.load_cookies(), verify=self.verify)
@@ -153,19 +160,27 @@ class SONY():
def get_grant_code(self):
url = self.api_url + '/oauth/authorize'
- url += '?response_type=code'
+ url += '?request_theme=tv'
+ url += '&ui=ds'
url += '&client_id=' + self.req_client_id
- url += '&redirect_uri=https%3A%2F%2Fthemis.dl.playstation.net%2Fthemis%2Fzartan%2Fredirect.html'
+ url += '&hidePageElements=noAccountSection'
+ url += '&redirect_uri=' + urllib.quote_plus(self.themis)
+ url += '&request_locale=en'
+ url += '&response_type=code'
+ url += '&resolution=1080'
url += '&scope=psn%3As2s'
- url += '&signInOnly=true'
- url += '&service_entity=urn%3Aservice-entity%3Anp'
- url += '&prompt=none'
+ url += '&service_logo=ps'
+ url += '&smcid=tv%3Apsvue'
url += '&duid=' + self.device_id
+
headers = {
- "Accept-Encoding": "gzip",
- "User-Agent": self.ua_sony,
- "Connection": "Keep-Alive"
+ "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
+ "Accept-Encoding": "gzip, deflate",
+ "Accept-Language": "en-US",
+ "User-Agent": self.ua_android_tv,
+ "Connection": "Keep-Alive",
+ "X-Requested-With": "com.snei.vue.atv"
}
code = ''
@@ -182,17 +197,18 @@ class SONY():
def authorize_device(self):
url = 'https://sentv-user-auth.totsuko.tv/sentv_user_auth/ws/oauth2/token'
- url += '?device_type_id=android_tablet'
+ url += '?device_type_id=' + self.device_type
url += '&device_id=' + self.device_id
url += '&code=' + self.get_grant_code()
- url += '&redirect_uri=https%3A%2F%2Fthemis.dl.playstation.net%2Fthemis%2Fzartan%2Fredirect.html'
+ url += '&redirect_uri=' + urllib.quote_plus(self.themis)
headers = {
'Origin': 'https://themis.dl.playstation.net',
- 'User-Agent': self.ua_android,
+ 'User-Agent': self.ua_android_tv,
'Accept': '*/*',
'Connection': 'Keep-Alive',
- 'Accept-Encoding': 'gzip'
+ 'Accept-Encoding': 'gzip',
+ "X-Requested-With": "com.snei.vue.atv"
}
if self.addon.getSetting(id='reqPayload') != '':
headers['reauth'] = '1'
@@ -212,12 +228,13 @@ class SONY():
def get_profiles(self):
url = 'https://sentv-user-ext.totsuko.tv/sentv_user_ext/ws/v2/profile/ids'
headers = {
- 'User-Agent': self.ua_android,
+ 'User-Agent': self.ua_android_tv,
'reqPayload': self.addon.getSetting(id='reqPayload'),
'Accept': '*/*',
'Origin': 'https://themis.dl.playstation.net',
'Connection': 'Keep-Alive',
- 'Accept-Encoding': 'gzip'
+ 'Accept-Encoding': 'gzip',
+ "X-Requested-With": "com.snei.vue.atv"
}
r = requests.get(url, headers=headers, verify=self.verify)
@@ -244,13 +261,14 @@ class SONY():
def set_profile(self, profile_id):
url = 'https://sentv-user-ext.totsuko.tv/sentv_user_ext/ws/v2/profile/' + profile_id
headers = {
- 'User-Agent': self.ua_android,
+ 'User-Agent': self.ua_android_tv,
'reqPayload': self.addon.getSetting(id='reqPayload'),
'Accept': '*/*',
'Origin': 'https://themis.dl.playstation.net',
'Host': 'sentv-user-ext.totsuko.tv',
'Connection': 'Keep-Alive',
- 'Accept-Encoding': 'gzip'
+ 'Accept-Encoding': 'gzip',
+ "X-Requested-With": "com.snei.vue.atv"
}
r = requests.get(url, headers=headers, verify=self.verify)
@@ -261,48 +279,94 @@ class SONY():
self.addon.setSetting(id='default_profile', value=profile_id)
- def put_resume_time(self):
- """
- PUT https://sentv-user-action.totsuko.tv/sentv_user_action/ws/v2/watch_history HTTP/1.1
- Host: sentv-user-action.totsuko.tv
- Connection: keep-alive
- Content-Length: 247
- Accept: */*
- reqPayload: redacted
- User-Agent: Mozilla/5.0 (Linux; Android 6.0.1; Build/MOB31H; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/44.0.2403.119 Safari/537.36
- Origin: https://themis.dl.playstation.net
- Content-Type: application/json
- Referer: https://themis.dl.playstation.net/themis/zartan/2.2.2b/
- Accept-Encoding: gzip, deflate
- Accept-Language: en-US
- X-Requested-With: com.snei.vue.android
-
- {"series_id":redacted,"program_id":redacted,"channel_id":redacted,"tms_id":"EP005544655496","airing_id":redacted,"last_watch_date":"2017-04-28T00:40:43Z","last_timecode":"01:46:29","start_timecode":"00:00:00:00","fully_watched":false,"stream_type":"dvr"}
- """
- url = 'https://sentv-user-action.totsuko.tv/sentv_user_action/ws/v2/watch_history'
+ def add_to_favorites(self, ids):
+ url = self.user_action_url+'/favorite'
+ headers = {"Accept": "*/*",
+ "Content-type": "application/json",
+ "Origin": "https://vue.playstation.com",
+ "Referer": "https://vue.playstation.com/watch/home",
+ "Accept-Language": "en-US,en;q=0.8",
+ "Accept-Encoding": "gzip, deflate, br",
+ "User-Agent": self.ua_android_tv,
+ "Connection": "Keep-Alive",
+ "reqPayload": self.addon.getSetting(id='reqPayload'),
+ "X-Requested-With": "com.snei.vue.atv"
+ }
+
+ if ids['channel_id'] != 'null':
+ location = self.addon.getLocalizedString(30102)
+ payload = '{"channel_id":'+ids['channel_id']+'}'
+ else:
+ location = self.addon.getLocalizedString(30101)
+ payload = '{"program_id":'+ids['program_id']+',"series_id":'+ids['series_id']+',"tms_id":"'+ids['tms_id']+'"}'
+
+ r = requests.post(url, headers=headers, cookies=self.load_cookies(), data=payload, verify=self.verify)
+
+ if r.status_code == 200:
+ self.notification_msg("Success!", "Added to "+location)
+ else:
+ self.notification_msg("Fail", "Not added")
+
+
+ def remove_from_favorites(self,ids):
+ url = self.user_action_url+'/favorite'
+ headers = {"Accept": "*/*",
+ "Content-type": "application/json",
+ "Origin": "https://vue.playstation.com",
+ "Referer": "https://vue.playstation.com/watch/home",
+ "Accept-Language": "en-US,en;q=0.8",
+ "Accept-Encoding": "gzip, deflate, br",
+ "User-Agent": self.ua_android_tv,
+ "Connection": "Keep-Alive",
+ "reqPayload": self.addon.getSetting(id='reqPayload'),
+ "X-Requested-With": "com.snei.vue.atv"
+ }
+
+ if ids['channel_id'] != 'null':
+ location = self.addon.getLocalizedString(30102)
+ payload = '{"channel_id":'+ids['channel_id']+'}'
+ else:
+ location = self.addon.getLocalizedString(30101)
+ payload = '{"program_id":'+ids['program_id']+',"series_id":'+ids['series_id']+',"tms_id":"'+ids['tms_id']+'"}'
+
+ msg = 'Are you sure you want to remove this from '+location+'?'
+ dialog = xbmcgui.Dialog()
+ remove = dialog.yesno(location,msg)
+ if remove:
+ r = requests.delete(url, headers=headers, cookies=self.load_cookies(), data=payload, verify=self.verify)
+
+ if r.status_code == 200:
+ self.notification_msg("Success!", "Removed from "+location)
+ else:
+ self.notification_msg("Fail", "Not added")
+
+
+ def put_resume_time(self, airing_id, channel_id, program_id, series_id, tms_id):
+ url = self.user_action_url+'/watch_history'
headers = {"Accept": "*/*",
"Content-type": "application/json",
"Origin": "https://themis.dl.playstation.net",
"Accept-Language": "en-US",
- "Referer": "https://themis.dl.playstation.net/themis/zartan/2.2.2b/",
+ "Referer": "https://themis.dl.playstation.net/themis/destro/4-4-5a/",
"Accept-Encoding": "gzip, deflate",
- "User-Agent": self.ua_android,
+ "User-Agent": self.ua_android_tv,
"Connection": "Keep-Alive",
'reqPayload': self.addon.getSetting(id='reqPayload'),
'X-Requested-With': 'com.snei.vue.android'
}
- payload = '{"series_id":redacted,'
- payload += '"program_id":redacted,'
- payload += '"channel_id":redacted,'
- payload += '"tms_id":"redacted",'
- payload += '"airing_id":redacted,'
- payload += '"last_watch_date":"2017-04-28T00:40:43Z",'
- payload += '"last_timecode":"01:46:29",'
+ payload = '{"series_id":'+series_id+','
+ payload += '"program_id":'+program_id+','
+ payload += '"channel_id":'+channel_id+','
+ payload += '"tms_id":"'+tms_id+'",'
+ payload += '"airing_id":'+airing_id+','
+ payload += '"last_watch_date":"2017-08-11T00:40:43Z",'
+ payload += '"last_timecode":"00:01:46",'
payload += '"start_timecode":"00:00:00:00",'
payload += '"fully_watched":false,'
payload += '"stream_type":"dvr"}'
+ #xbmc.log(payload)
r = requests.put(url, headers=headers, data=payload, verify=self.verify)
@@ -311,7 +375,7 @@ class SONY():
cookie_file = os.path.join(addon_profile_path, 'cookies.lwp')
cj = cookielib.LWPCookieJar()
try:
- cj.load(cookie_file,ignore_discard=True)
+ cj.load(cookie_file,ignore_discard=True)
except:
pass
for c in cookiejar:
diff --git a/plugin.video.psvue/resources/settings.xml b/plugin.video.psvue/resources/settings.xml
index 2e79c26..b299576 100644
--- a/plugin.video.psvue/resources/settings.xml
+++ b/plugin.video.psvue/resources/settings.xml
@@ -1,13 +1,31 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>
- <!--Login-->
- <category label="30000">
- <setting id="username" type="text" label="30001" default=""/>
- <setting id="password" type="text" label="30002" option="hidden" default=""/>
- <setting id="logout" type="action" label="30003" action="RunPlugin(plugin://plugin.video.psvue/?mode=999)" option="close" />
- <setting id="change_profile" type="action" label="30004" action="RunPlugin(plugin://plugin.video.psvue/?mode=800)" option="close" />
- <setting id="reset_device_id" type="action" label="30005" action="RunPlugin(plugin://plugin.video.psvue/?mode=1000)" option="close" />
-</category>
+ <!--Main Menu-->
+ <category label="30223">
+ <setting id="all_chan_visible" type="bool" label="30224" default="true" />
+ <setting id="timeline_visible" type="bool" label="30214" default="true" />
+ <setting id="myshows_visible" type="bool" label="30215" default="true" />
+ <setting id="fav_visible" type="bool" label="30216" default="true" />
+ <setting id="live_visible" type="bool" label="30217" default="true" />
+ <setting id="sports_visible" type="bool" label="30218" default="true" />
+ <setting id="kids_visible" type="bool" label="30219" default="true" />
+ <setting id="recent_visible" type="bool" label="30220" default="true" />
+ <setting id="featured_visible" type="bool" label="30221" default="true" />
+ <setting id="search_visible" type="bool" label="30222" default="true" />
+
+ </category>
+ <!--Login-->
+ <category label="30000">
+ <setting id="username" type="text" label="30001" default=""/>
+ <setting id="password" type="text" label="30002" option="hidden" default=""/>
+ <setting id="logout" type="action" label="30003" action="RunPlugin(plugin://plugin.video.psvue/?mode=999)" option="close" />
+ <setting type="action" label="30005" action="RunPlugin(plugin://plugin.video.psvue/?mode=1000)" option="close" />
+ </category>
+ <!--Profile-->
+ <category label="30212">
+ <setting type="action" label="30004" action="RunPlugin(plugin://plugin.video.psvue/?mode=800)" option="close" />
+ <setting id="always_ask_profile" type="bool" label="30213" default="false" />
+ </category>
<!-- Hidden -->
<setting id="reqPayload" type="text" default="" visible="false"/>
diff --git a/plugin.video.redbull.tv/LICENSE.txt b/plugin.video.redbull.tv/LICENSE.txt
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/plugin.video.redbull.tv/LICENSE.txt
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/plugin.video.redbull.tv/__init__.py b/plugin.video.redbull.tv/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.redbull.tv/__init__.py
diff --git a/plugin.video.redbull.tv/addon.xml b/plugin.video.redbull.tv/addon.xml
new file mode 100644
index 0000000..30b5626
--- /dev/null
+++ b/plugin.video.redbull.tv/addon.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<addon id="plugin.video.redbull.tv" name="Red Bull TV" version="2.0.1" provider-name="andy-g">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource" library="default.py">
+ <provides>video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <summary lang="en">Redbull TV</summary>
+ <description lang="en">Red Bull TV gives you front-row access to live events, the best inaction sports, new music and entertainment, and thrilling videos from world adventurers.</description>
+ <website>http://www.redbull.tv/</website>
+ <platform>all</platform>
+ <source>https://github.com/andy-g/kodi.plugin.video.redbulltv2</source>
+ </extension>
+</addon>
diff --git a/plugin.video.redbull.tv/default.py b/plugin.video.redbull.tv/default.py
new file mode 100644
index 0000000..32b7e09
--- /dev/null
+++ b/plugin.video.redbull.tv/default.py
@@ -0,0 +1,85 @@
+import sys, urlparse, os, urllib, datetime, time
+import xbmcgui, xbmcplugin, xbmcaddon, xbmc
+
+from resources.lib import utils
+from resources.lib import redbulltv_client as redbulltv
+
+class RedbullTV2(object):
+ def __init__(self):
+ self.id = 'plugin.video.redbull.tv'
+ self.addon = xbmcaddon.Addon(self.id)
+ self.icon = self.addon.getAddonInfo('icon')
+ self.base_url = sys.argv[0]
+ self.addon_handle = int(sys.argv[1])
+ self.args = urlparse.parse_qs(sys.argv[2][1:])
+ xbmcplugin.setContent(self.addon_handle, 'movies')
+ self.redbulltv_client = redbulltv.RedbullTVClient(self.addon.getSetting('video.resolution'))
+
+ @staticmethod
+ def get_keyboard(default="", heading="", hidden=False):
+ keyboard = xbmc.Keyboard(default, heading, hidden)
+ keyboard.doModal()
+ if keyboard.isConfirmed():
+ return str(urllib.quote_plus(keyboard.getText()))
+ return default
+
+ def navigation(self):
+ url = self.args.get("api_url")[0].decode('base64') if self.args.get("api_url") else None
+ category = self.args.get('category', [None])[0]
+
+ if url and "search?q=" in url:
+ url += self.get_keyboard()
+
+ try:
+ items = self.redbulltv_client.get_items(url, category)
+ except IOError:
+ # Error getting data from Redbull server
+ xbmcgui.Dialog().ok(self.addon.getLocalizedString(30020), self.addon.getLocalizedString(30021), self.addon.getLocalizedString(30022))
+ return
+
+ if not items:
+ # No results found
+ xbmcgui.Dialog().ok(self.addon.getLocalizedString(30023), self.addon.getLocalizedString(30024), self.addon.getLocalizedString(30025))
+ return
+ elif items[0].get("is_stream"):
+ self.play_stream(items[0])
+ elif items[0].get("event_date"):
+ # Scheduled Event Time
+ xbmcgui.Dialog().ok(
+ self.addon.getLocalizedString(30026),
+ self.addon.getLocalizedString(30027),
+ datetime.datetime.fromtimestamp(int(items[0].get("event_date"))).strftime('%a %-d %b %Y %H:%M') +
+ " (GMT+" + str(time.timezone / 3600 * -1) + ")"
+ )
+ return
+ else:
+ self.add_items(items)
+
+ xbmcplugin.endOfDirectory(self.addon_handle)
+
+ def add_items(self, items):
+ for item in items:
+ params = {'api_url' : item["url"].encode('base64')}
+ if "category" in item:
+ params['category'] = item["category"].encode('utf-8')
+
+ url = utils.build_url(self.base_url, params)
+ list_item = xbmcgui.ListItem(
+ item.get("title"),
+ iconImage='DefaultFolder.png',
+ thumbnailImage=item.get("image", self.icon)
+ )
+ list_item.setInfo(type="Video", infoLabels={"Title": item["title"], "Plot": item.get("summary", None)})
+ if item.get("is_content"):
+ list_item.setProperty('IsPlayable', 'true')
+ xbmcplugin.addDirectoryItem(handle=self.addon_handle, url=url, listitem=list_item, isFolder=(not item["is_content"]))
+
+ def play_stream(self, item):
+ list_item = xbmcgui.ListItem(label=item.get("title"), path=item.get("url"))
+ list_item.setInfo(type="Video", infoLabels={"title": item.get("title"), "plot": item.get("summary")})
+ list_item.setArt({'poster': item.get("image"), 'iconImage': "DefaultVideo.png", 'thumbnailImage': item.get("image")})
+ list_item.setProperty("IsPlayable", "true")
+ xbmcplugin.setResolvedUrl(handle=self.addon_handle, succeeded=True, listitem=list_item)
+
+if __name__ == '__main__':
+ RedbullTV2().navigation()
diff --git a/plugin.video.redbull.tv/fanart.jpg b/plugin.video.redbull.tv/fanart.jpg
new file mode 100644
index 0000000..05e5c18
--- /dev/null
+++ b/plugin.video.redbull.tv/fanart.jpg
Binary files differ
diff --git a/plugin.video.redbull.tv/icon.png b/plugin.video.redbull.tv/icon.png
new file mode 100644
index 0000000..e78e019
--- /dev/null
+++ b/plugin.video.redbull.tv/icon.png
Binary files differ
diff --git a/plugin.video.redbull.tv/resources/__init__.py b/plugin.video.redbull.tv/resources/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.redbull.tv/resources/__init__.py
diff --git a/plugin.video.redbull.tv/resources/language/English/strings.xml b/plugin.video.redbull.tv/resources/language/English/strings.xml
new file mode 100644
index 0000000..77fd608
--- /dev/null
+++ b/plugin.video.redbull.tv/resources/language/English/strings.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<strings>
+ <!-- Kodion Settings -->
+ <string id="30000">General</string>
+
+ <string id="30010">Video Quality</string>
+ <string id="30011">180p</string>
+ <string id="30012">240p</string>
+ <string id="30013">360p</string>
+ <string id="30014">540p</string>
+ <string id="30015">720p (HD)</string>
+ <string id="30016">1080p (HD)</string>
+
+ <string id="30020">Error</string>
+ <string id="30021">Error getting data from Redbull server.</string>
+ <string id="30022">Try again shortly</string>
+
+ <string id="30023">No Results</string>
+ <string id="30024">No results found</string>
+ <string id="30025">Please try another menu or search string</string>
+
+ <string id="30026">Upcoming Event</string>
+ <string id="30027">This event is scheduled to start on:</string>
+</strings> \ No newline at end of file
diff --git a/plugin.video.redbull.tv/resources/lib/__init__.py b/plugin.video.redbull.tv/resources/lib/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.redbull.tv/resources/lib/__init__.py
diff --git a/plugin.video.redbull.tv/resources/lib/redbulltv_client.py b/plugin.video.redbull.tv/resources/lib/redbulltv_client.py
new file mode 100644
index 0000000..8124273
--- /dev/null
+++ b/plugin.video.redbull.tv/resources/lib/redbulltv_client.py
@@ -0,0 +1,111 @@
+import re, urllib2
+import utils
+
+class RedbullTVClient(object):
+ REDBULL_API = "https://appletv.redbull.tv/"
+ ROOT_MENU = [
+ {"title": "Discover", "url": REDBULL_API + "products/discover", "is_content":False},
+ {"title": "TV", "url": REDBULL_API + "products/tv", "is_content":False},
+ {"title": "Channels", "url": REDBULL_API + "products/channels", "is_content":False},
+ {"title": "Calendar", "url": REDBULL_API + "products/calendar", "is_content":False},
+ {"title": "Search", "url": REDBULL_API + "search?q=", "is_content":False},
+ ]
+
+ def __init__(self, resolution=None):
+ self.resolution = resolution
+
+ @staticmethod
+ def get_resolution_code(video_resolution_id):
+ return {
+ "0" : "320x180",
+ "1" : "426x240",
+ "2" : "640x360",
+ "3" : "960x540",
+ "4" : "1280x720",
+ }.get(video_resolution_id, "1920x1080")
+
+ def get_stream_details(self, element):
+ name = element.findtext("title")
+ description = element.findtext("description")
+ image = element.find("image").get("src1080")
+ url = element.findtext("mediaURL")
+
+ # Try find the specific stream based on the users preferences
+ try:
+ playlists = urllib2.urlopen(url).read()
+ resolution = self.get_resolution_code(self.resolution)
+ media_url = re.search(
+ "RESOLUTION=" + resolution + ".*\n(.*)",
+ playlists).group(1)
+ except Exception:
+ pass
+ else:
+ url = media_url
+
+ return {"title":name, "url":url, "summary":description, "image": image, "is_stream":True}
+
+ def get_element_details(self, element, url=None):
+ details = {"url":url, "is_content":False}
+ subtitle = element.findtext('.//subtitle') or element.findtext('.//label2') or ""
+ details["title"] = (element.get("accessibilityLabel") or element.findtext('.//label')) + ((" - " + subtitle) if subtitle else "")
+ details["summary"] = element.findtext('.//summary')
+ details["image"] = element.find('.//image').get('src1080') if element.find('.//image') is not None else None
+ details["event_date"] = element.findtext('.//rightLabel')
+
+ # Get url of item, or name of selected category
+ if "onSelect" in element.attrib:
+ details["url"] = utils.strip_url(element.get("onSelect"))
+ details["is_content"] = re.search(self.REDBULL_API + "(content|linear_stream)", details["url"]) is not None
+ elif not details["event_date"]:
+ details["category"] = details["title"]
+
+ # Strip out any keys with empty values
+ return {k:v for k, v in details.iteritems() if v is not None}
+
+ def get_items(self, url=None, category=None):
+ # If no url is specified, return the root menu
+ if url is None:
+ return self.ROOT_MENU
+
+ xml = utils.get_xml(url)
+ items = []
+
+ # if the current url is a media stream
+ if xml.find('.//httpLiveStreamingVideoAsset') is not None:
+ items.append(self.get_stream_details(xml.find('.//httpLiveStreamingVideoAsset')))
+ # if no category is specified, find the categories or item collection
+ elif category is None:
+ data = {
+ "collectionDividers": xml.findall('.//collectionDivider'),
+ }
+ # Show Categories if relevant
+ if data["collectionDividers"]:
+ items += self.generate_items(
+ xml.findall('.//showcase') +
+ data["collectionDividers"],
+ url)
+ else:
+ items += self.generate_items(
+ xml.findall('.//twoLineMenuItem') +
+ xml.findall('.//twoLineEnhancedMenuItem') +
+ xml.findall('.//sixteenByNinePoster') +
+ xml.findall('.//actionButton'),
+ url)
+ # if a category is specified, find the items for the specified category
+ elif category is not None:
+ if category == 'Featured':
+ items += self.generate_items(xml.findall('.//showcasePoster'))
+ else:
+ collections = xml.iterfind(".//collectionDivider/../*")
+ for collection in collections:
+ if collection.tag == 'collectionDivider' and collection.get("accessibilityLabel") == category:
+ items += self.generate_items(collections.next().find('.//items').getchildren())
+
+ return items
+
+ def generate_items(self, xml_elements, url=None):
+ items = []
+ for item in xml_elements:
+ items.append(self.get_element_details(item, url))
+ return items
+ \ No newline at end of file
diff --git a/plugin.video.redbull.tv/resources/lib/utils.py b/plugin.video.redbull.tv/resources/lib/utils.py
new file mode 100644
index 0000000..9b288b5
--- /dev/null
+++ b/plugin.video.redbull.tv/resources/lib/utils.py
@@ -0,0 +1,17 @@
+import re, urllib, urllib2
+import xml.etree.ElementTree as ET
+
+def strip_url(url):
+ nurl = re.search(r"\(\'(.*)\'\)", url)
+ return nurl.group(1)
+
+def build_url(base_url, query):
+ return base_url + '?' + urllib.urlencode(query)
+
+def get_xml(url):
+ try:
+ response = urllib2.urlopen(url)
+ except urllib2.URLError as err:
+ raise IOError(*err.reason)
+ else:
+ return ET.parse(response)
diff --git a/plugin.video.redbull.tv/resources/settings.xml b/plugin.video.redbull.tv/resources/settings.xml
new file mode 100644
index 0000000..24ecbf4
--- /dev/null
+++ b/plugin.video.redbull.tv/resources/settings.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<settings>
+ <category label="30000">
+ <setting id="video.resolution" type="enum" label="30010" default="4" lvalues="30011|30012|30013|30014|30015|30016" />
+ </category>
+</settings> \ No newline at end of file
diff --git a/plugin.video.science.friday/LICENSE.txt b/plugin.video.science.friday/LICENSE.txt
new file mode 100644
index 0000000..d159169
--- /dev/null
+++ b/plugin.video.science.friday/LICENSE.txt
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/plugin.video.science.friday/addon.py b/plugin.video.science.friday/addon.py
new file mode 100644
index 0000000..50cb08c
--- /dev/null
+++ b/plugin.video.science.friday/addon.py
@@ -0,0 +1,154 @@
+# -*- coding: utf-8 -*-
+# Copyright: (c) 2016 William Forde (willforde+kodi@gmail.com)
+#
+# License: GPLv2, see LICENSE for more details
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+from __future__ import unicode_literals
+from codequick import Route, Resolver, Listitem, run
+
+# Localized string Constants
+RECENT_VIDEOS = 30001
+RECENT_AUDIO = 30002
+LIST_AUDIO = 30003
+LIST_VIDEO = 30004
+
+
+@Route.register
+def root(plugin):
+ """:type plugin: Route"""
+ # Set context parameters based on default view setting
+ if plugin.setting.get_int("defaultview") == 0:
+ context_label = plugin.localize(LIST_AUDIO)
+ context_type = "segment"
+ item_type = "video"
+ else:
+ context_label = plugin.localize(LIST_VIDEO)
+ context_type = "video"
+ item_type = "segment"
+
+ # Fetch HTML Source
+ url = "https://www.sciencefriday.com/explore/"
+ html = plugin.request.get(url)
+
+ # Parse for the content
+ root_elem = html.parse("form", attrs={"class": "searchandfilter"})
+ sfid = root_elem.get("data-sf-form-id")
+
+ # Add Youtube & Recent Content
+ yield Listitem.youtube("UUDjGU4DP3b-eGxrsipCvoVQ")
+
+ # Add Recent Videos link
+ yield Listitem.from_dict(label=plugin.localize(RECENT_VIDEOS), callback=content_lister,
+ params={"sfid": sfid, "ctype": "video"})
+ # Add Recent Audio link
+ yield Listitem.from_dict(label=plugin.localize(RECENT_AUDIO), callback=content_lister,
+ params={"sfid": sfid, "ctype": "segment"})
+
+ # List all topics
+ for elem in root_elem.iterfind(".//option[@data-sf-cr]"):
+ item = Listitem()
+ item.label = elem.text
+
+ # Add context item to link to the opposite content type. e.g. audio if video is default
+ item.context.container(context_label, content_lister, topic=elem.attrib["value"], sfid=sfid, ctype=context_type)
+ item.set_callback(content_lister, topic=elem.attrib["value"], ctype=item_type, sfid=sfid)
+ yield item
+
+
+@Route.register
+def content_lister(plugin, sfid, ctype, topic=None, page_count=1):
+ """
+ :type plugin: Route
+ :type sfid: unicode
+ :type ctype: unicode
+ :type topic: unicode
+ :type page_count: int
+ """
+ # Add link to Alternitve Listing
+ if page_count == 1 and topic:
+ params = {"sfid": sfid, "ctype": u"segment" if ctype == u"video" else u"video", "topic": topic}
+ label = plugin.localize(LIST_AUDIO) if ctype == u"video" else plugin.localize(LIST_VIDEO)
+ item_dict = {"label": label, "callback": content_lister, "params": params}
+ yield Listitem.from_dict(**item_dict)
+
+ # Create content url
+ if topic:
+ url = "https://www.sciencefriday.com/wp-admin/admin-ajax.php?action=get_results&paged=%(next)s&" \
+ "sfid=%(sfid)s&post_types=%(ctype)s&_sft_topic=%(topic)s" % \
+ {"sfid": sfid, "ctype": ctype, "topic": topic, "next": page_count}
+ else:
+ url = "https://www.sciencefriday.com/wp-admin/admin-ajax.php?action=get_results&paged=%(next)s&" \
+ "sfid=%(sfid)s&post_types=%(ctype)s" % \
+ {"sfid": sfid, "ctype": ctype, "next": page_count}
+
+ # Fetch & parse HTML Source
+ ishd = bool(plugin.setting.get_int("video_quality", addon_id="script.module.youtube.dl"))
+ root_elem = plugin.request.get(url).parse()
+
+ # Fetch next page
+ next_url = root_elem.find(".//a[@rel='next']")
+ if next_url is not None:
+ yield Listitem.next_page(sfid=sfid, ctype=ctype, page_count=page_count+1)
+
+ # Parse the elements
+ for element in root_elem.iterfind(".//article"):
+ tag_a = element.find(".//a[@rel='bookmark']")
+ item = Listitem()
+ item.label = tag_a.text
+ item.stream.hd(ishd)
+
+ # Fetch plot & duration
+ tag_p = element.findall(".//p")
+ if tag_p and tag_p[0].get("class") == "run-time":
+ item.info["duration"] = tag_p[0].text
+ item.info["plot"] = tag_p[1].text
+ elif tag_p:
+ item.info["plot"] = tag_p[0].text
+
+ # Fetch image if exists
+ img = element.find(".//img[@data-src]")
+ if img is not None:
+ item.art["thumb"] = img.get("data-src")
+
+ # Fetch audio/video url
+ tag_audio = element.find(".//a[@data-audio]")
+ if tag_audio is not None:
+ audio_url = tag_audio.get("data-audio")
+ item.set_callback(audio_url)
+ else:
+ item.set_callback(play_video, url=tag_a.get("href"))
+
+ yield item
+
+
+@Resolver.register
+def play_video(plugin, url):
+ """
+ :type plugin: Resolver
+ :type url: unicode
+ """
+ # Run SpeedForce to atempt to strip Out any unneeded html tags
+ root_elem = plugin.request.get(url).parse("section", attrs={"class": "video-section bg-lightgrey"})
+
+ # Search for youtube iframe
+ iframe = root_elem.find("./div/iframe")
+ return plugin.extract_source(iframe.get("src"))
+
+
+# Initiate add-on
+if __name__ == "__main__":
+ run()
diff --git a/plugin.video.science.friday/addon.xml b/plugin.video.science.friday/addon.xml
new file mode 100644
index 0000000..5ff7bb0
--- /dev/null
+++ b/plugin.video.science.friday/addon.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<addon id="plugin.video.science.friday" name="Science Friday" provider-name="willforde" version="3.0.0">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="script.module.codequick" version="0.9.0"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource" library="addon.py">
+ <provides>video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <summary lang="en_GB">Science Friday is your trusted source for stories about science.</summary>
+ <description lang="en_GB">Science Friday is your trusted source for news and entertaining stories about science. We started as a radio show, created in 1991 by host and executive producer Ira Flatow. Since then, weve grown into much more: We produce award-winning digital videos and publish original web content covering everything from octopus camouflage to cooking on Mars. SciFri is brain fun, for curious people.</description>
+ <license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license>
+ <source>https://github.com/willforde/plugin.video.science.friday</source>
+ <forum>http://forum.kodi.tv/showthread.php?tid=200630</forum>
+ <website>http://www.sciencefriday.com</website>
+ <email>willforde+addon@gmail.com</email>
+ <platform>all</platform>
+ <language>en</language>
+ <assets>
+ <icon>resources/icon.png</icon>
+ <fanart>resources/fanart.jpg</fanart>
+ <screenshot>resources/screenshots/screenshot000.jpg</screenshot>
+ <screenshot>resources/screenshots/screenshot001.jpg</screenshot>
+ <screenshot>resources/screenshots/screenshot002.jpg</screenshot>
+ </assets>
+ <news>[upd] Upgraded to use the codequick framework.</news>
+ </extension>
+</addon>
diff --git a/plugin.video.science.friday/resources/fanart.jpg b/plugin.video.science.friday/resources/fanart.jpg
new file mode 100644
index 0000000..0d584bc
--- /dev/null
+++ b/plugin.video.science.friday/resources/fanart.jpg
Binary files differ
diff --git a/plugin.video.science.friday/resources/icon.png b/plugin.video.science.friday/resources/icon.png
new file mode 100644
index 0000000..fea6862
--- /dev/null
+++ b/plugin.video.science.friday/resources/icon.png
Binary files differ
diff --git a/plugin.video.science.friday/resources/language/resource.language.en_gb/strings.po b/plugin.video.science.friday/resources/language/resource.language.en_gb/strings.po
new file mode 100644
index 0000000..05d88dd
--- /dev/null
+++ b/plugin.video.science.friday/resources/language/resource.language.en_gb/strings.po
@@ -0,0 +1,45 @@
+# Kodi Media Center language file
+# Addon Name: Science Friday
+# Addon id: plugin.video.science.friday
+# Addon Provider: willforde
+msgid ""
+msgstr ""
+"Project-Id-Version: Kodi Addons\n"
+"Report-Msgid-Bugs-To: alanwww1@kodi.org\n"
+"POT-Creation-Date: 2016-01-28 21:10+0000\n"
+"PO-Revision-Date: 2017-08-01 04:17+0000\n"
+"Last-Translator: Kodi Translation Team\n"
+"Language-Team: English (http://www.transifex.com/projects/p/xbmc-addons/language/en/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+###############################
+# Addon Codes: 30000 to 30199 #
+###############################
+
+msgctxt "#30001"
+msgid "[B]Recent Videos[/B]"
+msgstr ""
+
+msgctxt "#30002"
+msgid "[B]Recent Audio[/B]"
+msgstr ""
+
+msgctxt "#30003"
+msgid "[B]List Audio Items[/B]"
+msgstr ""
+
+msgctxt "#30004"
+msgid "[B]List Video Items[/B]"
+msgstr ""
+
+##################################
+# Settings Codes: 30300 to 30399 #
+##################################
+
+msgctxt "#30301"
+msgid "Default Listing Mode"
+msgstr ""
diff --git a/plugin.video.science.friday/resources/screenshots/screenshot000.jpg b/plugin.video.science.friday/resources/screenshots/screenshot000.jpg
new file mode 100644
index 0000000..f462247
--- /dev/null
+++ b/plugin.video.science.friday/resources/screenshots/screenshot000.jpg
Binary files differ
diff --git a/plugin.video.science.friday/resources/screenshots/screenshot001.jpg b/plugin.video.science.friday/resources/screenshots/screenshot001.jpg
new file mode 100644
index 0000000..e57077d
--- /dev/null
+++ b/plugin.video.science.friday/resources/screenshots/screenshot001.jpg
Binary files differ
diff --git a/plugin.video.science.friday/resources/screenshots/screenshot002.jpg b/plugin.video.science.friday/resources/screenshots/screenshot002.jpg
new file mode 100644
index 0000000..8b89742
--- /dev/null
+++ b/plugin.video.science.friday/resources/screenshots/screenshot002.jpg
Binary files differ
diff --git a/plugin.video.science.friday/resources/settings.xml b/plugin.video.science.friday/resources/settings.xml
new file mode 100644
index 0000000..0f12037
--- /dev/null
+++ b/plugin.video.science.friday/resources/settings.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<settings>
+ <category>
+ <setting id="defaultview" type="enum" label="30301" lvalues="291|292" default="0"/>
+ </category>
+</settings> \ No newline at end of file
diff --git a/plugin.video.simpsonsworld/addon.xml b/plugin.video.simpsonsworld/addon.xml
index af895e2..6288305 100644
--- a/plugin.video.simpsonsworld/addon.xml
+++ b/plugin.video.simpsonsworld/addon.xml
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.video.simpsonsworld" name="Simpsons World" version="2017.4.5" provider-name="eracknaphobia">
+<addon id="plugin.video.simpsonsworld" name="Simpsons World" version="2017.11.28" provider-name="eracknaphobia">
<requires>
- <import addon="xbmc.python" version="2.25.0"/>
- <import addon="script.module.adobepass" version="2017.3.20"/>
+ <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="script.module.adobepass" version="2017.3.20"/>
+ <import addon="script.module.requests" version="2.9.1"/>
</requires>
<extension point="xbmc.python.pluginsource" library="simpsons.py">
<provides>video</provides>
@@ -13,7 +14,7 @@
<description lang="en_GB">Simpsons World has every episode of the series accessible to authenticated FX subscribers</description>
<disclaimer lang="en_GB"></disclaimer>
<news>
-- Fixed Icon / Fanart not displaying
+- Fixed Invalid XML issue
</news>
<language>en</language>
<platform>all</platform>
diff --git a/plugin.video.simpsonsworld/resources/lib/globals.py b/plugin.video.simpsonsworld/resources/lib/globals.py
index 43911f5..869f914 100644
--- a/plugin.video.simpsonsworld/resources/lib/globals.py
+++ b/plugin.video.simpsonsworld/resources/lib/globals.py
@@ -1,8 +1,8 @@
import sys, os
import xbmc, xbmcplugin, xbmcgui, xbmcaddon
-import urllib, urllib2
-import json
+import urllib
import base64
+import requests
from adobepass.adobe import ADOBE
@@ -13,6 +13,7 @@ ROOTDIR = ADDON.getAddonInfo('path')
FANART = os.path.join(ROOTDIR,"resources/media/fanart.jpg")
ICON = os.path.join(ROOTDIR,"resources/media/icon.png")
+VERIFY = False
#Addon Settings
@@ -62,11 +63,12 @@ season_art = {'1':'71663-1-16.jpg',
'26':'71663-26.jpg',
'27':'71663-27-2.jpg',
'28':'71663-28.jpg',
+ '29':'71663-29-3.jpg'
}
def listSeasons():
- for x in range(1, 29):
+ for x in range(1, 30):
title = "Season "+str(x)
url = str(x)
#icon = 'http://thetvdb.com/banners/seasons/71663-'+str(x)+'-15.jpg'
@@ -78,18 +80,20 @@ def listSeasons():
def listEpisodes(season):
- url = "http://fapi2.fxnetworks.com/androidtv/videos?filter%5Bfapi_show_id%5D=9aad7da1-093f-40f5-b371-fec4122f0d86&filter%5Bseason%5D="+season+"&limit=500&filter%5Btype%5D=episode"
- req = urllib2.Request(url)
- req.add_header("Connection", "keep-alive")
- req.add_header("Accept", "*/*")
- req.add_header("Accept-Encoding", "deflate")
- req.add_header("Accept-Language", "en-us")
- req.add_header("Connection", "keep-alive")
- req.add_header("Authentication", "androidtv:a4y4o0e01jh27dsyrrgpvo6d1wvpravc2c4szpp4")
- req.add_header("User-Agent", UA_FX)
- response = urllib2.urlopen(req)
- json_source = json.load(response)
- response.close()
+ url = "http://fapi2.fxnetworks.com/androidtv/videos?filter%5Bfapi_show_id%5D=9aad7da1-093f-40f5-b371-fec4122f0d86&filter%5Bseason%5D="+season+"&limit=500&filter%5Btype%5D=episode"
+
+ headers = {
+ "Connection": "keep-alive",
+ "Accept": "*/*",
+ "Accept-Encoding": "deflate",
+ "Accept-Language": "en-us",
+ "Connection": "keep-alive",
+ "Authentication": "androidtv:a4y4o0e01jh27dsyrrgpvo6d1wvpravc2c4szpp4",
+ "User-Agent": UA_FX,
+ }
+
+ r = requests.get(url, headers=headers, verify=VERIFY)
+ json_source = r.json()
#for episode in reversed(json_source['videos']):
for episode in sorted(json_source['videos'], key=lambda k: k['episode']):
@@ -120,17 +124,19 @@ def getStream(url):
if adobe.authorize():
media_token = adobe.mediaToken()
url = url + "&auth="+urllib.quote(base64.b64decode(media_token))
- req = urllib2.Request(url)
- req.add_header("Accept", "*/*")
- req.add_header("Accept-Encoding", "deflate")
- req.add_header("Accept-Language", "en-us")
- req.add_header("Connection", "keep-alive")
- req.add_header("User-Agent", UA_FX)
- response = urllib2.urlopen(req)
- response.close()
-
- #get the last url forwarded to
- stream_url = response.geturl()
+
+ headers = {
+ "Connection": "keep-alive",
+ "Accept": "*/*",
+ "Accept-Encoding": "deflate",
+ "Accept-Language": "en-us",
+ "Connection": "keep-alive",
+ "User-Agent": UA_FX,
+ }
+
+ r = requests.get(url, headers=headers, verify=VERIFY)
+
+ stream_url = r.url
stream_url = stream_url + '|User-Agent=okhttp/3.4.1'
listitem = xbmcgui.ListItem(path=stream_url)
xbmcplugin.setResolvedUrl(addon_handle, True, listitem)
diff --git a/plugin.video.simpsonsworld/resources/settings.xml b/plugin.video.simpsonsworld/resources/settings.xml
index cf86ce6..691dd1a 100644
--- a/plugin.video.simpsonsworld/resources/settings.xml
+++ b/plugin.video.simpsonsworld/resources/settings.xml
@@ -4,6 +4,6 @@
<category label="30001">
<setting id="ratio" type="labelenum" label="30010" lvalues="16x9|4x3" default="16x9" />
<setting id="commentary" type="bool" label="30020" default="false" />
- <setting id="deauthorize" type="action" label="30900" action="RunPlugin(plugin://plugin.video.simpsonsworld/?url=junk&mode=999)" option="close" />
+ <setting id="deauthorize" type="action" label="30900" action="RunPlugin(plugin://plugin.video.simpsonsworld/?url=junk&amp;mode=999)" option="close" />
</category>
</settings>
diff --git a/plugin.video.skynews/LICENSE.md b/plugin.video.skynews/LICENSE.md
new file mode 100644
index 0000000..733c072
--- /dev/null
+++ b/plugin.video.skynews/LICENSE.md
@@ -0,0 +1,675 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ {one line to give the program's name and a brief idea of what it does.}
+ Copyright (C) {year} {name of author}
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ {project} Copyright (C) {year} {fullname}
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+
diff --git a/plugin.video.skynews/addon.xml b/plugin.video.skynews/addon.xml
new file mode 100644
index 0000000..7bfe3ee
--- /dev/null
+++ b/plugin.video.skynews/addon.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<addon id="plugin.video.skynews" version="1.0.1" name="Sky News" provider-name="Lunatixz">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="script.module.simplecache" version="1.0.0"/>
+ <import addon="script.module.beautifulsoup4" version="4.3.2"/>
+ <import addon="plugin.video.youtube" version="5.1.8" optional="true"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource" library="default.py">
+ <provides>video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <summary lang="en_GB">Sky News is a 24-hour international multimedia news organisation based in the U.K. that started as a 24-hour television news channel.</summary>
+ <description lang="en_GB">Sky News - First for Breaking News, video, headlines, analysis and top stories from business, politics, entertainment and more in the UK and worldwide.</description>
+ <platform>all</platform>
+ <license>GNU GENERAL PUBLIC LICENSE. Version 3, June 2007</license>
+ <source>https://github.com/Lunatixz/XBMC_Addons/tree/master/plugin.video.skynews</source>
+ <website>http://news.sky.com/</website>
+ <forum>https://forum.kodi.tv/showthread.php?tid=320938</forum>
+ <news></news>
+ <assets>
+ <icon>resources/images/icon.png</icon>
+ <fanart>resources/images/fanart.jpg</fanart>
+ <screenshot>resources/images/screenshot01.png</screenshot>
+ <screenshot>resources/images/screenshot02.png</screenshot>
+ </assets>
+ </extension>
+</addon> \ No newline at end of file
diff --git a/plugin.video.skynews/default.py b/plugin.video.skynews/default.py
new file mode 100644
index 0000000..e75d11f
--- /dev/null
+++ b/plugin.video.skynews/default.py
@@ -0,0 +1,23 @@
+# Copyright (C) 2017 Lunatixz
+#
+#
+# This file is part of Sky News.
+#
+# Sky News is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Sky News is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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 Sky News. If not, see <http://www.gnu.org/licenses/>.
+
+# -*- coding: utf-8 -*-
+
+#entrypoint
+if __name__ == '__main__':
+ from resources.lib import skynews \ No newline at end of file
diff --git a/plugin.video.skynews/resources/__init__.py b/plugin.video.skynews/resources/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.skynews/resources/__init__.py
diff --git a/plugin.video.skynews/resources/images/fanart.jpg b/plugin.video.skynews/resources/images/fanart.jpg
new file mode 100644
index 0000000..d439e8d
--- /dev/null
+++ b/plugin.video.skynews/resources/images/fanart.jpg
Binary files differ
diff --git a/plugin.video.skynews/resources/images/icon.png b/plugin.video.skynews/resources/images/icon.png
new file mode 100644
index 0000000..7513b52
--- /dev/null
+++ b/plugin.video.skynews/resources/images/icon.png
Binary files differ
diff --git a/plugin.video.skynews/resources/images/screenshot01.png b/plugin.video.skynews/resources/images/screenshot01.png
new file mode 100644
index 0000000..92f57d5
--- /dev/null
+++ b/plugin.video.skynews/resources/images/screenshot01.png
Binary files differ
diff --git a/plugin.video.skynews/resources/images/screenshot02.png b/plugin.video.skynews/resources/images/screenshot02.png
new file mode 100644
index 0000000..552b95b
--- /dev/null
+++ b/plugin.video.skynews/resources/images/screenshot02.png
Binary files differ
diff --git a/plugin.video.skynews/resources/language/resource.language.en_gb/strings.po b/plugin.video.skynews/resources/language/resource.language.en_gb/strings.po
new file mode 100644
index 0000000..e9ea2eb
--- /dev/null
+++ b/plugin.video.skynews/resources/language/resource.language.en_gb/strings.po
@@ -0,0 +1,25 @@
+# Kodi Media Center language file
+# Addon Name: Sky News
+# Addon id: plugin.video.skynews
+# Addon Provider: Lunatixz
+msgid ""
+msgstr ""
+"Project-Id-Version: plugin.video.skynews\n"
+"Report-Msgid-Bugs-To: https://forum.kodi.tv/showthread.php?tid=320938\n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Lunatixz Translation Team\n"
+"Language-Team: English (http://www.transifex.com/projects/p/xbmc-addons/language/en/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "#30000"
+msgid "Enable Debugging [Log errors]"
+msgstr ""
+
+msgctxt "#30001"
+msgid "Something went wrong, Try again..."
+msgstr "" \ No newline at end of file
diff --git a/plugin.video.skynews/resources/lib/__init__.py b/plugin.video.skynews/resources/lib/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.skynews/resources/lib/__init__.py
diff --git a/plugin.video.skynews/resources/lib/skynews.py b/plugin.video.skynews/resources/lib/skynews.py
new file mode 100644
index 0000000..eb7066a
--- /dev/null
+++ b/plugin.video.skynews/resources/lib/skynews.py
@@ -0,0 +1,171 @@
+# Copyright (C) 2017 Lunatixz
+#
+#
+# This file is part of Sky News.
+#
+# Sky News is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Sky News is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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 Sky News. If not, see <http://www.gnu.org/licenses/>.
+
+# -*- coding: utf-8 -*-
+import os, re, sys, time, datetime, traceback
+import urllib, urllib2, socket, json
+import xbmc, xbmcgui, xbmcplugin, xbmcaddon
+
+from simplecache import SimpleCache
+from bs4 import BeautifulSoup
+
+# Plugin Info
+ADDON_ID = 'plugin.video.skynews'
+REAL_SETTINGS = xbmcaddon.Addon(id=ADDON_ID)
+ADDON_NAME = REAL_SETTINGS.getAddonInfo('name')
+SETTINGS_LOC = REAL_SETTINGS.getAddonInfo('profile')
+ADDON_PATH = REAL_SETTINGS.getAddonInfo('path').decode('utf-8')
+ADDON_VERSION = REAL_SETTINGS.getAddonInfo('version')
+ICON = REAL_SETTINGS.getAddonInfo('icon')
+FANART = REAL_SETTINGS.getAddonInfo('fanart')
+LANGUAGE = REAL_SETTINGS.getLocalizedString
+
+## GLOBALS ##
+TIMEOUT = 15
+DEBUG = REAL_SETTINGS.getSetting('Enable_Debugging') == 'true'
+LIVEURL = 'http://news.sky.com/watch-live'
+YTURL = 'plugin://plugin.video.youtube/play/?video_id='
+
+def log(msg, level=xbmc.LOGDEBUG):
+ if DEBUG == True:
+ if level == xbmc.LOGERROR:
+ msg += ' ,' + traceback.format_exc()
+ xbmc.log(ADDON_ID + '-' + ADDON_VERSION + '-' + (msg), level)
+
+def getParams():
+ param=[]
+ if len(sys.argv[2])>=2:
+ params=sys.argv[2]
+ cleanedparams=params.replace('?','')
+ if (params[len(params)-1]=='/'):
+ params=params[0:len(params)-2]
+ pairsofparams=cleanedparams.split('&')
+ param={}
+ for i in range(len(pairsofparams)):
+ splitparams={}
+ splitparams=pairsofparams[i].split('=')
+ if (len(splitparams))==2:
+ param[splitparams[0]]=splitparams[1]
+ return param
+
+socket.setdefaulttimeout(TIMEOUT)
+class Sky(object):
+ def __init__(self):
+ log('__init__')
+ self.cache = SimpleCache()
+
+
+ def openURL(self, url):
+ log('openURL, url = ' + str(url))
+ try:
+ cacheResponse = self.cache.get(ADDON_NAME + '.openURL, url = %s'%url)
+ if not cacheResponse:
+ request = urllib2.Request(url)
+ request.add_header('User-Agent','Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)')
+ response = urllib2.urlopen(request, timeout=TIMEOUT).read()
+ self.cache.set(ADDON_NAME + '.openURL, url = %s'%url, response, expiration=datetime.timedelta(hours=6))
+ return self.cache.get(ADDON_NAME + '.openURL, url = %s'%url)
+ except urllib2.URLError, e:
+ log("openURL Failed! " + str(e), xbmc.LOGERROR)
+ except socket.timeout, e:
+ log("openURL Failed! " + str(e), xbmc.LOGERROR)
+ except Exception, e:
+ log("openURL Failed! " + str(e), xbmc.LOGERROR)
+ xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30001), ICON, 4000)
+ return ''
+
+
+ def buildMainMenu(self):
+ self.addLink('Live' ,'',0)
+ self.addYoutube('Browse','plugin://plugin.video.youtube/user/skynews/')
+
+
+ def buildLiveLink(self):
+ #parse for youtube live feed, may not be necessary. However its useful if the site changes feeds.
+ soup = BeautifulSoup(self.openURL(LIVEURL), "html.parser")
+ link = 'http:' + soup('div' , {'class': 'sdc-news-story-article__body'})[0].find('iframe').get('src')
+ self.playVideo('Sky News Live',self.resolveYoutube(link))
+
+
+ def resolveYoutube(self, link):
+ if len(re.findall('http[s]?://www.youtube.com/watch', link)) > 0:
+ return YTURL + link.split('/watch?v=')[1]
+ elif len(re.findall('http[s]?://www.youtube.com/embed', link)) > 0:
+ return YTURL + link.split('/embed/')[1].split('?autoplay=1')[0]
+ elif len(re.findall('http[s]?://youtu.be/', link)) > 0:
+ return YTURL + link.split('/youtu.be/')[1]
+
+
+ def playVideo(self, name, url, liz=None):
+ log('playVideo')
+ if not liz:
+ liz = xbmcgui.ListItem(name, path=url)
+ xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
+
+
+ def addLink(self, name, u, mode, infoList=False, infoArt=False, total=0):
+ name = name.encode("utf-8")
+ log('addLink, name = ' + name)
+ liz=xbmcgui.ListItem(name)
+ liz.setProperty('IsPlayable', 'true')
+ if infoList == False:
+ liz.setInfo(type="Video", infoLabels={"mediatype":"video","label":name,"title":name,"genre":"News"})
+ else:
+ liz.setInfo(type="Video", infoLabels=infoList)
+
+ if infoArt == False:
+ liz.setArt({'thumb':ICON,'fanart':FANART})
+ else:
+ liz.setArt(infoArt)
+ u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
+ xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,totalItems=total)
+
+
+ def addYoutube(self, title, url):
+ liz=xbmcgui.ListItem(title)
+ liz.setProperty('IsPlayable', 'false')
+ liz.setInfo(type="Video", infoLabels={"label":title,"title":title} )
+ liz.setArt({'thumb':ICON,'fanart':FANART})
+ xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=liz,isFolder=True)
+
+
+params=getParams()
+try:
+ url=urllib.unquote_plus(params["url"])
+except:
+ url=None
+try:
+ name=urllib.unquote_plus(params["name"])
+except:
+ name=None
+try:
+ mode=int(params["mode"])
+except:
+ mode=None
+
+log("Mode: "+str(mode))
+log("URL : "+str(url))
+log("Name: "+str(name))
+
+if mode==None: Sky().buildMainMenu()
+elif mode == 0: Sky().buildLiveLink()
+elif mode == 9: Sky().playVideo(name, url)
+
+xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_NONE )
+xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_LABEL )
+xbmcplugin.endOfDirectory(int(sys.argv[1]),cacheToDisc=True) \ No newline at end of file
diff --git a/plugin.video.skynews/resources/settings.xml b/plugin.video.skynews/resources/settings.xml
new file mode 100644
index 0000000..afdf009
--- /dev/null
+++ b/plugin.video.skynews/resources/settings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<settings>
+ <setting id="Enable_Debugging" type="bool" label="30000" default="false" />
+</settings>
diff --git a/plugin.video.spiketv/LICENSE b/plugin.video.spiketv/LICENSE
new file mode 100644
index 0000000..9cecc1d
--- /dev/null
+++ b/plugin.video.spiketv/LICENSE
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ {one line to give the program's name and a brief idea of what it does.}
+ Copyright (C) {year} {name of author}
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ {project} Copyright (C) {year} {fullname}
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/plugin.video.spiketv/README.md b/plugin.video.spiketv/README.md
new file mode 100644
index 0000000..afe02e0
--- /dev/null
+++ b/plugin.video.spiketv/README.md
@@ -0,0 +1 @@
+# plugin.video.spiketv \ No newline at end of file
diff --git a/plugin.video.spiketv/addon.xml b/plugin.video.spiketv/addon.xml
new file mode 100644
index 0000000..6e1cb68
--- /dev/null
+++ b/plugin.video.spiketv/addon.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<addon id="plugin.video.spiketv" version="1.0.0" name="Spike" provider-name="Lunatixz">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="script.module.simplecache" version="1.0.0"/>
+ <import addon="script.module.youtube.dl" version="17.0.0"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource" library="default.py">
+ <provides>video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <summary lang="en_GB">Watch full episodes and exclusive show highlights from your favorite Spike shows.</summary>
+ <description lang="en_GB">Spike delivers original entertainment that informs, engages, inspires and above all push the boundaries of the unexpected with series like Bar Rescue, Lip Sync Battle, Ink Master, Catch a Contractor and the combat sports block Friday Night Lights Out.</description>
+ <platform>all</platform>
+ <license>GNU GENERAL PUBLIC LICENSE. Version 3, June 2007</license>
+ <source>https://github.com/Lunatixz/plugin.video.spiketv/tree/master</source>
+ <website>http://spiketv.com</website>
+ <news></news>
+ <forum>https://forum.kodi.tv/showthread.php?tid=323852</forum>
+ <assets>
+ <icon>resources/images/icon.png</icon>
+ <fanart>resources/images/fanart.jpg</fanart>
+ <screenshot>resources/images/screenshot01.png</screenshot>
+ <screenshot>resources/images/screenshot02.png</screenshot>
+ <screenshot>resources/images/screenshot03.png</screenshot>
+ </assets>
+ </extension>
+</addon>
diff --git a/plugin.video.spiketv/default.py b/plugin.video.spiketv/default.py
new file mode 100644
index 0000000..e4ad59d
--- /dev/null
+++ b/plugin.video.spiketv/default.py
@@ -0,0 +1,23 @@
+# Copyright (C) 2017 Lunatixz
+#
+#
+# This file is part of SpikeTV.
+#
+# SpikeTV is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# SpikeTV is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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 SpikeTV. If not, see <http://www.gnu.org/licenses/>.
+
+# -*- coding: utf-8 -*-
+
+#entrypoint
+if __name__ == '__main__':
+ from resources.lib import spiketv \ No newline at end of file
diff --git a/plugin.video.spiketv/resources/__init__.py b/plugin.video.spiketv/resources/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.spiketv/resources/__init__.py
diff --git a/plugin.video.spiketv/resources/images/fanart.jpg b/plugin.video.spiketv/resources/images/fanart.jpg
new file mode 100644
index 0000000..fc53d2d
--- /dev/null
+++ b/plugin.video.spiketv/resources/images/fanart.jpg
Binary files differ
diff --git a/plugin.video.spiketv/resources/images/icon.png b/plugin.video.spiketv/resources/images/icon.png
new file mode 100644
index 0000000..6de08e7
--- /dev/null
+++ b/plugin.video.spiketv/resources/images/icon.png
Binary files differ
diff --git a/plugin.video.spiketv/resources/images/screenshot01.png b/plugin.video.spiketv/resources/images/screenshot01.png
new file mode 100644
index 0000000..c0ca2f5
--- /dev/null
+++ b/plugin.video.spiketv/resources/images/screenshot01.png
Binary files differ
diff --git a/plugin.video.spiketv/resources/images/screenshot02.png b/plugin.video.spiketv/resources/images/screenshot02.png
new file mode 100644
index 0000000..1cfab70
--- /dev/null
+++ b/plugin.video.spiketv/resources/images/screenshot02.png
Binary files differ
diff --git a/plugin.video.spiketv/resources/images/screenshot03.png b/plugin.video.spiketv/resources/images/screenshot03.png
new file mode 100644
index 0000000..100e21e
--- /dev/null
+++ b/plugin.video.spiketv/resources/images/screenshot03.png
Binary files differ
diff --git a/plugin.video.spiketv/resources/language/resource.language.en_gb/strings.po b/plugin.video.spiketv/resources/language/resource.language.en_gb/strings.po
new file mode 100644
index 0000000..affca66
--- /dev/null
+++ b/plugin.video.spiketv/resources/language/resource.language.en_gb/strings.po
@@ -0,0 +1,29 @@
+# Kodi Media Center language file
+# Addon Name: "SpikeTV
+# Addon id: plugin.video.spiketv
+# Addon Provider: Lunatixz
+msgid ""
+msgstr ""
+"Project-Id-Version: plugin.video.spiketv\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Lunatixz Translation Team\n"
+"Language-Team: English (http://www.transifex.com/projects/p/xbmc-addons/language/en/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "#30000"
+msgid "Enable Debugging [Log errors]"
+msgstr ""
+
+msgctxt "#30001"
+msgid "Something went wrong, Try again..."
+msgstr ""
+
+msgctxt "#30002"
+msgid "Select Preferred Quality"
+msgstr ""
diff --git a/plugin.video.spiketv/resources/lib/__init__.py b/plugin.video.spiketv/resources/lib/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.spiketv/resources/lib/__init__.py
diff --git a/plugin.video.spiketv/resources/lib/spiketv.py b/plugin.video.spiketv/resources/lib/spiketv.py
new file mode 100644
index 0000000..5487df0
--- /dev/null
+++ b/plugin.video.spiketv/resources/lib/spiketv.py
@@ -0,0 +1,317 @@
+# Copyright (C) 2017 Lunatixz
+#
+#
+# This file is part of SpikeTV.
+#
+# SpikeTV is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# SpikeTV is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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 SpikeTV. If not, see <http://www.gnu.org/licenses/>.
+
+# -*- coding: utf-8 -*-
+import sys, time, datetime, re, traceback
+import urllib, urllib2, socket, json
+import xbmc, xbmcgui, xbmcplugin, xbmcaddon
+
+from YDStreamExtractor import getVideoInfo
+from simplecache import SimpleCache, use_cache
+
+# Plugin Info
+ADDON_ID = 'plugin.video.spiketv'
+REAL_SETTINGS = xbmcaddon.Addon(id=ADDON_ID)
+ADDON_NAME = REAL_SETTINGS.getAddonInfo('name')
+SETTINGS_LOC = REAL_SETTINGS.getAddonInfo('profile')
+ADDON_PATH = REAL_SETTINGS.getAddonInfo('path').decode('utf-8')
+ADDON_VERSION = REAL_SETTINGS.getAddonInfo('version')
+ICON = REAL_SETTINGS.getAddonInfo('icon')
+FANART = REAL_SETTINGS.getAddonInfo('fanart')
+LANGUAGE = REAL_SETTINGS.getLocalizedString
+
+## GLOBALS ##
+TIMEOUT = 15
+CONTENT_TYPE = 'files'
+DEBUG = REAL_SETTINGS.getSetting('Enable_Debugging') == 'true'
+QUALITY = int(REAL_SETTINGS.getSetting('Quality'))
+PTVL_RUNNING = xbmcgui.Window(10000).getProperty('PseudoTVRunning') == 'True'
+BASE_URL = 'http://www.spike.com'
+IGNORE_LIST = ['ent_m100', 'ent_m069', 'ent_m150', 'ent_m151', 'ent_m112', 'ent_m116']
+MAIN_MENU = [("Latest Episodes", BASE_URL + '/full-episodes', 1),
+ ("Browse Shows" , BASE_URL + '/shows' , 1)]
+
+def log(msg, level=xbmc.LOGDEBUG):
+ if DEBUG == False and level != xbmc.LOGERROR: return
+ if level == xbmc.LOGERROR: msg += ' ,' + traceback.format_exc()
+ xbmc.log(ADDON_ID + '-' + ADDON_VERSION + '-' + msg, level)
+
+def getParams():
+ param=[]
+ if len(sys.argv[2])>=2:
+ params=sys.argv[2]
+ cleanedparams=params.replace('?','')
+ if (params[len(params)-1]=='/'): params=params[0:len(params)-2]
+ pairsofparams=cleanedparams.split('&')
+ param={}
+ for i in range(len(pairsofparams)):
+ splitparams={}
+ splitparams=pairsofparams[i].split('=')
+ if (len(splitparams))==2: param[splitparams[0]]=splitparams[1]
+ return param
+
+socket.setdefaulttimeout(TIMEOUT)
+class SpikeTV(object):
+ def __init__(self):
+ log('__init__')
+ self.cache = SimpleCache()
+
+
+ def openURL(self, url):
+ log('openURL, url = ' + str(url))
+ try:
+ cacheresponse = self.cache.get(ADDON_NAME + '.openURL, url = %s'%url)
+ if not cacheresponse:
+ request = urllib2.Request(url)
+ response = urllib2.urlopen(request, timeout = TIMEOUT).read()
+ self.cache.set(ADDON_NAME + '.openURL, url = %s'%url, response, expiration=datetime.timedelta(hours=1))
+ return self.cache.get(ADDON_NAME + '.openURL, url = %s'%url)
+ except Exception as e:
+ log("openURL Failed! " + str(e), xbmc.LOGERROR)
+ xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30001), ICON, 4000)
+ return ''
+
+
+ def buildMenu(self, items):
+ for item in items: self.addDir(*item)
+ self.addYoutube("Browse Youtube" , 'plugin://plugin.video.youtube/user/SpikeTV/')
+
+
+ def browse(self, name, url):
+ log('browse, ' + name)
+ response = self.openURL(url)
+ if len(response) == 0: return
+ try: items = json.loads(re.search('var triforceManifestURL = "(.+?)";',response).group(1))
+ except: items = json.loads(re.search('var triforceManifestFeed = (.+?);',response).group(1))
+ try: thumb = (response.split('//meta[@property="og:image"]/@content')[0].strip() or ICON)
+ except: thumb = ICON
+ thumb = (thumb or ICON)
+ if not thumb.endswith(('.png','.jpg')): thumb = ICON
+ if items and 'manifest' not in items: return
+ for item in items['manifest']['zones']:
+ if item in ('header', 'footer', 'ads-reporting', 'ENT_M171'): continue
+ try: result = items['manifest']['zones'][item]['feed']
+ except: result = None
+ if result is None: continue
+ try: ent_code = result.split('/feeds/')[1].split('/')[0]
+ except: ent_code = ''
+ ent_code = ent_code.split('_spike')[0]
+ if ent_code not in IGNORE_LIST: continue
+ jsonResponse = json.loads(self.openURL(result))
+ if ent_code == 'ent_m151':
+ try: title = jsonResponse['result']['data']['headerText'].title()
+ except: continue
+ infoLabels = {"mediatype":"tvshows","label":title ,"title":title,"TVShowTitle":title}
+ infoArt = {"thumb":thumb,"poster":thumb,"fanart":FANART,"icon":ICON,"logo":ICON}
+ if name != 'Latest Episodes': self.addDir(title,result,2,infoLabels,infoArt)
+ for item in jsonResponse['result']['data']['shows']:
+ title = item['title']
+ infoLabels = {"mediatype":"tvshows","label":title ,"title":title,"TVShowTitle":title}
+ infoArt = {"thumb":thumb,"poster":thumb,"fanart":FANART,"icon":ICON,"logo":ICON}
+ if name == 'Latest Episodes' and title == 'all shows': return self.browseVideos(title, item['url'])
+ elif name == 'Latest Episodes': continue
+ self.addDir(title,item['url'],2,infoLabels,infoArt)
+ elif ent_code == 'ent_m112':
+ try: title = jsonResponse['result']['promo']['headline'].title()
+ except: continue
+ # if title == 'Full Episodes': return self.browseVideos(title, result)
+ # elif name != 'Full Episodes': continue
+ infoLabels = {"mediatype":"tvshows","label":title ,"title":title,"TVShowTitle":title}
+ infoArt = {"thumb":thumb,"poster":thumb,"fanart":FANART,"icon":ICON,"logo":ICON}
+ self.addDir(title,result,2,infoLabels,infoArt)
+ else:
+ if ent_code == 'ent_m116':
+ type = 'filters'
+ try: title = jsonResponse['result']['promo']['headline'].title()
+ except: continue
+ else:
+ type = 'items'
+ try: title = jsonResponse['result']['data']['headerText'].title()
+ except:
+ try: title = jsonResponse['result']['data']['header']['title'].title()
+ except: continue
+ myURL = json.dumps({"url":result,"type":type})
+ # if title == 'Full Episodes': return self.browseShows(title, myURL)
+ # elif name != 'Full Episodes' and name != 'Browse Shows': continue
+ infoLabels = {"mediatype":"tvshows","label":title ,"title":title,"TVShowTitle":title}
+ infoArt = {"thumb":thumb,"poster":thumb,"fanart":FANART,"icon":ICON,"logo":ICON}
+ # if name == 'Browse Shows' and title == 'All Shows': return self.browseShows(title, myURL)
+ self.addDir(title,myURL,3,infoLabels,infoArt)
+
+
+ def browseVideos(self, name, url):
+ log('browseVideos, ' + name)
+ jsonResponse = json.loads(self.openURL(url))
+ try: videos = jsonResponse['result']['items']
+ except:
+ try: videos = jsonResponse['result']['data']['items']
+ except: return
+ for video in videos:
+ try: vid_url = video['canonicalURL']
+ except:
+ try: vid_url = video['itemURL']
+ except: continue
+ if not ('/video-clips/') in vid_url and not ('/video-playlists/') in vid_url and not ('/full-episodes/') in vid_url and not ('/episodes/') in vid_url: continue
+ if 'bellator.spike.com' in vid_url: continue
+ try: thumb = (video['images'][0]['url'] or ICON)
+ except:
+ try: thumb = (video['image'][0]['url'] or ICON)
+ except: thumb = ICON
+ thumb = (thumb or ICON)
+ if thumb and thumb.startswith('//'): thumb = 'http:' + thumb
+ try: show = video['show']['title']
+ except: show = video['showTitle']
+ try: episodeNumber = int(video['season']['episodeNumber'])
+ except: episodeNumber = 0
+ try: seasonNumber = int(video['season']['seasonNumber'])
+ except: seasonNumber = 0
+ try: raw_date = video['airDate']
+ except: raw_date = video['publishDate']
+ try: aired = (datetime.datetime.strptime(raw_date, '%m/%d/%y'))
+ except: aired = datetime.datetime.now()
+ aired = aired.strftime('%Y-%m-%d')
+ try:
+ runtime = video['duration'].split(':')
+ if len(runtime) == 3:
+ h, m, s = runtime
+ duration = int(h) * 3600 + int(m) * 60 + int(s)
+ else:
+ m, s = runtime
+ duration = int(m) * 60 + int(s)
+ except: duration = video['duration']
+ label = video['title']
+ seinfo = ('S' + ('0' if seasonNumber < 10 else '') + str(seasonNumber) + 'E' + ('0' if episodeNumber < 10 else '') + str(episodeNumber))
+ label = '%s'%(label) if seasonNumber + episodeNumber == 0 else '%s - %s'%(label, seinfo)
+ label = '%s - %s'%(show,label) if len(show) > 0 else label
+ infoLabels = {"mediatype":"episode","label":label ,"title":label,"TVShowTitle":show,"duration":duration,"plot":video['description'],"aired":aired}
+ infoArt = {"thumb":thumb,"poster":thumb,"fanart":FANART,"icon":ICON,"logo":ICON}
+ CONTENT_TYPE = 'episodes'
+ self.addLink(label, vid_url, 9, infoLabels, infoArt, len(videos))
+ try: next_page = jsonResponse['result']['data']['nextPageURL']
+ except: next_page = None
+ if next_page: self.addDir('>> Next',next_page, 2)
+
+
+ def browseShows(self, name, myURL):
+ log('browseShows, ' + name)
+ myURL = json.loads(myURL)
+ url = myURL['url']
+ type = myURL['type']
+ feed = url
+ counter = 0
+ jsonResponse = json.loads(self.openURL(url))
+ try: shows = jsonResponse['result']['data'][type]
+ except:
+ try: shows = jsonResponse['result'][type]
+ except: shows = []
+ for item in shows:
+ if '/ent_m150/' in feed or '/ent_m100/' in feed or '/ent_m069/' in feed:
+ try: url = item['canonicalURL']
+ except:
+ try: url = item['url']
+ except: continue
+ if '/shows/' not in url: continue
+ if item['title'] in IGNORE_LIST: continue
+ try: thumb = (item['image']['url'] or ICON)
+ except:
+ try: thumb = (item['image'][0]['url'] or ICON)
+ except: thumb = thumb
+ thumb = (thumb or ICON)
+ if thumb.startswith('//'): thumb = 'https:' + thumb
+ title = item['title']
+ infoLabels = {"mediatype":"tvshows","label":title ,"title":title,"TVShowTitle":title}
+ infoArt = {"thumb":thumb,"poster":thumb,"fanart":FANART,"icon":ICON,"logo":ICON}
+ self.addDir(title,url,1,infoLabels,infoArt)
+
+
+ def playVideo(self, name, url, liz=None):
+ log('playVideo')
+ if PTVL_RUNNING: return
+ info = getVideoInfo(url,QUALITY,True)
+ if info is None: return
+ info = info.streams()
+ info = sorted(info, key=lambda x: x['idx'])
+ plst = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
+ plst.clear()
+ for idx, videos in enumerate(info):
+ url = videos['xbmc_url']
+ liz = xbmcgui.ListItem(videos['title'], path=url)
+ if 'subtitles' in videos['ytdl_format']: liz.setSubtitles([x['url'] for x in videos['ytdl_format']['subtitles'].get('en','') if 'url' in x])
+ plst.add(url, liz, videos['idx'])
+ xbmc.sleep(100)
+ plst.unshuffle()
+ xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
+
+
+ def addYoutube(self, name, url):
+ liz=xbmcgui.ListItem(name)
+ liz.setProperty('IsPlayable', 'false')
+ liz.setInfo(type="Video", infoLabels={"label":name,"title":name} )
+ liz.setArt({'thumb':ICON,'fanart':FANART})
+ xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=liz,isFolder=True)
+
+
+ def addLink(self, name, u, mode, infoList=False, infoArt=False, total=0):
+ name = name.encode("utf-8")
+ log('addLink, name = ' + name)
+ liz=xbmcgui.ListItem(name)
+ liz.setProperty('IsPlayable', 'true')
+ if infoList == False: liz.setInfo(type="Video", infoLabels={"mediatype":"video","label":name,"title":name})
+ else: liz.setInfo(type="Video", infoLabels=infoList)
+ if infoArt == False: liz.setArt({'thumb':ICON,'fanart':FANART})
+ else: liz.setArt(infoArt)
+ u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
+ xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,totalItems=total)
+
+
+ def addDir(self, name, u, mode, infoList=False, infoArt=False):
+ name = name.encode("utf-8")
+ log('addDir, name = ' + name)
+ liz=xbmcgui.ListItem(name)
+ liz.setProperty('IsPlayable', 'false')
+ if infoList == False: liz.setInfo(type="Video", infoLabels={"mediatype":"video","label":name,"title":name})
+ else: liz.setInfo(type="Video", infoLabels=infoList)
+ if infoArt == False: liz.setArt({'thumb':ICON,'fanart':FANART})
+ else: liz.setArt(infoArt)
+ u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
+ xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
+
+
+params=getParams()
+try: url=urllib.unquote_plus(params["url"])
+except: url=None
+try: name=urllib.unquote_plus(params["name"])
+except: name=None
+try: mode=int(params["mode"])
+except: mode=None
+log("Mode: "+str(mode))
+log("URL : "+str(url))
+log("Name: "+str(name))
+
+if mode==None: SpikeTV().buildMenu(MAIN_MENU)
+elif mode == 1: SpikeTV().browse(name, url)
+elif mode == 2: SpikeTV().browseVideos(name, url)
+elif mode == 3: SpikeTV().browseShows(name, url)
+elif mode == 9: SpikeTV().playVideo(name, url)
+
+xbmcplugin.setContent(int(sys.argv[1]) , CONTENT_TYPE)
+xbmcplugin.addSortMethod(int(sys.argv[1]) , xbmcplugin.SORT_METHOD_UNSORTED)
+xbmcplugin.addSortMethod(int(sys.argv[1]) , xbmcplugin.SORT_METHOD_NONE)
+xbmcplugin.addSortMethod(int(sys.argv[1]) , xbmcplugin.SORT_METHOD_LABEL)
+xbmcplugin.addSortMethod(int(sys.argv[1]) , xbmcplugin.SORT_METHOD_TITLE)
+xbmcplugin.endOfDirectory(int(sys.argv[1]), cacheToDisc=True) \ No newline at end of file
diff --git a/plugin.video.spiketv/resources/settings.xml b/plugin.video.spiketv/resources/settings.xml
new file mode 100644
index 0000000..fbc5978
--- /dev/null
+++ b/plugin.video.spiketv/resources/settings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<settings>
+ <setting id="Enable_Debugging" type="bool" label="30000" default="false" />
+ <setting id="Quality" type="enum" label="30002" default="3" values="SD|720p|1080p|Highest Available"/>
+</settings>
diff --git a/plugin.video.spurs-tv/addon.py b/plugin.video.spurs-tv/addon.py
index a3f4fca..fb5f5d7 100644
--- a/plugin.video.spurs-tv/addon.py
+++ b/plugin.video.spurs-tv/addon.py
@@ -372,10 +372,12 @@ def show_stadium_video_gallery():
def play_live_audio_commentary():
entry_id = live_audio_commentary_id()
if is_live(entry_id):
- url = get_media_url(entry_id)
+ url = HLS_URL_FMT.format(entry_id)
+ log("Playing URL {}".format(url))
else:
xbmcgui.Dialog().ok('Live Audio Commentary', plugin.get_string(30050))
url = None
+ log("Live audio commentary not currently available")
return plugin.set_resolved_url(url)
@plugin.route('/videos/path/<path>')
diff --git a/plugin.video.spurs-tv/addon.xml b/plugin.video.spurs-tv/addon.xml
index 3364f4b..fa0d75f 100644
--- a/plugin.video.spurs-tv/addon.xml
+++ b/plugin.video.spurs-tv/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.video.spurs-tv" name="Spurs TV" version="2.14.0" provider-name="Leopold">
+<addon id="plugin.video.spurs-tv" name="Spurs TV" version="2.14.2" provider-name="Leopold">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
<import addon="script.module.kodiswift" version="0.0.8" optional="false"/>
@@ -21,6 +21,6 @@
<forum>http://forum.kodi.tv/showthread.php?tid=235234</forum>
<source>https://github.com/LS80/plugin.video.spurs-tv.git</source>
<license>GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007</license>
- <news>Fixed New Stadium category</news>
+ <news>Fixed Live Audio Commentary</news>
</extension>
</addon>
diff --git a/plugin.video.spurs-tv/changelog.txt b/plugin.video.spurs-tv/changelog.txt
index d96dedf..05a1af9 100644
--- a/plugin.video.spurs-tv/changelog.txt
+++ b/plugin.video.spurs-tv/changelog.txt
@@ -1,3 +1,9 @@
+v2.14.2 (2017-10-01)
+ - Fixed Live Audio Commentary
+
+v2.14.1 (2017-09-26)
+ - Fixed new stadium video gallery
+
v2.14.0 (2017-04-23)
- Fixed New Stadium category after new YouTube streams were added
- Update icon again, to match the video logo
diff --git a/plugin.video.spurs-tv/resources/lib/new_stadium.py b/plugin.video.spurs-tv/resources/lib/new_stadium.py
index 1534417..1cbe209 100644
--- a/plugin.video.spurs-tv/resources/lib/new_stadium.py
+++ b/plugin.video.spurs-tv/resources/lib/new_stadium.py
@@ -14,7 +14,7 @@ import requests
URL_ROOT = "http://new-stadium.tottenhamhotspur.com/"
-RE_EMBED = re.compile(r'kWidget\.embed\((.*)\)')
+RE_EMBED = re.compile(r'kWidget\.embed\((.*)\)', re.MULTILINE|re.DOTALL)
Video = namedtuple('Video', ['title', 'id'])
diff --git a/plugin.video.trekyards/LICENSE b/plugin.video.trekyards/LICENSE
new file mode 100644
index 0000000..9cecc1d
--- /dev/null
+++ b/plugin.video.trekyards/LICENSE
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ {one line to give the program's name and a brief idea of what it does.}
+ Copyright (C) {year} {name of author}
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ {project} Copyright (C) {year} {fullname}
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/plugin.video.trekyards/README.md b/plugin.video.trekyards/README.md
new file mode 100644
index 0000000..3730fa5
--- /dev/null
+++ b/plugin.video.trekyards/README.md
@@ -0,0 +1 @@
+# plugin.video.trekyards \ No newline at end of file
diff --git a/plugin.video.trekyards/addon.xml b/plugin.video.trekyards/addon.xml
new file mode 100644
index 0000000..87e47cf
--- /dev/null
+++ b/plugin.video.trekyards/addon.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<addon id="plugin.video.trekyards" version="1.0.0" name="TrekYards - YouTube" provider-name="Lunatixz">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="plugin.video.youtube" version="5.3.10"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource" library="default.py">
+ <provides>video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <summary lang="en_GB">If you love Star Trek, Star Wars, or just great Sci-Fi then this channel is for you.</summary>
+ <description lang="en_GB">This is the domain for the Trekyards Webseries, where we examine the ships and tech from the Star Trek Universe. We interview the people behind Star Trek (past, present and future) and get their exclusive and interesting perspectives on the designs and history of this amazing franchise. Industry greats like Doug Drexler, Rick Sternbach, John Eaves, Andrew Probert, Rob Bonchune, Tobias Richter, Alec Peters, Larry Nemecek, Rob Burnett, Scott Nakada and many more join us on a regular basis to talk Trek and allow you, the viewers to gain a unique perspective on the world both in universe and behind the scenes. The channel focus's on Stuart "Captain" Foley and Samuel "Commander" Cockings lives, including product reviews, unboxings, Captains Log's (a behind the scenes look at Trekyards), Fleetyards (sci-fi ships from all franchises) model building videos and assorted other goodies. If you love Star Trek, Star Wars, or just great Sci-Fi then this channel is for you. Welcome and enjoy!</description>
+ <platform>all</platform>
+ <website>http://trekyards.com</website>
+ <license>GNU GENERAL PUBLIC LICENSE. Version 3, June 2007</license>
+ <source>https://github.com/Lunatixz/plugin.video.trekyards/tree/master</source>
+ <forum>https://forum.kodi.tv/showthread.php?tid=323520</forum>
+ <news></news>
+ <assets>
+ <icon>resources/images/icon.png</icon>
+ <fanart>resources/images/fanart.jpg</fanart>
+ </assets>
+ </extension>
+</addon> \ No newline at end of file
diff --git a/plugin.video.trekyards/default.py b/plugin.video.trekyards/default.py
new file mode 100644
index 0000000..a2b14a0
--- /dev/null
+++ b/plugin.video.trekyards/default.py
@@ -0,0 +1,22 @@
+# Copyright (C) 2017 Lunatixz
+#
+#
+# This file is part of TrekYards.
+#
+# TrekYards is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# TrekYards is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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 TrekYards. If not, see <http://www.gnu.org/licenses/>.
+
+# -*- coding: utf-8 -*-
+import xbmc
+if __name__ == '__main__':
+ xbmc.executebuiltin("ActivateWindow(10025,plugin://plugin.video.youtube/user/knightstalker666/)") \ No newline at end of file
diff --git a/plugin.video.trekyards/resources/images/fanart.jpg b/plugin.video.trekyards/resources/images/fanart.jpg
new file mode 100644
index 0000000..3d4015b
--- /dev/null
+++ b/plugin.video.trekyards/resources/images/fanart.jpg
Binary files differ
diff --git a/plugin.video.trekyards/resources/images/icon.png b/plugin.video.trekyards/resources/images/icon.png
new file mode 100644
index 0000000..1532ae8
--- /dev/null
+++ b/plugin.video.trekyards/resources/images/icon.png
Binary files differ
diff --git a/plugin.video.tvvn/LICENSE.txt b/plugin.video.tvvn/LICENSE.txt
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/plugin.video.tvvn/LICENSE.txt
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/plugin.video.tvvn/README.txt b/plugin.video.tvvn/README.txt
new file mode 100644
index 0000000..08fe9bb
--- /dev/null
+++ b/plugin.video.tvvn/README.txt
@@ -0,0 +1,11 @@
+This plugin allows you to watch live TV channels or listen to radio stations
+in Viet Nam or from overseas providers straight from the XBMC interface,
+thus eliminating the needs for using browsers and flashplayer, etc.
+
+DISCLAIMER: All live streams are pulled from online providers and in no way
+represent my views or opinions. I also hold no control over the quality of
+the streams nor that of your internet connection :)
+
+DONATIONS: Given the personal time and effort put in to this little project,
+I have decided to accept donations. If you enjoy using the plugin, you can
+make donations via PayPal to b_at_zecoj_dot_com
diff --git a/plugin.video.tvvn/addon.xml b/plugin.video.tvvn/addon.xml
new file mode 100644
index 0000000..f949bfd
--- /dev/null
+++ b/plugin.video.tvvn/addon.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<addon
+ id="plugin.video.tvvn"
+ version="0.9.11"
+ name="TV Viet Nam"
+ provider-name="Binh Nguyen">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource" library="tvvn.py">
+ <provides>video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <platform>all</platform>
+ <language>en vi</language>
+ <website>http://zecoj.com</website>
+ <source>https://github.com/zecoj/xbmc-tvvn</source>
+ <summary lang="en_GB">TV Viet Nam</summary>
+ <summary lang="vi">TV Việt Nam</summary>
+ <description lang="en_GB">This plugin allows you to watch live TV channels or listen to radio stations in Viet Nam or from overseas providers straight from the XBMC interface, thus eliminating the needs for using browsers and flashplayer, etc. Bug report at: zecoj.com. If you enjoy using the plugin, consider donate via PayPal to b [AT] zecoj [DOT] com</description>
+ <description lang="vi">Xem trực tiếp các kênh truyền hình và các đài phát thanh từ Việt Nam và hải ngoại. If you enjoy using the plugin, consider donate via PayPal to b [AT] zecoj [DOT] com</description>
+ <disclaimer lang="en_GB">All live streams are pulled from online providers and in no way represent my views or opinions. I also hold no control over the quality of the streams nor that of your internet connection :)</disclaimer>
+ <disclaimer lang="vi">Tất cả live streams được tải về từ các nhà cung cấp dịch vụ. Tác giả phần mềm này không chịu trách nhiệm về nội dung của chúng.</disclaimer>
+ <license>GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007</license>
+ </extension>
+</addon>
diff --git a/plugin.video.tvvn/changelog.txt b/plugin.video.tvvn/changelog.txt
new file mode 100644
index 0000000..f6a2aac
--- /dev/null
+++ b/plugin.video.tvvn/changelog.txt
@@ -0,0 +1,102 @@
+version 0.9.11 (19/09/2017):
+ * fix translatePath as per http://kodi.wiki/view/Add-on_rules#Requirements_for_scripts_and_plugins
+
+version 0.9.10 (19/09/2017):
+ * remove all broken sources, TVNet (VTC) is the only active one.
+ * compressed all images properly
+
+version 0.9.9 (18/11/2015):
+ * fix fpt, tvnet (ex vtc)
+
+version 0.9.8 (10/09/2015):
+ * fix fpt, tvnet (ex vtc)
+ * add vtvgo
+ * fix up some fetching methods
+
+version 0.9.7 (10/06/2015):
+ * Login to HPLUS
+ * Updated data.json format
+
+version 0.9.6 (07/06/2015):
+ * Added new method to grab m3u8 from FPT
+ * Updated data.json format
+
+version 0.9.5 (31/05/2015):
+ * Added new method to grab m3u8, tiny bit more flexible
+
+version 0.9.4 (14/09/2014):
+ * Fix a big with data.json operation
+
+version 0.9.3 (11/07/2014):
+ * Futher changes to comply with Gotham
+
+version 0.9.2 (10/07/2014):
+ * Futher changes to comply with Gotham
+ * Error proof channel-list update
+ * This is the last version for Frodo (v12) future updates will be Gotham (v13)
+ only
+
+version 0.9.1 (05/06/2013):
+ * Changes to comply with Frodo API. Frodo-only going forward.
+
+version 0.9.0 (05/06/2013):
+ * complete rewrite, ensure speedy future updates to channels
+ * temporarily removed oversea channels, none is working
+ * this is the last version for Eden (v11) future updates will be Frodo (v12) only
+
+version 0.8.2 (10/11/2012):
+ * reverted VTV1-4, HTV7,9 & HN1 to vtc.com.vn's source
+ * fixed VpopTV
+ * temporarily removed dead tv24.vn channels (very flaky source lately)
+
+version 0.8.1 (27/07/2012):
+ * adds LifeTV and VpopTV (thanks to bolex17)
+
+version 0.8.0 (25/07/2012):
+ * adds more oversea channels
+ * updates disclaimer
+ * improvements and bug fixes
+ * code clean up
+
+version 0.7.2 (07/05/2012):
+ * show channel's name on "Information screen" during playback
+ * the following options are now available under "Add-on settings"
+ - user can now move the channels' descriptions to the left of channels'
+ names (this makes skins with right-aligned lists looks nicer)
+ - user can now have the option of using tv24.vn's RTMP streams instead
+ of the HTTP streams (seems like OSX users have some playback issues
+ with the HTTP streams)
+
+version 0.7.1 (28/04/2012):
+ * make use of tv24.vn mp4 streams over http -> faster buffering
+ * make use of "SD" streams from tv24.vn -> better quality
+ * VTV1-3 channels will now use streams from tv24.vn
+ * clean up channels descriptions
+
+version 0.7.0 (26/04/2012):
+ * users can now show/hide channels descriptions via "Add-on Settings"
+ * more channels (ANTV and 11 local channels)
+ * change play_video method to work around for tv24.vn
+ * fix playback issue with Windows builds
+ * code clean up
+
+version 0.5.2 (09/04/2012):
+ * minor changes to conform with eden's requirement
+ * minor improvements to artwork
+
+version 0.5.1 (05/04/2012):
+ * move to official repository
+ * new logo
+
+version 0.5.0 (25/03/2012):
+ * improve & add artwork
+ * add more channels from tv24.com.vn
+ * repository created
+
+version 0.3.0 (02/12/2011):
+ * new artwork
+ * source fix-up
+ * new method of getting streams
+
+version 0.1.0 (12/11/2010):
+ * initial release
diff --git a/plugin.video.tvvn/data.json b/plugin.video.tvvn/data.json
new file mode 100644
index 0000000..44aab62
--- /dev/null
+++ b/plugin.video.tvvn/data.json
@@ -0,0 +1,1165 @@
+{
+ "timestamp":"1471611308",
+ "sources": {
+ "vtvgo": {
+ "url": "http://vtvgo.vn/streaming.php?id=XXX_PID",
+ "app": ""
+ },
+ "hplus": {
+ "login": "true",
+ "url": "http://hplus.com.vn/user/login/",
+ "post": {"email": "g4644345@trbvm.com", "passwd": "g4644345", "remember": "false", "href": "http://hplus.com.vn/vi"},
+ "app": ""
+ },
+ "vtc": {
+ "url": "http://www.tvnet.gov.vn/xml.php?id=XXX_PID&tp=l",
+ "app": ""
+ },
+ "xunghe": {
+ "url": "rtmp://118.69.176.149/live",
+ "swfurl": "http://tv.xunghe.vn/player.swf",
+ "pageurl": "http://tv.xunghe.vn/?tab=Truyen-Hinh&xem=trt1-hue",
+ "token": "",
+ "app": ""
+ }
+ },
+ "directories": {
+ "root": {
+ "title": "root",
+ "logo": "",
+ "desc": "root menu",
+ "content": [
+ {"type":"chn","id":"vtc_vtv1"},
+ {"type":"chn","id":"vtc_vtv2"},
+ {"type":"chn","id":"vtc_vtv3"},
+ {"type":"chn","id":"vtc_vtv4"},
+ {"type":"chn","id":"vtc_ttxvn"},
+ {"type":"chn","id":"vtc_htv9"},
+ {"type":"chn","id":"vtc_vtc1"},
+ {"type":"chn","id":"vtc_vtc10"},
+ {"type":"chn","id":"vtc_vtc16"},
+ {"type":"chn","id":"vtc_hn1"},
+ {"type":"dir_","id":"fpt"},
+ {"type":"dir_","id":"vtc"},
+ {"type":"dir_","id":"vtvgo"},
+ {"type":"dir_","id":"hplus"},
+ {"type":"dir_","id":"vtvplus"},
+ {"type":"dir_","id":"vov"},
+ {"type":"dir_","id":"local"}
+ ]
+ },
+ "fpt": {
+ "title": "Nguồn FPT",
+ "logo": "default.png",
+ "desc": "Công ty Phát triển Đầu tư Công nghệ",
+ "content": [
+ {"type":"chn","id":"fpt_vtv1"},
+ {"type":"chn","id":"fpt_vtv2"},
+ {"type":"chn","id":"fpt_vtv3"},
+ {"type":"chn","id":"fpt_vtv4"},
+ {"type":"chn_","id":"fpt_vtv6"},
+ {"type":"chn_","id":"fpt_vtv9"},
+ {"type":"chn","id":"fpt_qpvn"},
+ {"type":"chn","id":"fpt_antv"},
+ {"type":"chn","id":"fpt_vtc1"},
+ {"type":"chn","id":"fpt_vtc2"},
+ {"type":"chn","id":"fpt_vtc3"},
+ {"type":"chn","id":"fpt_vtc5"},
+ {"type":"chn","id":"fpt_vtc6"},
+ {"type":"chn","id":"fpt_vtc7"},
+ {"type":"chn","id":"fpt_vtc10"},
+ {"type":"chn","id":"fpt_vtc14"},
+ {"type":"chn","id":"fpt_vtc16"},
+ {"type":"chn","id":"fpt_htvhd"},
+ {"type":"chn","id":"fpt_thuanviethd"},
+ {"type":"chn","id":"fpt_htvchd"},
+ {"type":"chn","id":"fpt_onetv"}
+ ]
+ },
+ "vtc": {
+ "title": "Nguồn VTC",
+ "logo": "default.png",
+ "desc": "Tổng Công ty Truyền thông Đa phương tiện Việt Nam",
+ "content": [
+ {"type":"chn","id":"vtc_vtv1"},
+ {"type":"chn","id":"vtc_vtv2"},
+ {"type":"chn","id":"vtc_vtv3"},
+ {"type":"chn","id":"vtc_vtv4"},
+ {"type":"chn","id":"vtc_ttxvn"},
+ {"type":"chn","id":"vtc_htv9"},
+ {"type":"chn","id":"vtc_vtc1"},
+ {"type":"chn","id":"vtc_vtc10"},
+ {"type":"chn","id":"vtc_vtc16"},
+ {"type":"chn","id":"vtc_hn1"}
+ ]
+ },
+ "vtvgo": {
+ "title": "Nguồn VTVGo",
+ "logo": "default.png",
+ "desc": "TT Sản xuất & Kinh doanh Nội dung số Đài TH Việt Nam",
+ "content": [
+ {"type":"chn","id":"vtvgo_vtv1"},
+ {"type":"chn","id":"vtvgo_vtv2"},
+ {"type":"chn","id":"vtvgo_vtv3"},
+ {"type":"chn","id":"vtvgo_vtv4"},
+ {"type":"chn","id":"vtvgo_vtv5"},
+ {"type":"chn","id":"vtvgo_vtv6"},
+ {"type":"chn","id":"vtvgo_vtv9"},
+ {"type":"chn","id":"vtvgo_vtvhue"},
+ {"type":"chn","id":"vtvgo_vtvdn"},
+ {"type":"chn","id":"vtvgo_vtvpy"},
+ {"type":"chn","id":"vtvgo_vtvct1"}
+ ]
+ },
+ "hplus": {
+ "title": "Nguồn HPlus",
+ "logo": "default.png",
+ "desc": "Công ty Dịch vụ Kỹ thuật Truyền thông HTV",
+ "content": [
+ {"type":"chn","id":"hplus_vtv1"},
+ {"type":"chn","id":"hplus_vtv2"},
+ {"type":"chn","id":"hplus_vtv3"},
+ {"type":"chn_","id":"hplus_vtv3hd"},
+ {"type":"chn","id":"hplus_vtv6hd"},
+ {"type":"chn","id":"hplus_vtv9"},
+ {"type":"chn","id":"hplus_htv1"},
+ {"type":"chn_","id":"hplus_htv2"},
+ {"type":"chn_","id":"hplus_htv2hd"},
+ {"type":"chn_","id":"hplus_htv3"},
+ {"type":"chn","id":"hplus_htv4"},
+ {"type":"chn","id":"hplus_htv7hd"},
+ {"type":"chn","id":"hplus_htv9hd"},
+ {"type":"chn","id":"hplus_vtc3"},
+ {"type":"chn","id":"hplus_vtc4"},
+ {"type":"chn","id":"hplus_vtc6"},
+ {"type":"chn","id":"hplus_vtc10"}
+ ]
+ },
+ "vtvplus": {
+ "title": "Nguồn VTVPlus",
+ "logo": "default.png",
+ "desc": "Công ty Truyền hình cáp Việt Nam",
+ "content": [
+ {"type":"chn","id":"vtvplus_vtv1"},
+ {"type":"chn","id":"vtvplus_vtv2"},
+ {"type":"chn","id":"vtvplus_vtv3"},
+ {"type":"chn","id":"vtvplus_vtv4"},
+ {"type":"chn","id":"vtvplus_vtv6"},
+ {"type":"chn","id":"vtvplus_vtv9"}
+ ]
+ },
+ "vov": {
+ "title": "VOV Radio",
+ "logo": "vov.png",
+ "desc": "Đài Tiếng nói Việt Nam",
+ "content": [
+ {"type":"chn","id":"vtc_vov1"},
+ {"type":"chn","id":"vtc_vov2"},
+ {"type":"chn","id":"vtc_vov3"},
+ {"type":"chn","id":"vtc_vov5"}
+ ]
+ },
+ "oversea": {
+ "title": "Oversea Stations",
+ "logo": "",
+ "desc": "Truyền hình Hải ngoại",
+ "content": [
+ {"type":"chn","id":"vtv1"},
+ {"type":"chn","id":"vtv2"}
+ ]
+ }
+ },
+ "channels": {
+ "vtvgo_vtv1": {
+ "title": "VTV1",
+ "logo": "vtv1.png",
+ "desc": "Thông tin tổng hợp",
+ "src": {
+ "id":"vtvgo",
+ "playpath": "m3u8_vtvgo",
+ "page_url": "http://vtvgo.vn/?xem-truc-tuyen-kenh-VTV1-1.html",
+ "url_before": "file: \"",
+ "url_after": "\",",
+ "header": {
+ "Content-Type": "application/x-www-form-urlencoded",
+ "X-Requested-With":"XMLHttpRequest",
+ "Host":"vtvgo.vn",
+ "Referer":"http://vtvgo.vn/act/live/play/vtv1.html",
+ "Upgrade-Insecure-Requests":"1",
+ "Connection":"keep-alive",
+ "Cookie":"jwplayer.qualityLabel=360p"
+ },
+ "referer": ""
+ }
+ },
+ "vtvgo_vtv2": {
+ "title": "VTV2",
+ "logo": "vtv2.png",
+ "desc": "Khoa học, Giáo dục",
+ "src": {
+ "id":"vtvgo",
+ "playpath": "m3u8_bau",
+ "page_url": "http://vtvgo.vn/streaming.php?id=2",
+ "url_before": "file: \"",
+ "url_after": "\",",
+ "header": {
+ "Content-Type": "application/x-www-form-urlencoded",
+ "X-Requested-With":"XMLHttpRequest",
+ "Host":"vtvgo.vn",
+ "Referer":"http://vtvgo.vn/act/live/play/vtv2.html",
+ "Upgrade-Insecure-Requests":"1",
+ "Connection":"keep-alive",
+ "Cookie":"jwplayer.qualityLabel=360p"
+ },
+ "referer": ""
+ }
+ },
+ "vtvgo_vtv3": {
+ "title": "VTV3",
+ "logo": "vtv3.png",
+ "desc": "Thể thao, Giải trí, Thông tin Kinh tế",
+ "src": {
+ "id":"vtvgo",
+ "playpath": "m3u8_bau",
+ "page_url": "http://vtvgo.vn/streaming.php?id=3",
+ "url_before": "file: \"",
+ "url_after": "\",",
+ "header": {
+ "Content-Type": "application/x-www-form-urlencoded",
+ "X-Requested-With":"XMLHttpRequest",
+ "Host":"vtvgo.vn",
+ "Referer":"http://vtvgo.vn/act/live/play/vtv3.html",
+ "Upgrade-Insecure-Requests":"1",
+ "Connection":"keep-alive",
+ "Cookie":"jwplayer.qualityLabel=360p"
+ },
+ "referer": ""
+ }
+ },
+ "vtvgo_vtv4": {
+ "title": "VTV4",
+ "logo": "vtv4.png",
+ "desc": "Kênh cho người Việt Nam ở nước ngoài",
+ "src": {
+ "id":"vtvgo",
+ "playpath": "m3u8_bau",
+ "page_url": "http://vtvgo.vn/streaming.php?id=4",
+ "url_before": "file: \"",
+ "url_after": "\",",
+ "header": {
+ "Content-Type": "application/x-www-form-urlencoded",
+ "X-Requested-With":"XMLHttpRequest",
+ "Host":"vtvgo.vn",
+ "Referer":"http://vtvgo.vn/act/live/play/vtv4.html",
+ "Upgrade-Insecure-Requests":"1",
+ "Connection":"keep-alive",
+ "Cookie":"jwplayer.qualityLabel=360p"
+ },
+ "referer": ""
+ }
+ },
+ "vtvgo_vtv5": {
+ "title": "VTV5",
+ "logo": "default.png",
+ "desc": "Kênh Tiếng Dân tộc Thiểu số",
+ "src": {
+ "id":"vtvgo",
+ "playpath": "m3u8_bau",
+ "page_url": "http://vtvgo.vn/streaming.php?id=5",
+ "url_before": "file: \"",
+ "url_after": "\",",
+ "header": {
+ "Content-Type": "application/x-www-form-urlencoded",
+ "X-Requested-With":"XMLHttpRequest",
+ "Host":"vtvgo.vn",
+ "Referer":"http://vtvgo.vn/act/live/play/vtv5.html",
+ "Upgrade-Insecure-Requests":"1",
+ "Connection":"keep-alive",
+ "Cookie":"jwplayer.qualityLabel=360p"
+ },
+ "referer": ""
+ }
+ },
+ "vtvgo_vtv6": {
+ "title": "VTV6",
+ "logo": "vtv6.png",
+ "desc": "Kênh cho Thanh, thiếu niên",
+ "src": {
+ "id":"vtvgo",
+ "playpath": "m3u8_bau",
+ "page_url": "http://vtvgo.vn/streaming.php?id=6",
+ "url_before": "file: \"",
+ "url_after": "\",",
+ "header": {
+ "Content-Type": "application/x-www-form-urlencoded",
+ "X-Requested-With":"XMLHttpRequest",
+ "Host":"vtvgo.vn",
+ "Referer":"http://vtvgo.vn/act/live/play/vtv6.html",
+ "Upgrade-Insecure-Requests":"1",
+ "Connection":"keep-alive",
+ "Cookie":"jwplayer.qualityLabel=360p"
+ },
+ "referer": ""
+ }
+ },
+ "vtvgo_vtv9": {
+ "title": "VTV9",
+ "logo": "vtv9.png",
+ "desc": "Kênh cho Khán giả miền Nam",
+ "src": {
+ "id":"vtvgo",
+ "playpath": "m3u8_bau",
+ "page_url": "http://vtvgo.vn/streaming.php?id=7",
+ "url_before": "file: \"",
+ "url_after": "\",",
+ "header": {
+ "Content-Type": "application/x-www-form-urlencoded",
+ "X-Requested-With":"XMLHttpRequest",
+ "Host":"vtvgo.vn",
+ "Referer":"http://vtvgo.vn/act/live/play/vtv9.html",
+ "Upgrade-Insecure-Requests":"1",
+ "Connection":"keep-alive",
+ "Cookie":"jwplayer.qualityLabel=360p"
+ },
+ "referer": ""
+ }
+ },
+ "vtvgo_vtvct1": {
+ "title": "VTV Cần Thơ 1",
+ "logo": "default.png",
+ "desc": "",
+ "src": {
+ "id":"vtvgo",
+ "playpath": "m3u8_bau",
+ "page_url": "http://vtvgo.vn/streaming.php?id=9",
+ "url_before": "file: \"",
+ "url_after": "\",",
+ "header": {
+ "Content-Type": "application/x-www-form-urlencoded",
+ "X-Requested-With":"XMLHttpRequest",
+ "Host":"vtvgo.vn",
+ "Referer":"http://vtvgo.vn/act/live/play/vtvct1.html",
+ "Upgrade-Insecure-Requests":"1",
+ "Connection":"keep-alive",
+ "Cookie":"jwplayer.qualityLabel=360p"
+ },
+ "referer": ""
+ }
+ },
+ "vtvgo_vtvdn": {
+ "title": "VTV Đà Nẵng",
+ "logo": "default.png",
+ "desc": "",
+ "src": {
+ "id":"vtvgo",
+ "playpath": "m3u8_bau",
+ "page_url": "http://vtvgo.vn/streaming.php?id=12",
+ "url_before": "file: \"",
+ "url_after": "\",",
+ "header": {
+ "Content-Type": "application/x-www-form-urlencoded",
+ "X-Requested-With":"XMLHttpRequest",
+ "Host":"vtvgo.vn",
+ "Referer":"http://vtvgo.vn/act/live/play/vtvdn.html",
+ "Upgrade-Insecure-Requests":"1",
+ "Connection":"keep-alive",
+ "Cookie":"jwplayer.qualityLabel=360p"
+ },
+ "referer": ""
+ }
+ },
+ "vtvgo_vtvhue": {
+ "title": "VTV Huế",
+ "logo": "default.png",
+ "desc": "",
+ "src": {
+ "id":"vtvgo",
+ "playpath": "m3u8_bau",
+ "page_url": "http://vtvgo.vn/streaming.php?id=15",
+ "url_before": "file: \"",
+ "url_after": "\",",
+ "header": {
+ "Content-Type": "application/x-www-form-urlencoded",
+ "X-Requested-With":"XMLHttpRequest",
+ "Host":"vtvgo.vn",
+ "Referer":"http://vtvgo.vn/act/live/play/vtvhue.html",
+ "Upgrade-Insecure-Requests":"1",
+ "Connection":"keep-alive",
+ "Cookie":"jwplayer.qualityLabel=360p"
+ },
+ "referer": ""
+ }
+ },
+ "vtvgo_vtvpy": {
+ "title": "VTV Phú Yên",
+ "logo": "default.png",
+ "desc": "",
+ "src": {
+ "id":"vtvgo",
+ "playpath": "m3u8_bau",
+ "page_url": "http://vtvgo.vn/streaming.php?id=18",
+ "url_before": "file: \"",
+ "url_after": "\",",
+ "header": {
+ "Content-Type": "application/x-www-form-urlencoded",
+ "X-Requested-With":"XMLHttpRequest",
+ "Host":"vtvgo.vn",
+ "Referer":"http://vtvgo.vn/act/live/play/vtvpy.html",
+ "Upgrade-Insecure-Requests":"1",
+ "Connection":"keep-alive",
+ "Cookie":"jwplayer.qualityLabel=360p"
+ },
+ "referer": ""
+ }
+ },
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ "fpt_vtv1": {
+ "title": "VTV1",
+ "logo": "vtv1.png",
+ "desc": "Thông tin tổng hợp",
+ "src": {
+ "id":"fpt",
+ "playpath": "m3u8_fpt",
+ "page_id": "vtv1-hd",
+ "page_q": "3",
+ "referer": ""
+ }
+ },
+ "fpt_vtv2": {
+ "title": "VTV2",
+ "logo": "vtv2.png",
+ "desc": "Khoa học, Giáo dục",
+ "src": {
+ "id":"fpt",
+ "playpath": "m3u8_fpt",
+ "page_id": "vtv2",
+ "page_q": "3",
+ "referer": ""
+ }
+ },
+ "fpt_vtv3": {
+ "title": "VTV3",
+ "logo": "vtv3.png",
+ "desc": "Thể thao, Giải trí, Thông tin Kinh tế",
+ "src": {
+ "id":"fpt",
+ "playpath": "m3u8_fpt",
+ "page_id": "vtv3-hd",
+ "page_q": "3",
+ "referer": ""
+ }
+ },
+ "fpt_vtv4": {
+ "title": "VTV4",
+ "logo": "vtv4.png",
+ "desc": "Kênh cho người Việt Nam ở nước ngoài",
+ "src": {
+ "id":"fpt",
+ "playpath": "m3u8_fpt",
+ "page_id": "vtv4",
+ "page_q": "3",
+ "referer": ""
+ }
+ },
+ "fpt_vtv6": {
+ "title": "VTV6",
+ "logo": "vtv6.png",
+ "desc": "Kênh cho Thanh, thiếu niên",
+ "src": {
+ "id":"fpt",
+ "playpath": "m3u8_fpt",
+ "page_id": "vtv6-hd",
+ "page_q": "3",
+ "referer": ""
+ }
+ },
+ "fpt_vtv9": {
+ "title": "VTV9",
+ "logo": "vtv9.png",
+ "desc": "Kênh cho Khán giả miền Nam",
+ "src": {
+ "id":"fpt",
+ "playpath": "m3u8_fpt",
+ "page_id": "vtv9",
+ "page_q": "3",
+ "referer": ""
+ }
+ },
+ "fpt_qpvn": {
+ "title": "QPVN",
+ "logo": "default.png",
+ "desc": "Kênh Truyền hình Quốc phòng Việt Nam",
+ "src": {
+ "id":"fpt",
+ "playpath": "m3u8_fpt",
+ "page_id": "quoc-phong-vn",
+ "page_q": "3",
+ "referer": ""
+ }
+ },
+ "fpt_antv": {
+ "title": "ANTV",
+ "logo": "antv.png",
+ "desc": "Kênh An ninh Nhân dân",
+ "src": {
+ "id":"fpt",
+ "playpath": "m3u8_fpt",
+ "page_id": "antv",
+ "page_q": "3",
+ "referer": ""
+ }
+ },
+ "fpt_thuanviethd": {
+ "title": "ThuanViet HD",
+ "logo": "default.png",
+ "desc": "Kênh văn hóa giải trí Việt Nam",
+ "src": {
+ "id":"fpt",
+ "playpath": "m3u8_fpt",
+ "page_id": "htvc-thuan-viet-hd",
+ "page_q": "3",
+ "referer": ""
+ }
+ },
+ "fpt_htvchd": {
+ "title": "HTVC+ HD",
+ "logo": "default.png",
+ "desc": "Thông tin tổng hợp",
+ "src": {
+ "id":"fpt",
+ "playpath": "m3u8_fpt",
+ "page_id": "htvc-hd",
+ "page_q": "3",
+ "referer": ""
+ }
+ },
+ "fpt_onetv": {
+ "title": "OneTV",
+ "logo": "default.png",
+ "desc": "Kênh giới thiệu riêng của OneTV",
+ "src": {
+ "id":"fpt",
+ "playpath": "m3u8_fpt",
+ "page_id": "onetv",
+ "page_q": "3",
+ "referer": ""
+ }
+ },
+ "fpt_vtc1": {
+ "title": "VTC1",
+ "logo": "vtc1.png",
+ "desc": "Thời sự tổng hợp",
+ "src": {
+ "id":"fpt",
+ "playpath": "m3u8_fpt",
+ "page_id": "vtc1",
+ "page_q": "3",
+ "referer": ""
+ }
+ },
+ "fpt_vtc2": {
+ "title": "VTC2",
+ "logo": "vtc2.png",
+ "desc": "Khoa học, Công nghệ",
+ "src": {
+ "id":"fpt",
+ "playpath": "m3u8_fpt",
+ "page_id": "vtc2",
+ "page_q": "3",
+ "referer": ""
+ }
+ },
+ "fpt_vtc3": {
+ "title": "VTC3",
+ "logo": "default.png",
+ "desc": "Kênh thể thao",
+ "src": {
+ "id":"fpt",
+ "playpath": "m3u8_fpt",
+ "page_id": "vtc3",
+ "page_q": "3",
+ "referer": ""
+ }
+ },
+ "fpt_vtc5": {
+ "title": "VTC5",
+ "logo": "default.png",
+ "desc": "Kênh Phim truyện",
+ "src": {
+ "id":"fpt",
+ "playpath": "m3u8_fpt",
+ "page_id": "vtc5",
+ "page_q": "3",
+ "referer": ""
+ }
+ },
+ "fpt_vtc6": {
+ "title": "VTC6",
+ "logo": "default.png",
+ "desc": "Kênh giải trí tổng hợp Saigon Channel",
+ "src": {
+ "id":"fpt",
+ "playpath": "m3u8_fpt",
+ "page_id": "vtc6",
+ "page_q": "3",
+ "referer": ""
+ }
+ },
+ "fpt_vtc7": {
+ "title": "VTC7",
+ "logo": "default.png",
+ "desc": "Kênh tổng hợp TodayTV",
+ "src": {
+ "id":"fpt",
+ "playpath": "m3u8_fpt",
+ "page_id": "vtc7",
+ "page_q": "3",
+ "referer": ""
+ }
+ },
+ "fpt_vtc10": {
+ "title": "VTC10",
+ "logo": "default.png",
+ "desc": "Kênh truyền hình chuyên biệt về Văn hóa Việt",
+ "src": {
+ "id":"fpt",
+ "playpath": "m3u8_fpt",
+ "page_id": "vtc10",
+ "page_q": "3",
+ "referer": ""
+ }
+ },
+ "fpt_vtc14": {
+ "title": "VTC14",
+ "logo": "default.png",
+ "desc": "Kênh truyền hình chuyên biệt về môi trường",
+ "src": {
+ "id":"fpt",
+ "playpath": "m3u8_fpt",
+ "page_id": "vtc14",
+ "page_q": "3",
+ "referer": ""
+ }
+ },
+ "fpt_vtc16": {
+ "title": "VTC16",
+ "logo": "default.png",
+ "desc": "Kênh truyền hình Nông nghiệp và Nông thôn",
+ "src": {
+ "id":"fpt",
+ "playpath": "m3u8_fpt",
+ "page_id": "vtc16",
+ "page_q": "3",
+ "referer": ""
+ }
+ },
+ "fpt_htvhd": {
+ "title": "HTV Movie HD",
+ "logo": "default.png",
+ "desc": "Kênh Phim truyện",
+ "src": {
+ "id":"fpt",
+ "playpath": "m3u8_fpt",
+ "page_id": "htvc-movie-hd",
+ "page_q": "3",
+ "referer": ""
+ }
+ },
+
+
+
+
+ "hplus_vtv1": {
+ "title": "VTV1",
+ "logo": "vtv1.png",
+ "desc": "Thông tin tổng hợp",
+ "src": {
+ "id":"hplus",
+ "playpath": "m3u8_bau",
+ "page_url": "http://hplus.com.vn/vi/content/detail/vtv-1-2128.html",
+ "url_before": "var iosUrl = \"",
+ "url_after": "\";",
+ "referer": ""
+ }
+ },
+ "hplus_vtv2": {
+ "title": "VTV2",
+ "logo": "vtv2.png",
+ "desc": "Khoa học, Giáo dục",
+ "src": {
+ "id":"hplus",
+ "playpath": "m3u8_bau",
+ "page_url": "http://hplus.com.vn/vi/content/detail/vtv-2-2127.html",
+ "url_before": "var iosUrl = \"",
+ "url_after": "\";",
+ "referer": ""
+ }
+ },
+ "hplus_vtv3": {
+ "title": "VTV3",
+ "logo": "vtv3.png",
+ "desc": "Thể thao, Giải trí, Thông tin Kinh tế",
+ "src": {
+ "id":"hplus",
+ "playpath": "m3u8_bau",
+ "page_url": "http://hplus.com.vn/vi/content/detail/vtv-3-2126.html",
+ "url_before": "var iosUrl = \"",
+ "url_after": "\";",
+ "referer": ""
+ }
+ },
+ "hplus_vtv3hd": {
+ "title": "VTV3 HD",
+ "logo": "vtv3.png",
+ "desc": "Thể thao, Giải trí, Thông tin Kinh tế",
+ "src": {
+ "id":"hplus",
+ "playpath": "m3u8_bau",
+ "page_url": "http://hplus.com.vn/vi/content/detail/vtv3-hd-2130.html",
+ "url_before": "var iosUrl = \"",
+ "url_after": "\";",
+ "referer": ""
+ }
+ },
+ "hplus_vtv6hd": {
+ "title": "VTV6 HD",
+ "logo": "vtv6.png",
+ "desc": "Kênh cho Thanh, thiếu niên",
+ "src": {
+ "id":"hplus",
+ "playpath": "m3u8_bau",
+ "page_url": "http://hplus.com.vn/vi/content/detail/vtv6-hd-2129.html",
+ "url_before": "var iosUrl = \"",
+ "url_after": "\";",
+ "referer": ""
+ }
+ },
+ "hplus_vtv9": {
+ "title": "VTV9",
+ "logo": "vtv9.png",
+ "desc": "Kênh cho Khán giả miền Nam",
+ "src": {
+ "id":"hplus",
+ "playpath": "m3u8_bau",
+ "page_url": "http://hplus.com.vn/vi/content/detail/vtv-9-2125.html",
+ "url_before": "var iosUrl = \"",
+ "url_after": "\";",
+ "referer": ""
+ }
+ },
+ "hplus_htv1": {
+ "title": "HTV1",
+ "logo": "htv1.png",
+ "desc": "",
+ "src": {
+ "id":"hplus",
+ "playpath": "m3u8_bau",
+ "page_url": "http://hplus.com.vn/vi/content/detail/htv-1-2631.html",
+ "url_before": "var iosUrl = \"",
+ "url_after": "\";",
+ "referer": ""
+ }
+ },
+ "hplus_htv2": {
+ "title": "HTV2",
+ "logo": "htv2.png",
+ "desc": "",
+ "src": {
+ "id":"hplus",
+ "playpath": "m3u8_bau",
+ "page_url": "http://hplus.com.vn/vi/content/detail/htv-2-2630.html",
+ "url_before": "var iosUrl = \"",
+ "url_after": "\";",
+ "referer": ""
+ }
+ },
+ "hplus_htv2hd": {
+ "title": "HTV2 HD",
+ "logo": "htv2.png",
+ "desc": "",
+ "src": {
+ "id":"hplus",
+ "playpath": "m3u8_bau",
+ "page_url": "http://hplus.com.vn/vi/content/detail/htv2-hd-2669.html",
+ "url_before": "var iosUrl = \"",
+ "url_after": "\";",
+ "referer": ""
+ }
+ },
+ "hplus_htv3": {
+ "title": "HTV3",
+ "logo": "htv3.png",
+ "desc": "",
+ "src": {
+ "id":"hplus",
+ "playpath": "m3u8_bau",
+ "page_url": "http://hplus.com.vn/vi/content/detail/htv-3-2535.html",
+ "url_before": "var iosUrl = \"",
+ "url_after": "\";",
+ "referer": ""
+ }
+ },
+ "hplus_htv4": {
+ "title": "HTV4",
+ "logo": "htv4.png",
+ "desc": "",
+ "src": {
+ "id":"hplus",
+ "playpath": "m3u8_bau",
+ "page_url": "http://hplus.com.vn/vi/content/detail/htv-4-2528.html",
+ "url_before": "var iosUrl = \"",
+ "url_after": "\";",
+ "referer": ""
+ }
+ },
+ "hplus_htv7hd": {
+ "title": "HTV7 HD",
+ "logo": "htv7.png",
+ "desc": "",
+ "src": {
+ "id":"hplus",
+ "playpath": "m3u8_bau",
+ "page_url": "http://hplus.com.vn/vi/content/detail/htv7-hd-256.html",
+ "url_before": "var iosUrl = \"",
+ "url_after": "\";",
+ "referer": ""
+ }
+ },
+ "hplus_htv9hd": {
+ "title": "HTV9 HD",
+ "logo": "htv9.png",
+ "desc": "",
+ "src": {
+ "id":"hplus",
+ "playpath": "m3u8_bau",
+ "page_url": "http://hplus.com.vn/vi/content/detail/htv9-hd-2667.html",
+ "url_before": "var iosUrl = \"",
+ "url_after": "\";",
+ "referer": ""
+ }
+ },
+ "hplus_vtc3": {
+ "title": "VTC3",
+ "logo": "default.png",
+ "desc": "Kênh thể thao",
+ "src": {
+ "id":"hplus",
+ "playpath": "m3u8_bau",
+ "page_url": "http://hplus.com.vn/vi/content/detail/vtc-3-hd-2058.html",
+ "url_before": "var iosUrl = \"",
+ "url_after": "\";",
+ "referer": ""
+ }
+ },
+ "hplus_vtc4": {
+ "title": "VTC4",
+ "logo": "default.png",
+ "desc": "",
+ "src": {
+ "id":"hplus",
+ "playpath": "m3u8_bau",
+ "page_url": "http://hplus.com.vn/vi/content/detail/vtc-4-2057.html",
+ "url_before": "var iosUrl = \"",
+ "url_after": "\";",
+ "referer": ""
+ }
+ },
+ "hplus_vtc6": {
+ "title": "VTC6",
+ "logo": "default.png",
+ "desc": "",
+ "src": {
+ "id":"hplus",
+ "playpath": "m3u8_bau",
+ "page_url": "http://hplus.com.vn/vi/content/detail/vtc-6-2056.html",
+ "url_before": "var iosUrl = \"",
+ "url_after": "\";",
+ "referer": ""
+ }
+ },
+ "hplus_vtc10": {
+ "title": "VTC10",
+ "logo": "default.png",
+ "desc": "",
+ "src": {
+ "id":"hplus",
+ "playpath": "m3u8_bau",
+ "page_url": "http://hplus.com.vn/vi/content/detail/vtc-10-2051.html",
+ "url_before": "var iosUrl = \"",
+ "url_after": "\";",
+ "referer": ""
+ }
+ },
+
+
+
+
+ "vtvplus_vtv1": {
+ "title": "VTV1",
+ "logo": "vtv1.png",
+ "desc": "Thông tin tổng hợp",
+ "src": {
+ "id":"vtvplus",
+ "playpath": "m3u8_bau",
+ "page_url": "http://vtvplus.vn/vtv1-live-2-5678.html",
+ "url_before": "var responseText = \"",
+ "url_after": ",http://",
+ "referer": ""
+ }
+ },
+ "vtvplus_vtv2": {
+ "title": "VTV2",
+ "logo": "vtv2.png",
+ "desc": "Khoa học, Giáo dục",
+ "src": {
+ "id":"vtvplus",
+ "playpath": "m3u8_bau",
+ "page_url": "http://vtvplus.vn/vtv2-live-3-5678.html",
+ "url_before": "var responseText = \"",
+ "url_after": "\";",
+ "referer": ""
+ }
+ },
+ "vtvplus_vtv3": {
+ "title": "VTV3",
+ "logo": "vtv3.png",
+ "desc": "Thể thao, Giải trí, Thông tin Kinh tế",
+ "src": {
+ "id":"vtvplus",
+ "playpath": "m3u8_bau",
+ "page_url": "http://vtvplus.vn/vtv3-free-live-87-5678.html",
+ "url_before": "var responseText = \"",
+ "url_after": "\";",
+ "referer": ""
+ }
+ },
+ "vtvplus_vtv4": {
+ "title": "VTV4",
+ "logo": "vtv4.png",
+ "desc": "Kênh cho người Việt Nam ở nước ngoài",
+ "src": {
+ "id":"vtvplus",
+ "playpath": "m3u8_bau",
+ "page_url": "http://vtvplus.vn/vtv4-live-4-5678.html",
+ "url_before": "var responseText = \"",
+ "url_after": "\";",
+ "referer": ""
+ }
+ },
+ "vtvplus_vtv6": {
+ "title": "VTV6",
+ "logo": "vtv6.png",
+ "desc": "Kênh cho Thanh, thiếu niên",
+ "src": {
+ "id":"vtvplus",
+ "playpath": "m3u8_bau",
+ "page_url": "http://vtvplus.vn/vtv6-free-live-88-5678.html",
+ "url_before": "var responseText = \"",
+ "url_after": "\";",
+ "referer": ""
+ }
+ },
+ "vtvplus_vtv9": {
+ "title": "VTV9",
+ "logo": "vtv9.png",
+ "desc": "Kênh cho Khán giả miền Nam",
+ "src": {
+ "id":"vtvplus",
+ "playpath": "m3u8_bau",
+ "page_url": "http://vtvplus.vn/vtv9-live-6-5678.html",
+ "url_before": "var responseText = \"",
+ "url_after": "\";",
+ "referer": ""
+ }
+ },
+
+
+
+
+
+ "vtc_vtv1": {
+ "title": "VTV1",
+ "logo": "vtv1.png",
+ "desc": "Thông tin tổng hợp",
+ "src": {
+ "id":"vtc",
+ "playpath": "m3u8_tvnet",
+ "page_id":"1011/vtv1",
+ "referer": "VTV1/15"
+ }
+ },
+ "vtc_vtv2": {
+ "title": "VTV2",
+ "logo": "vtv2.png",
+ "desc": "Khoa học, Giáo dục",
+ "src": {
+ "id":"vtc",
+ "playpath": "m3u8_tvnet",
+ "page_id":"1010/vtv2",
+ "referer": "VTV2/23"
+ }
+ },
+ "vtc_vtv3": {
+ "title": "VTV3",
+ "logo": "vtv3.png",
+ "desc": "Thể thao, Giải trí, Thông tin Kinh tế",
+ "src": {
+ "id":"vtc",
+ "playpath": "m3u8_tvnet",
+ "page_id":"1013/vtv3",
+ "referer": "VTV3/3"
+ }
+ },
+ "vtc_vtv4": {
+ "title": "VTV4",
+ "logo": "vtv4.png",
+ "desc": "Kênh cho người Việt Nam ở nước ngoài",
+ "src": {
+ "id":"vtc",
+ "playpath": "m3u8_tvnet",
+ "page_id":"1009/vtv4",
+ "referer": "VTV4/2"
+ }
+ },
+ "vtc_vtc1": {
+ "title": "VTC1",
+ "logo": "vtc1.png",
+ "desc": "Thời sự tổng hợp",
+ "src": {
+ "id":"vtc",
+ "playpath": "m3u8_tvnet",
+ "page_id":"1007/vtc1",
+ "referer": "VTC1/10"
+ }
+ },
+ "vtc_vtc10": {
+ "title": "VTC10",
+ "logo": "vtc10.png",
+ "desc": "Kênh Văn hóa Việt",
+ "src": {
+ "id":"vtc",
+ "playpath": "m3u8_tvnet",
+ "page_id":"1006/netviet",
+ "referer": "VTC10/22"
+ }
+ },
+ "vtc_vtc16": {
+ "title": "VTC16",
+ "logo": "vtc.png",
+ "desc": "Khoa học, Công nghệ",
+ "src": {
+ "id":"vtc",
+ "playpath": "m3u8_tvnet",
+ "page_id":"1018/vtc16",
+ "referer": "VTC2/11"
+ }
+ },
+ "vtc_ttxvn": {
+ "title": "TTXVN",
+ "logo": "default.png",
+ "desc": "Thông tin, Giải trí, Thể thao",
+ "src": {
+ "id":"vtc",
+ "playpath": "m3u8_tvnet",
+ "page_id":"1019/ttxvn",
+ "referer": ""
+ }
+ },
+ "vtc_htv9": {
+ "title": "HTV9",
+ "logo": "htv9.png",
+ "desc": "Chính trị, Xã hội, Văn hóa",
+ "src": {
+ "id":"vtc",
+ "playpath": "m3u8_tvnet",
+ "page_id":"1012/htv9",
+ "referer": ""
+ }
+ },
+ "vtc_hn1": {
+ "title": "HN1",
+ "logo": "",
+ "desc": "Hà Nội 1",
+ "src": {
+ "id":"vtc",
+ "playpath": "m3u8_tvnet",
+ "page_id":"1008/hn",
+ "referer": ""
+ }
+ },
+ "vtc_vov1": {
+ "title": "VOV1",
+ "logo": "vov1.png",
+ "desc": "Thời sự, Chính trị, Tổng hợp",
+ "src": {
+ "id":"vtc",
+ "playpath": "m3u8_tvnet",
+ "page_id":"vov1",
+ "referer": "VOV1/29"
+ }
+ },
+ "vtc_vov2": {
+ "title": "VOV2",
+ "logo": "vov2.png",
+ "desc": "Văn hóa, Đời sống, Khoa giáo",
+ "src": {
+ "id":"vtc",
+ "playpath": "m3u8_tvnet",
+ "page_id":"vov2",
+ "referer": "VOV2/28"
+ }
+ },
+ "vtc_vov3": {
+ "title": "VOV3",
+ "logo": "vov3.png",
+ "desc": "Âm nhạc, Giải trí",
+ "src": {
+ "id":"vtc",
+ "playpath": "m3u8_tvnet",
+ "page_id":"vov3",
+ "referer": "VOV3/27"
+ }
+ },
+ "vtc_vov5": {
+ "title": "VOV5",
+ "logo": "vov5.png",
+ "desc": "Phát thanh đối ngoại",
+ "src": {
+ "id":"vtc",
+ "playpath": "m3u8_tvnet",
+ "page_id":"vov5",
+ "referer": "VOV5/25"
+ }
+ },
+
+
+
+
+ "trt1": {
+ "title": "TRT1",
+ "logo": "",
+ "desc": "Thừa Thiên Huế",
+ "src": {
+ "id":"xunghe",
+ "playpath": "trt",
+ "referer": ""
+ }
+ }
+ }
+}
diff --git a/plugin.video.tvvn/fanart.jpg b/plugin.video.tvvn/fanart.jpg
new file mode 100644
index 0000000..655d4fc
--- /dev/null
+++ b/plugin.video.tvvn/fanart.jpg
Binary files differ
diff --git a/plugin.video.tvvn/icon.png b/plugin.video.tvvn/icon.png
new file mode 100644
index 0000000..ce18cca
--- /dev/null
+++ b/plugin.video.tvvn/icon.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/language/English/strings.xml b/plugin.video.tvvn/resources/language/English/strings.xml
new file mode 100644
index 0000000..3a34c5d
--- /dev/null
+++ b/plugin.video.tvvn/resources/language/English/strings.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<strings>
+ <string id="30000">General settings</string>
+ <string id="30001">Show channel's description (Vietnamese Unicode)</string>
+ <string id="30002">Show channel's description on the right of channel's name</string>
+ <string id="30003">Enable auto update of channels list</string>
+ <string id="30004">Channels list url</string>
+ <string id="30005">New channels list update found</string>
+ <string id="30006">Your channels list is</string>
+ <string id="30007">Proceed with update?</string>
+ <string id="30008">Channels list update</string>
+ <string id="30009">Please wait and DO NOT cancel</string>
+ <string id="30010">Channel list updated, enjoy!</string>
+ <string id="30100">tv24.vn settings</string>
+ <string id="30101">Use HTTP streams instead of RTMP</string>
+</strings>
diff --git a/plugin.video.tvvn/resources/logos/antv.png b/plugin.video.tvvn/resources/logos/antv.png
new file mode 100644
index 0000000..ce58b6c
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/antv.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/default.png b/plugin.video.tvvn/resources/logos/default.png
new file mode 100644
index 0000000..1715843
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/default.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/globaltv.png b/plugin.video.tvvn/resources/logos/globaltv.png
new file mode 100644
index 0000000..a3d8ded
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/globaltv.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/htv7.png b/plugin.video.tvvn/resources/logos/htv7.png
new file mode 100644
index 0000000..3098007
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/htv7.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/htv9.png b/plugin.video.tvvn/resources/logos/htv9.png
new file mode 100644
index 0000000..e80aa25
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/htv9.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/lifetv.png b/plugin.video.tvvn/resources/logos/lifetv.png
new file mode 100644
index 0000000..a830212
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/lifetv.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/lsaigontv.png b/plugin.video.tvvn/resources/logos/lsaigontv.png
new file mode 100644
index 0000000..15f3371
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/lsaigontv.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/saigontv.png b/plugin.video.tvvn/resources/logos/saigontv.png
new file mode 100644
index 0000000..65d6ffa
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/saigontv.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/sctv.png b/plugin.video.tvvn/resources/logos/sctv.png
new file mode 100644
index 0000000..df5602d
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/sctv.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/vantv.png b/plugin.video.tvvn/resources/logos/vantv.png
new file mode 100644
index 0000000..5723d59
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/vantv.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/vbstv.png b/plugin.video.tvvn/resources/logos/vbstv.png
new file mode 100644
index 0000000..005bfbc
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/vbstv.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/vietfacetv.png b/plugin.video.tvvn/resources/logos/vietfacetv.png
new file mode 100644
index 0000000..c43b52b
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/vietfacetv.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/vov.png b/plugin.video.tvvn/resources/logos/vov.png
new file mode 100644
index 0000000..684066b
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/vov.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/vov1.png b/plugin.video.tvvn/resources/logos/vov1.png
new file mode 100644
index 0000000..1d352e6
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/vov1.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/vov2.png b/plugin.video.tvvn/resources/logos/vov2.png
new file mode 100644
index 0000000..1eba00a
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/vov2.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/vov3.png b/plugin.video.tvvn/resources/logos/vov3.png
new file mode 100644
index 0000000..fb5f535
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/vov3.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/vov5.png b/plugin.video.tvvn/resources/logos/vov5.png
new file mode 100644
index 0000000..ebad6be
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/vov5.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/vpoptv.png b/plugin.video.tvvn/resources/logos/vpoptv.png
new file mode 100644
index 0000000..37c00c3
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/vpoptv.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/vtc1.png b/plugin.video.tvvn/resources/logos/vtc1.png
new file mode 100644
index 0000000..a284320
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/vtc1.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/vtc10.png b/plugin.video.tvvn/resources/logos/vtc10.png
new file mode 100644
index 0000000..3ae60ee
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/vtc10.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/vtc2.png b/plugin.video.tvvn/resources/logos/vtc2.png
new file mode 100644
index 0000000..7248f3a
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/vtc2.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/vtv1.png b/plugin.video.tvvn/resources/logos/vtv1.png
new file mode 100644
index 0000000..61f1836
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/vtv1.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/vtv2.png b/plugin.video.tvvn/resources/logos/vtv2.png
new file mode 100644
index 0000000..9e2e686
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/vtv2.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/vtv3.png b/plugin.video.tvvn/resources/logos/vtv3.png
new file mode 100644
index 0000000..2552927
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/vtv3.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/vtv4.png b/plugin.video.tvvn/resources/logos/vtv4.png
new file mode 100644
index 0000000..441aab2
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/vtv4.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/vtv6.png b/plugin.video.tvvn/resources/logos/vtv6.png
new file mode 100644
index 0000000..bbfcebe
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/vtv6.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/vtv9.png b/plugin.video.tvvn/resources/logos/vtv9.png
new file mode 100644
index 0000000..a70e9f6
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/vtv9.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/logos/vyuhatv.png b/plugin.video.tvvn/resources/logos/vyuhatv.png
new file mode 100644
index 0000000..67bd765
--- /dev/null
+++ b/plugin.video.tvvn/resources/logos/vyuhatv.png
Binary files differ
diff --git a/plugin.video.tvvn/resources/settings.xml b/plugin.video.tvvn/resources/settings.xml
new file mode 100644
index 0000000..13c7489
--- /dev/null
+++ b/plugin.video.tvvn/resources/settings.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<settings>
+ <category label="30000">
+ <setting id="descriptions" type="bool" label="30001" default="true"/>
+ <setting id="descriptions_on_right" type="bool" label="30002" default="true"/>
+ <setting type="sep"/>
+ <setting id="json_url_auto_update" type="bool" label="30003" default="true"/>
+ <setting id="json_url" type="text" label="30004" default='http://zecoj.com/xbmc/data.json.gz' />
+ </category>
+ <!--category label="30100">
+ <setting id="tv24_http" type="bool" label="30101" default="false"/>
+ </category-->
+</settings>
diff --git a/plugin.video.tvvn/tvvn.py b/plugin.video.tvvn/tvvn.py
new file mode 100644
index 0000000..3c6f627
--- /dev/null
+++ b/plugin.video.tvvn/tvvn.py
@@ -0,0 +1,284 @@
+# -*- coding: UTF-8 -*-
+#---------------------------------------------------------------------
+# File: tvvn.py
+# Version: 0.9.11
+# By: Binh Nguyen <b@zecoj.com>
+# Date: Tue Sep 19 10:29:01 AEST 2017
+#---------------------------------------------------------------------
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+#---------------------------------------------------------------------
+
+import os, re, sys, gzip, urllib, urllib2, string, xbmcaddon, xbmcplugin, xbmcgui, xbmcvfs
+from StringIO import StringIO
+from cookielib import CookieJar
+
+try:
+ import json
+except:
+ import simplejson as json
+
+addon = xbmcaddon.Addon('plugin.video.tvvn')
+mysettings = xbmcaddon.Addon(id='plugin.video.tvvn')
+profile = xbmc.translatePath(xbmcaddon.Addon().getAddonInfo('profile')).decode('utf-8')
+home = xbmc.translatePath(xbmcaddon.Addon().getAddonInfo('path')).decode('utf-8')
+fanart = xbmc.translatePath(os.path.join(home, 'fanart.jpg'))
+datafile = xbmc.translatePath(os.path.join(home, 'data.json'))
+
+data = json.loads(open(datafile,"r").read())
+
+mode=None
+
+def get_params():
+ param=[]
+ paramstring=sys.argv[2]
+ if len(paramstring)>=2:
+ params=sys.argv[2]
+ cleanedparams=params.replace('?','')
+ if (params[len(params)-1]=='/'):
+ params=params[0:len(params)-2]
+ pairsofparams=cleanedparams.split('&')
+ param={}
+ for i in range(len(pairsofparams)):
+ splitparams={}
+ splitparams=pairsofparams[i].split('=')
+ if (len(splitparams))==2:
+ param[splitparams[0]]=splitparams[1]
+
+ return param
+
+params=get_params()
+
+try: chn=urllib.unquote_plus(params["chn"])
+except: pass
+try: src=urllib.unquote_plus(params["src"])
+except: pass
+try: mode=int(params["mode"])
+except: pass
+
+def construct_menu(namex):
+ name = data['directories'][namex]['title']
+ lmode = '2'
+ iconimage = ''
+ desc = data['directories'][namex]['desc']
+
+ menu_items = data['directories'][namex]['content']
+ for menu_item in menu_items:
+ #type == channel
+ if (menu_item['type'] == "chn"):
+ add_chn_link (menu_item['id'])
+ #type == directory
+ if (menu_item['type'] == "dir"):
+ add_dir_link (menu_item['id'])
+ xbmcplugin.endOfDirectory(int(sys.argv[1]))
+ return
+
+def add_chn_link (namex):
+ ok = True
+ title = data['channels'][namex]['title']
+ name = title
+ iconimage = data['channels'][namex]['logo']
+ desc = data['channels'][namex]['desc']
+ ref = data['channels'][namex]['src']['referer']
+ stream_name = data['channels'][namex]['src']['playpath']
+ src = data['channels'][namex]['src']['id']
+
+ if (iconimage == ''):
+ iconimage = 'default.png'
+ if (mysettings.getSetting('descriptions')=='true' and desc != ''):
+ if mysettings.getSetting('descriptions_on_right') == 'false':
+ name = desc+" "+name
+ else:
+ name = name+" "+desc
+
+ give_url = sys.argv[0]+"?mode=1&chn="+namex+"&src="+src
+ liz = xbmcgui.ListItem(name)
+ liz.setInfo(type="video", infoLabels={"title": name, "mediatype": "video"})
+ liz.setArt({
+ "icon": xbmc.translatePath(os.path.join(home, 'resources', 'logos', iconimage)),
+ "thumb": xbmc.translatePath(os.path.join(home, 'resources', 'logos', iconimage)),
+ "fanart": fanart
+ })
+ ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=give_url,listitem=liz)
+
+def add_dir_link (namex):
+ name = '['+data['directories'][namex]['title']+']'
+ desc = data['directories'][namex]['desc']
+ iconimage = data['directories'][namex]['logo']
+ if (iconimage == ''):
+ iconimage = 'default.png'
+ if (mysettings.getSetting('descriptions')=='true' and desc != ''):
+ if mysettings.getSetting('descriptions_on_right') == 'false':
+ name = desc+" "+name
+ else:
+ name = name+" "+desc
+ li = xbmcgui.ListItem(name)
+ li.setInfo(type="video", infoLabels={"title": name, "mediatype": "video"})
+ li.setArt({
+ "icon": xbmc.translatePath(os.path.join(home, 'resources', 'logos', iconimage)),
+ "thumb": xbmc.translatePath(os.path.join(home, 'resources', 'logos', iconimage)),
+ "fanart": fanart
+ })
+ give_url = sys.argv[0]+"?mode=2&chn="+namex
+ return xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=give_url, listitem=li, isFolder=True)
+
+def update_chn_list():
+ url = mysettings.getSetting('json_url')
+ request = urllib2.Request(url)
+ request.add_header('Accept-encoding', 'gzip')
+ url_error = "no"
+ try:
+ response = urllib2.urlopen(request)
+ except urllib2.URLError, e:
+ url_error = "yes"
+
+ if (url_error == "no"):
+ buf = StringIO(response.read())
+ f = gzip.GzipFile(fileobj=buf)
+ ff=f.read()
+ r_data=json.loads(ff)
+ if (data['timestamp'] < r_data['timestamp']):
+ day_diff = str((int(r_data['timestamp']) - int(data['timestamp'])) /60/60/24)
+ dialog = xbmcgui.Dialog()
+ ack = dialog.yesno(addon.getLocalizedString(30005), addon.getLocalizedString(30006)+" "+day_diff+" day(s) old",addon.getLocalizedString(30007))
+ if ack:
+ d_progress = xbmcgui.DialogProgress()
+ d_progress.create(addon.getLocalizedString(30008), addon.getLocalizedString(30009))
+ d = open(datafile, 'w')
+ d.seek(0)
+ d.write(ff)
+ d.close()
+ construct_menu("root")
+ d_progress.close()
+ d_ok = xbmcgui.Dialog().ok(addon.getLocalizedString(30008),addon.getLocalizedString(30010))
+
+def play_link(chn, src):
+ print("xxyyzz 001")
+ xbmc.log("xxyyzz 001")
+ item = xbmcgui.ListItem(chn)
+ d_progress = xbmcgui.DialogProgress()
+ d_progress.create("", addon.getLocalizedString(30009))
+
+ cj = CookieJar()
+ opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
+
+ #login if required
+ if src in data['sources'] and 'login' in data['sources'][src] and data['sources'][src]['login'] == "true":
+ url = data['sources'][src]['url']
+ values = data['sources'][src]['post']
+ post_data = urllib.urlencode(values)
+ response = opener.open(url, post_data)
+ the_page = response.read()
+
+ #m3u8 url from fpt
+ if data['channels'][chn]['src']['playpath'] == "m3u8_fpt":
+ url = 'http://fptplay.net/show/getlinklivetv'
+ page_id = data['channels'][chn]['src']['page_id']
+ page_q = data['channels'][chn]['src']['page_q']
+ values={'id': page_id, 'type': 'newchannel', 'quality': page_q, 'mobile': 'web'}
+ post_data = urllib.urlencode(values)
+ header = {'Content-Type': 'application/x-www-form-urlencoded', 'Host':'fptplay.net','Origin':'http://fptplay.net','X-Requested-With':'XMLHttpRequest', 'Referer':'http://fptplay.net/livetv'}
+ req = urllib2.Request(url, post_data, header)
+ response = urllib2.urlopen(req)
+ the_page = response.read()
+ the_data = json.loads(the_page)
+ full_url=the_data['stream']
+
+ #m3u8 url from tvnet
+ elif data['channels'][chn]['src']['playpath'] == "m3u8_tvnet":
+ url = 'http://au.tvnet.gov.vn/kenh-truyen-hinh/'+data['channels'][chn]['src']['page_id']
+ stringA = opener.open(url).read().decode('utf-8')
+ stringB = 'data-file="'
+ stringC = '"'
+ url = re.search(stringB+"(.*?)"+re.escape(stringC),stringA).group(1)
+
+ stringA = opener.open(url).read().decode('utf-8')
+ stringB = '"url": "'
+ stringC = '"'
+ full_url_BC = re.search(stringB+"(.*?)"+re.escape(stringC),stringA).group(1)
+ full_url = full_url_BC
+ print full_url
+
+ #m3u8 url from vtvgo
+ elif data['channels'][chn]['src']['playpath'] == "m3u8_vtvgo":
+ url = data['channels'][chn]['src']['page_url']
+ stringA = opener.open(url).read().decode('utf-8')
+ stringB = "addPlayer('"
+ stringC = "'"
+ full_url = re.search(re.escape(stringB)+"(.*?)"+re.escape(stringC),stringA).group(1) + '|Referer=http%3A%2F%2Fvtvgo.vn%2F'
+ full_url = "http://play.sohatv.vn/?v=dnR2MQ==&t=20170617133921&autoplay=true" + '|Referer=http://vtv.vn/truyen-hinh-truc-tuyen/vtv1.htm'
+ print full_url
+
+ #m3u8 url using before & after marker
+ elif data['channels'][chn]['src']['playpath'] == "m3u8_bau":
+ if data['channels'][chn]['src'].get('header'):
+ header=(data['channels'][chn]['src']['header'])
+ else:
+ header=None
+ if data['channels'][chn]['src'].get('post'):
+ post=data['channels'][chn]['src']['post']
+ else:
+ post=None
+
+ if header==None:
+ req = urllib2.Request(data['channels'][chn]['src']['page_url'], post)
+ else:
+ req = urllib2.Request(data['channels'][chn]['src']['page_url'], post, header)
+
+ response = urllib2.urlopen(req)
+ #print(response)
+ the_page = response.read()
+ #print(the_page)
+
+ stringA=the_page
+ stringB=(data['channels'][chn]['src']['url_before'])
+ stringC=(data['channels'][chn]['src']['url_after'])
+ full_url=re.search(re.escape(stringB)+"(.*?)"+re.escape(stringC),stringA).group(1)
+ print(full_url)
+
+ #traditional rtmp(e)
+ else:
+ videoUrl = data['sources'][src]['url']
+ playpath = data['channels'][chn]['src']['playpath']
+ if (playpath != ''):
+ videoUrl = videoUrl+"/"+playpath
+
+ url_protocol = videoUrl.split(':')[0]
+ if (url_protocol == "http"):
+ full_url = videoUrl
+ elif (url_protocol in ["rtmp", "rtmpe"]):
+ swfUrl = data['sources'][src]['swfurl']
+ pageUrl = data['sources'][src]['pageurl']
+ if (data['channels'][chn]['src']['referer'] != ''):
+ pageUrl = pageUrl+"/"+data['channels'][chn]['src']['referer']
+ flashVer = 'LNX_11,2,202,233'
+ token = data['sources'][src]['token']
+ app = data['sources'][src]['app']
+
+ full_url = videoUrl+' swfVfy=1 live=1 token='+token+' playpath='+playpath+' flashVer='+flashVer+' pageUrl='+pageUrl+' tcUrl='+videoUrl+' swfUrl='+swfUrl
+
+ d_progress.close()
+ xbmc.Player().play(full_url)
+ return
+
+def Init():
+ construct_menu("root")
+ if (mysettings.getSetting('json_url_auto_update')=='true' and mysettings.getSetting('json_url')!=''):
+ update_chn_list()
+
+if mode==None:
+ Init()
+elif mode==1:
+ play_link(chn, src)
+elif mode==2:
+ construct_menu(chn)
diff --git a/plugin.video.ustvnow/LICENSE b/plugin.video.ustvnow/LICENSE
new file mode 100644
index 0000000..9cecc1d
--- /dev/null
+++ b/plugin.video.ustvnow/LICENSE
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ {one line to give the program's name and a brief idea of what it does.}
+ Copyright (C) {year} {name of author}
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ {project} Copyright (C) {year} {fullname}
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/plugin.video.ustvnow/README.md b/plugin.video.ustvnow/README.md
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.ustvnow/README.md
diff --git a/plugin.video.ustvnow/addon.xml b/plugin.video.ustvnow/addon.xml
index 16a5876..8bf9192 100644
--- a/plugin.video.ustvnow/addon.xml
+++ b/plugin.video.ustvnow/addon.xml
@@ -1,21 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
-<addon id="plugin.video.ustvnow" name="USTVnow" provider-name="Lunatixz" version="2017.7.31">
+<addon id="plugin.video.ustvnow" name="USTVnow" provider-name="Lunatixz" version="2017.11.18">
<requires>
- <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="script.module.requests" version="2.7.0"/>
<import addon="script.module.simplecache" version="1.0.0"/>
+ <import addon="script.module.uepg" version="1.0.0"/>
</requires>
<extension point="xbmc.python.pluginsource" library="default.py">
<provides>video</provides>
</extension>
<extension point="xbmc.addon.metadata">
- <summary lang="en_GB">Watch All the Major American Television Networks Live in HD for Free!</summary>
- <description lang="en_GB">Watch All the Major American Television Networks Live in HD! Entirely Legal and Free! You can also record content through their web site, and there is an optional premium service available with all kinds of other channels. Signup for a free account through the following link today: http://watch.ustvnow.com</description>
+ <summary lang="en_GB">The Official plugin for the USTVnow Service.</summary>
+ <description lang="en_GB">Entirely Legal and Free! Start watching instantly or record shows for later. Signup for one of three packages today!</description>
<platform>all</platform>
<license>GNU GENERAL PUBLIC LICENSE. Version 3, June 2007</license>
- <source>https://github.com/Lunatixz/XBMC_Addons/tree/master/plugin.video.ustvnow</source>
+ <source>https://github.com/Lunatixz/plugin.video.ustvnow/tree/master/</source>
<website>http://ustvnow.com</website>
<forum>http://forum.kodi.tv/showthread.php?tid=233135</forum>
- <news>2017.4.7[CR]-100% new code base, written from scratch for your enjoy!!, DVR Recording and Playback Untested.[CR]2017.4.7a[CR]- Added "Featured"[CR]- Fixed DVR support.[CR]2017.7.26[CR]- Corrected version format.[CR]- Changed "Featured" and "Guide" click behavior.[CR]- Improved Error handling.[CR]2017.7.31[CR]- Fixed login issues.[CR]- Added fallback token generation[CR]- Added initial support for uEPG module</news>
+ <news>[CR]2017.10.16[CR]- Added OnDemand (Preview).[CR]- Added Highlights.[CR]- Added Search.[CR]- Improved UI.[CR]- Added EPG Guide w/DVR context menu.[CR]- Misc. Tweaks and Corrections.[CR]2017.8.23[CR]- Added Preferred Playback Method and Stream Quality settings.[CR]2017.8.5[CR]- Fixed encoding error.[CR]2017.8.2[CR]- Fixed paid subscription channels and dvr control.[CR]2017.7.31[CR]- Fixed login issues.[CR]- Added fallback token generation[CR]- Added initial support for uEPG module.[CR]2017.7.26[CR]- Corrected version format.[CR]- Changed "Featured" and "Guide" click behavior.[CR]- Improved Error handling.[CR]2017.4.7a[CR]- Added "Featured"[CR]- Fixed DVR support.2017.4.7[CR]-100% new code base, written from scratch for your enjoy!!, DVR Recording and Playback Untested.</news>
<assets>
<icon>resources/images/icon.png</icon>
<fanart>resources/images/fanart.jpg</fanart>
diff --git a/plugin.video.ustvnow/default.py b/plugin.video.ustvnow/default.py
index 4730258..63f1603 100644
--- a/plugin.video.ustvnow/default.py
+++ b/plugin.video.ustvnow/default.py
@@ -17,635 +17,7 @@
# along with USTVnow. If not, see <http://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
-import os, sys, datetime, re, traceback, HTMLParser, calendar
-import urllib, urllib2, socket, json, collections, net, random
-import xbmc, xbmcvfs, xbmcgui, xbmcplugin, xbmcaddon
-from simplecache import SimpleCache
-# Plugin Info
-ADDON_ID = 'plugin.video.ustvnow'
-REAL_SETTINGS = xbmcaddon.Addon(id=ADDON_ID)
-ADDON_NAME = REAL_SETTINGS.getAddonInfo('name')
-SETTINGS_LOC = REAL_SETTINGS.getAddonInfo('profile')
-ADDON_PATH = REAL_SETTINGS.getAddonInfo('path').decode('utf-8')
-ADDON_VERSION = REAL_SETTINGS.getAddonInfo('version')
-ICON = REAL_SETTINGS.getAddonInfo('icon')
-FANART = REAL_SETTINGS.getAddonInfo('fanart')
-LANGUAGE = REAL_SETTINGS.getLocalizedString
-
-## GLOBALS ##
-TIMEOUT = 30
-USER_EMAIL = REAL_SETTINGS.getSetting('User_Email')
-PASSWORD = REAL_SETTINGS.getSetting('User_Password')
-LAST_TOKEN = REAL_SETTINGS.getSetting('User_Token')
-LAST_PASSKEY = REAL_SETTINGS.getSetting('User_Paskey')
-DEBUG = REAL_SETTINGS.getSetting('Enable_Debugging') == 'true'
-PTVL_RUN = xbmcgui.Window(10000).getProperty('PseudoTVRunning') == 'True'
-BASEURL = 'https://m-api.ustvnow.com/'
-BASEWEB = 'https://watch.ustvnow.com/'
-BASEMOB = 'http://mc.ustvnow.com/'
-IMG_PATH = os.path.join(ADDON_PATH,'resources','images')
-IMG_HTTP = BASEMOB + 'gtv/1/live/viewposter?srsid='
-IMG_MOVIE = 'http://tvdata.ustvnow.com/movieposters/'
-IMG_TV = 'http://tvdata.ustvnow.com/tvbanners/'
-IMG_POSTER = 'http://m.poster.static-ustvnow.com/'
-IMG_POSTER_RE= 'http://m.reimages.static-ustvnow.com/'
-IMG_SNAPSHOT = 'http://m.snapshot.static-ustvnow.com/%s/high'
-IMG_CHLOGO = 'http://m.ustvnow.com/images/%s.png'
-COOKIE_JAR = xbmc.translatePath(os.path.join(SETTINGS_LOC, "cookiejar.lwp"))
-MEDIA_TYPES = {'SP':'video','SH':'episode','EP':'episode','MV':'movie'}
-FREE_CHANS = ['CW','ABC','FOX','PBS','CBS','NBC','MY9']
-
-CHAN_NAMES = {'ABC':'ABC','AMC':'AMC','Animal Planet':'Animal Planet','Bravo':'Bravo','CBS':'CBS','CNBC':'CNBC','CW':'CW','Comedy Central':'Comedy Central','Discovery Channel':'Discovery Channel','ESPN':'ESPN',
- 'FOX':'FOX','FX':'FX','Fox News Channel':'Fox News','Freeform':'Freeform','MSNBC':'MSNBC','NBC':'NBC','National Geographic Channel':'National Geographic','Nickelodeon':'Nickelodeon','PBS':'PBS',
- 'SPIKE TV':'SPIKE TV','SundanceTV':'SundanceTV','Syfy':'Syfy',
- 'AE':'A&E','My9':'MY9','BBCA':'BBC America','ESPN2':'ESPN 2','NBCSNHD':'NBCSN','The Learning Channel':'TLC','Universal HD':'Universal','USA':'USA Network','SUNDHD':'SundanceTV'}
-
-USTVNOW_MENU = [("Live" , '', 0),
- ("Schedules" , '', 1),
- ("Recordings", '', 2),
- ("Guide" , '', 3),
- ("Featured" , '', 5)]
-
-if xbmc.getCondVisibility('System.HasAddon(script.module.uepg)') == 1:
- USTVNOW_MENU.append(("uEPG Guide", '', 20))
-
-uEPG_PARAMS = {"stream_code":"studio","description":"plot","synopsis":"plotoutline","ut_start":"starttime","orig_air_date":"firstaired"}
-FILE_PARAMS = ["title", "artist", "albumartist", "genre", "year", "rating", "album", "track", "duration", "comment", "lyrics", "musicbrainztrackid", "musicbrainzartistid", "musicbrainzalbumid", "musicbrainzalbumartistid", "playcount", "fanart", "director", "trailer", "tagline", "plot", "plotoutline", "originaltitle", "lastplayed", "writer", "studio", "mpaa", "cast", "country", "imdbnumber", "premiered", "productioncode", "runtime", "set", "showlink", "streamdetails", "top250", "votes", "firstaired", "season", "episode", "showtitle", "thumbnail", "file", "resume", "artistid", "albumid", "tvshowid", "setid", "watchedepisodes", "disc", "tag", "art", "genreid", "displayartist", "albumartistid", "description", "theme", "mood", "style", "albumlabel", "sorttitle", "episodeguide", "uniqueid", "dateadded", "size", "lastmodified", "mimetype", "specialsortseason", "specialsortepisode"]
-PVR_PARAMS = ["title","plot","plotoutline","starttime","endtime","runtime","progress","progresspercentage","genre","episodename","episodenum","episodepart","firstaired","hastimer","isactive","parentalrating","wasactive","thumbnail","rating","originaltitle","cast","director","writer","year","imdbnumber","hastimerrule","hasrecording","recording","isseries"]
-ART_PARAMS = ["thumb","poster","fanart","banner","landscape","clearart","clearlogo"]
-
-def unescape(string):
- try:
- parser = HTMLParser.HTMLParser()
- return parser.unescape(string)
- except:
- return string
-
-def log(msg, level=xbmc.LOGDEBUG):
- if DEBUG == True:
- if level == xbmc.LOGERROR:
- msg += ' ,' + traceback.format_exc()
- xbmc.log(ADDON_ID + '-' + ADDON_VERSION + '-' + msg, level)
-
-def inputDialog(heading=ADDON_NAME, default='', key=xbmcgui.INPUT_ALPHANUM, opt=0, close=0):
- retval = xbmcgui.Dialog().input(heading, default, key, opt, close)
- if len(retval) > 0:
- return retval
-
-def okDialog(str1, str2='', str3='', header=ADDON_NAME):
- xbmcgui.Dialog().ok(header, str1, str2, str3)
-
-def yesnoDialog(str1, str2='', str3='', header=ADDON_NAME, yes='', no='', autoclose=0):
- return xbmcgui.Dialog().yesno(header, str1, str2, str3, no, yes, autoclose)
-
-def getParams():
- param=[]
- if len(sys.argv[2])>=2:
- params=sys.argv[2]
- cleanedparams=params.replace('?','')
- if (params[len(params)-1]=='/'):
- params=params[0:len(params)-2]
- pairsofparams=cleanedparams.split('&')
- param={}
- for i in range(len(pairsofparams)):
- splitparams={}
- splitparams=pairsofparams[i].split('=')
- if (len(splitparams))==2:
- param[splitparams[0]]=splitparams[1]
- return param
-
-socket.setdefaulttimeout(TIMEOUT)
-class USTVnow():
- def __init__(self):
- log('__init__')
- self.net = net.Net()
- self.cache = SimpleCache()
- if self.login(USER_EMAIL, PASSWORD) == False:
- raise SystemExit
-
-
- def mainMenu(self):
- log('mainMenu')
- for item in USTVNOW_MENU:
- self.addDir(*item)
-
-
- def buildHeader(self):
- header_dict = {}
- header_dict['Accept'] = 'application/json, text/javascript, */*; q=0.01'
- header_dict['Host'] = 'm-api.ustvnow.com'
- header_dict['Connection'] = 'keep-alive'
- header_dict['Referer'] = 'http://watch.ustvnow.com'
- header_dict['Origin'] = 'http://watch.ustvnow.com'
- header_dict['User-Agent'] = 'Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.127 Large Screen Safari/533.4 GoogleTV/162671'
- return header_dict
-
-
- def login(self, user, password):
- log('login')
- if len(user) > 0:
- try:
- #remove COOKIE_JAR Folder
- xbmcvfs.rmdir(COOKIE_JAR)
- except:
- pass
-
- if xbmcvfs.exists(COOKIE_JAR) == False:
- try:
- xbmcvfs.mkdirs(SETTINGS_LOC)
- f = xbmcvfs.File(COOKIE_JAR, 'w')
- f.close()
- except:
- log('login, Unable to create the storage directory', xbmc.LOGERROR)
- header_dict = self.buildHeader()
- self.net.set_cookies(COOKIE_JAR)
-
- try:
- #check token
- dvrlink = None
- custlink = json.loads(self.net.http_POST(BASEURL + 'gtv/1/live/getcustomerkey', form_data={'token':LAST_TOKEN}, headers=header_dict).content.encode("utf-8").rstrip())
- '''{u'username': u'', u'ip': u'', u'customerkey': u''}'''
- self.custkey = (custlink.get('customerkey','') or 0)
- if custlink and 'username' in custlink and user.lower() == custlink['username'].lower():
- log('login, using existing token, passkey')
- self.token = LAST_TOKEN
- self.passkey = LAST_PASSKEY
- else:
- #login
- loginlink = json.loads(self.net.http_POST(BASEURL + 'gtv/1/live/login', form_data={'username':user,'password':password,'device':'gtv','redir':'0'}, headers=header_dict).content.encode("utf-8").rstrip())
- '''{u'token': u'', u'result': u'success'}'''
- if loginlink and 'token' in loginlink and loginlink['result'].lower() == 'success':
- log('login, creating new token')
- self.token = loginlink['token']
- REAL_SETTINGS.setSetting('User_Token',self.token)
-
- #passkey
- dvrlink = json.loads(self.net.http_POST(BASEURL + 'gtv/1/live/viewdvrlist', form_data={'token':self.token}, headers=header_dict).content.encode("utf-8").rstrip())
- '''{u'globalparams': {u'passkey': u''}, u'results': []}'''
- if dvrlink and 'globalparams' in dvrlink:
- log('login, creating new passkey')
- self.passkey = dvrlink['globalparams']['passkey']
- REAL_SETTINGS.setSetting('User_Paskey',self.passkey)
- else:
- raise Exception
-
- #check user credentials
- userlink = json.loads(self.net.http_POST(BASEURL + 'gtv/1/live/getuserbytoken', form_data={'token':self.token}, headers=header_dict).content.encode("utf-8").rstrip())
- '''{u'status': u'success', u'data': {u'username': u'', u'need_account_activation': False, u'plan_id': 1, u'language': u'en', u'plan_free': 1, u'sub_id': u'7', u'lname': u'', u'currency': u'USD', u'points': 1, u'need_account_renew': False, u'fname': u'', u'plan_name': u'Free Plan'}}'''
- log('login, checking user account')
- if userlink and 'data' in userlink and userlink['status'].lower() == 'success':
- REAL_SETTINGS.setSetting('User_Plan' ,userlink['data']['plan_name'])
- expires = 'Never' if userlink['data']['plan_free'] == 1 else ''
- REAL_SETTINGS.setSetting('User_Expires' ,'%s'%expires)
- REAL_SETTINGS.setSetting('User_isFree' ,str(userlink['data']['plan_free'] == 1))
- REAL_SETTINGS.setSetting('User_DVRpoints' ,str((userlink['data']['points']) or 0))
- xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30006) + userlink['data']['fname'], ICON, 4000)
-
- if userlink['data']['need_account_renew'] == True:
- xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30016) + userlink['data']['fname'], ICON, 4000)
- elif userlink['data']['need_account_activation'] == True:
- xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30022) + userlink['data']['fname'], ICON, 4000)
- else:
- if REAL_SETTINGS.getSetting('User_DVRpoints') != REAL_SETTINGS.getSetting('Last_DVRpoints'):
- REAL_SETTINGS.setSetting('Last_DVRpoints',REAL_SETTINGS.getSetting('User_DVRpoints'))
- xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30021) + userlink['data']['fname'], ICON, 4000)
-
- #check subscription
- if self.custkey != 0:
- sublink = json.loads(self.net.http_POST(BASEURL + 'gtv/1/live/getaccountsubscription', form_data={'username':user,'customerkey':self.custkey}, headers=header_dict).content.encode("utf-8").rstrip())
- '''{u'username': u'', u'billingDatetime': u'', u'currency': u'USD', u'cgaccountstatusreason': u'', u'invoicehistory': u'', u'ocaccountstatus': u'Account active', u'ccLastFour': u'', u'lname': u'', u'x-cg-acnt-USD': False, u'fname': u'', u'sub_info': {u'cost': 0, u'plan': {u'sub_group': 4, u'plan_id': 1, u'name': u'Free Plan', u'language': u'en', u'date_expire': u'0000-00-00', u'sub_id': 7, u'price': 0, u'currency': u'USD', u'plan_code': u'7_FREETRIAL',
- u'details': u'This plan lets you receive all major US terrestrial stations (ABC, CBS, CW, FOX, NBC, PBS). You can later upgrade to a paid plan with more channels and DVR.'}, u'packages': []}, u'pendinginvoices': u'', u'cgbillingstatus': u'', u'dvrpoints': 1, u'plans': {u'10': {u'price': 15, u'name': u'1 Week All Channel Plan $15 ($2.14/day)',
- u'details': u'1 Week pass for all channels (No DVR)'}, u'23': {u'price': 19, u'name': u'All Channel Promo Plan $19/mo first 3 months',
- u'details': u'Monthly subscription for all channels. This promotional price is for the first three months after which it will renew at $29. This plan automatically renews each month but you can cancel anytime and will not be billed again when your current 30 day period has expired. '}, u'31': {u'price': 29, u'name': u'All Channel Promo Plan w/DVR $29/mo first 3 months',
- u'details': u'Monthly subscription for all channels. This promotional price is for the first three months after which it will renew at $39. This plan automatically renews each month but you can cancel anytime and will not be billed again when your current 30 day period has expired.'}, u'7': {u'price': 0, u'name': u'Free Plan',
- u'details': u'This plan lets you receive all major US terrestrial stations (ABC, CBS, CW, FOX, NBC, PBS). You can later upgrade to a paid plan with more channels and DVR.'}, u'9': {u'price': 0.00, u'name': u'3 Day All Channel Plan $6.99 ($2.33/day)',
- u'details': u'3 Day pass for all channels (No DVR)'}, u'8': {u'price': 2.99, u'name': u'1 Day All Channel Plan $2.99',
- u'details': u'24 hour pass for all channels (No DVR)'}}, u'cgredirectUrl': u'', u'cgaccountstatus': False, u'isfacebookuser': False, u'cgkey': u'', u'ocaccountstatuscode': 0, u'packages': [], u'subscription': u'Free Plan', u'language': u'en', u'sub_id': u'7', u'dateopened': u'December 01, 2000', u'canceledDatetime': u'', u'cgbillingmethod': u''}'''
- if sublink:
- REAL_SETTINGS.setSetting('User_Expires' ,str(sublink['sub_info']['date_expire']))
- REAL_SETTINGS.setSetting('User_Created' ,str(sublink['sub_info']['dateopened']))
- else:
- raise Exception
- self.net.save_cookies(COOKIE_JAR)
-
- self.channels = channels = self.cache.get(ADDON_NAME + '.channelguide')
- if not self.channels:
- log('login, refreshing channels')
- channels = sorted(json.loads(self.net.http_POST(BASEURL + 'gtv/1/live/channelguide', form_data={'token':self.token}, headers=header_dict).content.encode("utf-8").rstrip())['results'], key=lambda x: x['displayorder'])
- '''{u'app_name': u'preview', u'stream': u'00000WXYZustvnow', u'af': u'US', u'dvraction': u'add', u'callsign': u'WHTM', u'event_inprogress': 1,
- u'srsid': 3560383, u'guideremainingtime': 3660, u'scheduleid': 9952642, u'favoriteaction': u'remove', u'event_time': u'00:00:00',u'title': u'Shark Tank',
- u'timemark': 1498867200, u'recordedon': u'June 30, 2017 20:00', u'prg_img': u'h3/NowShowing/9977826/p9977826_b1t_h3_aa.jpg', u'title_10': u'',
- u'xcdrappname': u'livehd', u'event_date': u'2017-07-01', u'has_img': 1, u'stream_code': u'ABC', u'updated': u'2017-06-29 11:49:08',
- u'description': u'Durable bags made out of the material that protects on the front lines of firefighting; a vibrating mat that helps calm babies;
- an ointment made from essential oils; a natural snack made with acai.', u'actualremainingtime': 3281, u'content_allowed': False,
- u'dvrtimeraction': u'add', u'mediatype': u'EP', u'auth': None, u'stream_origin': u'dne.ustvnow.com', u'dvrtimertype': 0, u'scode': u'whtm',
- u'aksid': 1, u'guideheight': 120, u'orig_air_date': u'2017-02-10', u'prgsvcid': 11534, u'runtime': 3660, u'img': u'images/WHTM.png',
- u'connectorid': u'SH011581290000', u'ut_start': 1498867200, u'streamname': u'00000WXYZustvnow', u'episode_title': u'', u'synopsis':
- u'A vibrating mat that helps calm babies.', u't': 1, u'edgetypes': 7, u'imgmark': u'live', u'content_id': u'EP011581290171', u'order': 1,
- u'displayorder': 1}'''
- self.cache.set(ADDON_NAME + '.channelguide', channels, expiration=datetime.timedelta(minutes=10))
- self.channels = self.cache.get(ADDON_NAME + '.channelguide')
-
- self.upcoming = self.cache.get(ADDON_NAME + '.upcoming')
- if not self.upcoming:
- log('login, refreshing upcoming')
- upcoming = json.loads(self.net.http_POST(BASEURL + 'gtv/1/live/upcoming', form_data={'token':self.token}, headers=header_dict).content.encode("utf-8").rstrip())
- '''{u'prgschid': 19479379, u'dvraction': u'add', u'callsign': u'AMC', u'newtimecat': True, u'srsid': 14930, u'timecat': u'Today', u'scheduleid': 9946282,
- u'img': u'images/AMC.png', u'title': u'The Fugitive', u'prg_img': u'v5/NowShowing/14930/p14930_p_v5_aa.jpg', u'has_img': 1, u't': 0, u'sname': u'AMC',
- u'description': u'U.S. marshal (Tommy Lee Jones) hunts doctor (Harrison Ford) for murder of his wife (Sela Ward).', u'dvrtimeraction': u'add',
- u'auth': None, u'orig_air_date': None, u'dvrtimertype': 0, u'scode': u'amchd', u'prgsvcid': 10021, u'runtime': 10800, u'connectorid': u'MV000371790000',
- u'episode_title': u'', u'synopsis': u'An innocent man must evade the law as he pursues a killer.', u'event_inprogress': 1, u'ut_start': 1499009400,
- u'content_allowed': False, u'imgmark': u'live', u'content_id': u'MV000371790000', u'displayorder': 100}'''
- self.cache.set(ADDON_NAME + '.upcoming', upcoming, expiration=datetime.timedelta(minutes=10))
- self.upcoming = self.cache.get(ADDON_NAME + '.upcoming')
-
- self.recorded = self.cache.get(ADDON_NAME + '.recorded')
- if not self.recorded:
- log('login, refreshing recorded')
- '''{u'fn1': u'20170702', u'episode_season': 0, u'filename_smil': u'20170702_213000_220000_utc_SH000000010000_11534_11534_ABC.smil', u'app_name': u'dvrrokuplay',
- u'stream': u'2F1ECWHTMUSTVNOW', u'imgmark': u'rem', u'dvrtimeraction': u'add', u'mediatype': u'SH', u'orig_air_date': None, u'content_id': u'SH000000010000',
- u'callsign': u'WHTM', u'ut_expires': 1500327000, u'filename_med': u'20170702_213000_220000_utc_SH000000010000_11534_11534_ABC_650.mp4',
- u'filename_high': u'20170702_213000_220000_utc_SH000000010000_11534_11534_ABC_950.mp4', u'dvrlocation': u'dvr6', u'episode_number': 0, u'srsid': 459763,
- u'runtime': 1800, u'description': u'Paid programming.', u'scheduleid': 9952747, u'has_img': 1, u'fn3': u'220000', u'fn2': u'213000',
- u'event_time': u'21:30:00', u'title': u'Paid Programming', u'recordedonmmddyyyy': u'07/02/2017', u'connectorid': u'SH000000010000',
- u'recordedon': u'July 2, 2017', u'prg_img': u'h3/NowShowing/459763/p459763_b_h3_ae.jpg', u'filename_low': u'20170702_213000_220000_utc_SH000000010000_11534_11534_ABC_350.mp4',
- u'episode_title': u'', u'synopsis': u'Paid programming.', u'dvrtimertype': 0, u'content_allowed': True, u'xcdrappname': u'livehd', u'event_date': u'2017-07-02',
- u'event_inprogress': 2, u'prgsvcid': 11534, u'ut_start': 1499031000, u'stream_code': u'ABC'}'''
- if dvrlink:
- recorded = dvrlink['results']
- else:
- recorded = (json.loads(self.net.http_POST(BASEURL + 'gtv/1/live/viewdvrlist', form_data={'token':self.token}, headers=header_dict).content.encode("utf-8").rstrip()))['results']
- self.cache.set(ADDON_NAME + '.recorded', recorded, expiration=datetime.timedelta(minutes=10))
- self.recorded = self.cache.get(ADDON_NAME + '.recorded')
- return True
- except Exception,e:
- log('login, Unable to login ' + str(e), xbmc.LOGERROR)
- REAL_SETTINGS.setSetting('LAST_TOKEN','')
- REAL_SETTINGS.setSetting('LAST_PASSKEY','')
- REAL_SETTINGS.setSetting('User_Activated',str(False))
- xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30007), ICON, 4000)
- return False
- else:
- #firstrun wizard
- if yesnoDialog(LANGUAGE(30008),no=LANGUAGE(30009), yes=LANGUAGE(30010)):
- user = inputDialog(LANGUAGE(30001))
- password = inputDialog(LANGUAGE(30002),opt=xbmcgui.ALPHANUM_HIDE_INPUT)
- REAL_SETTINGS.setSetting('User_Email' ,user)
- REAL_SETTINGS.setSetting('User_Password',password)
- return self.login(user, password)
- else:
- okDialog(LANGUAGE(30003))
- return False
-
-
- def browseLive(self):
- log('browseLive')
- d = datetime.datetime.utcnow()
- now = datetime.datetime.fromtimestamp(calendar.timegm(d.utctimetuple()))
- isFree = REAL_SETTINGS.getSetting('User_isFree') == "True"
- for channel in self.channels:
- try:
- name = CHAN_NAMES[channel['stream_code']]
- if isFree == True and name not in FREE_CHANS:
- continue
- startime = datetime.datetime.fromtimestamp(channel['ut_start'])
- endtime = startime + datetime.timedelta(seconds=channel['runtime'])
- if endtime > now and startime <= now:
- label, url, liz = self.buildChannelListItem(name, channel)
- self.addLink(label, url, 9, liz, len(self.channels))
- except:
- xbmc.executebuiltin("Container.Refresh")
-
-
- def browseRecordings(self, recorded=False):
- log('browseRecordings')
- d = datetime.datetime.utcnow()
- now = datetime.datetime.fromtimestamp(calendar.timegm(d.utctimetuple()))
- for channel in self.recorded:
- try:
- startime = datetime.datetime.fromtimestamp(channel['ut_start'])
- endtime = startime + datetime.timedelta(seconds=channel['runtime'])
- if endtime > now and (startime <= now or startime > now) and recorded == True:
- continue
- elif endtime < now and (startime <= now or startime > now) and recorded == False:
- continue
- label, url, liz = self.buildRecordedListItem(CHAN_NAMES[channel['stream_code']])
- self.addLink(label, url, 10, liz, len(self.recorded))
- except:
- xbmc.executebuiltin("Container.Refresh")
-
-
- def browseGuide(self, name=None, upcoming=False):
- log('browseGuide')
- d = datetime.datetime.utcnow()
- now = datetime.datetime.fromtimestamp(calendar.timegm(d.utctimetuple()))
- isFree = REAL_SETTINGS.getSetting('User_isFree') == "True"
- if name is None and upcoming == False:
- collect = []
- for channel in self.channels:
- try:
- name = CHAN_NAMES[channel['stream_code']]
- if isFree == True and name not in FREE_CHANS:
- continue
- collect.append(name)
- except:
- xbmc.executebuiltin("Container.Refresh")
- counter = collections.Counter(collect)
- for key, value in sorted(counter.iteritems()):
- icon = (os.path.join(IMG_PATH,'logos','%s.png'%key) or ICON)
- infoArt = {"thumb":icon,"poster":icon,"icon":icon,"fanart":FANART}
- self.addDir("%s"%(key), key, 4, infoArt=infoArt)
- else:
- for channel in self.channels:
- try:
- if isFree == True and name not in FREE_CHANS:
- continue
- if name == CHAN_NAMES[channel['stream_code']]:
- startime = datetime.datetime.fromtimestamp(channel['ut_start'])
- endtime = startime + datetime.timedelta(seconds=channel['runtime'])
- if endtime > now and (startime <= now):
- label, url, liz = self.buildChannelListItem(name, channel)
- self.addLink(label, url, 9, liz, len(self.channels))
- elif endtime > now and (startime <= now or startime > now):
- label, url, liz = self.buildChannelListItem(name, channel)
- mode = 9 if PTVL_RUN == True else 21
- if mode == 21:
- liz.setProperty("IsPlayable","false")
- self.addLink(label, url, mode, liz, len(self.channels))
- except:
- xbmc.executebuiltin("Container.Refresh")
-
-
- def browseFeatured(self):
- log('browseFeatured')
- d = datetime.datetime.utcnow()
- now = datetime.datetime.fromtimestamp(calendar.timegm(d.utctimetuple()))
- isFree = REAL_SETTINGS.getSetting('User_isFree') == "True"
- for channel in self.upcoming:
- try:
- name = CHAN_NAMES[channel['sname']]
- startime = datetime.datetime.fromtimestamp(channel['ut_start'])
- endtime = startime + datetime.timedelta(seconds=channel['runtime'])
- if endtime > now and (startime <= now or startime > now):
- label, url, liz = self.buildChannelListItem(name, channel, feat=True)
- liz.setProperty("IsPlayable","false")
- self.addLink(label, url, 21, liz, len(self.upcoming))
- except:
- xbmc.executebuiltin("Container.Refresh")
-
-
- def buildChannelListItem(self, name, channel=None, feat=False):
- if channel is None:
- for channel in self.channels:
- if name == CHAN_NAMES[channel['stream_code']]:
- break
- startime = datetime.datetime.fromtimestamp(channel['ut_start'])
- endtime = startime + datetime.timedelta(seconds=channel['runtime'])
- title = unescape(channel['title'])
- mediatype = (channel.get('mediatype','') or (channel.get('connectorid',''))[:2] or (channel.get('content_id',''))[:2] or 'SP')
- mtype = MEDIA_TYPES[mediatype.upper()]
- if PTVL_RUN == True:
- label = name
- elif feat == True:
- label = '%s %s-%s: %s - %s'%(startime.strftime('%m/%d/%Y'),startime.strftime('%I:%M').lstrip('0'),endtime.strftime('%I:%M %p').lstrip('0'),name,title)
- else:
- label = '%s: %s - %s'%(startime.strftime('%I:%M %p').lstrip('0'),name,title)
- label2 = '%s - %s'%(startime.strftime('%I:%M %p').lstrip('0'),endtime.strftime('%I:%M %p').lstrip('0'))
- scode = (channel.get('stream_code','') or channel.get('sname','') or '')
- url = CHAN_NAMES[scode]
- liz = xbmcgui.ListItem(label)
- infoList = {"mediatype":mtype,"label":label,"label2":label2,"title":label,
- "studio":CHAN_NAMES[scode],"duration":channel['runtime'],"plotoutline":unescape(channel['synopsis']),
- "plot":unescape(channel['description']),"aired":(channel['orig_air_date'] or startime.strftime('%Y-%m-%d'))}
-
- # if mediatype.startswith('MV'):
- # poster = IMG_MOVIE+channel['prg_img']
- # elif mediatype.startswith(('SH','EP')):
- # poster = IMG_TV+channel['prg_img']
- # else:
- thumb = IMG_HTTP + str(channel['srsid']) + '&cs=' + channel['callsign'] + '&tid=' + mediatype
- poster = (os.path.join(IMG_PATH,'%s.png'%name) or ICON)
- liz.setInfo(type="Video", infoLabels=infoList)
- liz.setArt({"thumb":thumb,"poster":poster,"fanart":FANART})
- liz.setProperty("IsPlayable","true")
- liz.setProperty("IsInternetStream","true")
- if channel['dvrtimeraction'] == 'add':
- opt = '@'.join([str(channel['prgsvcid']),(channel.get('event_time','') or str(channel.get('ut_start','')))])#lazy solution rather then create additional url parameters for this single function.
- contextMenu = [('Set single recording' ,'XBMC.RunPlugin(%s)'%(sys.argv[0]+"?url="+urllib.quote_plus(str(channel['connectorid']))+"&mode="+str(6)+"&name="+urllib.quote_plus(opt))),
- ('Set recurring recording','XBMC.RunPlugin(%s)'%(sys.argv[0]+"?url="+urllib.quote_plus(str(channel['connectorid']))+"&mode="+str(7)+"&name="+urllib.quote_plus(opt)))]
- else:
- contextMenu = [('Remove recording','XBMC.RunPlugin(%s)'%(sys.argv[0]+"?url="+urllib.quote_plus(str(channel['scheduleid']))+"&mode="+str(8)+"&name="+urllib.quote_plus(name)))]
- liz.addContextMenuItems(contextMenu)
- log('buildChannelListItem, label = ' + label + ', url = ' + url)
- return label, url, liz
-
-
- def buildRecordedListItem(self, name):
- for channel in self.recorded:
- if name == CHAN_NAMES[channel['stream_code']] or name == str(channel['scheduleid']):
- startime = datetime.datetime.fromtimestamp(channel['ut_start'])
- endtime = startime + datetime.timedelta(seconds=channel['runtime'])
- title = unescape(channel['title'])
- label = '%s %s-%s: %s - %s'%(startime.strftime('%m/%d/%Y'),startime.strftime('%I:%M').lstrip('0'),endtime.strftime('%I:%M %p').lstrip('0'),name,title)
- label2 = '%s %s-%s'%(startime.strftime('%m/%d/%Y'),startime.strftime('%I:%M').lstrip('0'),endtime.strftime('%I:%M %p').lstrip('0'))
- url = str(channel['scheduleid'])
- liz = xbmcgui.ListItem(label)
- mediatype = (channel.get('mediatype','') or (channel.get('connectorid',''))[:2] or (channel.get('content_id',''))[:2] or 'SP')
- mtype = MEDIA_TYPES[mediatype.upper()]
- infoList = {"mediatype":mtype,"label":label,"label2":label2,"title":label,"studio":CHAN_NAMES[channel['stream_code']],
- "duration":channel['runtime'],"plotoutline":unescape(channel['synopsis']),"plot":unescape(channel['description']),
- "aired":(channel['orig_air_date'] or startime.strftime('%Y-%m-%d'))}
- # if mediatype.startswith('MV'):
- # poster = IMG_MOVIE+channel['prg_img']
- # elif mediatype.startswith(('SH','EP')):
- # poster = IMG_TV+channel['prg_img']
- # else:
- thumb = IMG_HTTP + str(channel['srsid']) + '&cs=' + channel['callsign'] + '&tid=' + mediatype
- poster = (os.path.join(IMG_PATH,'%s.png'%name) or ICON)
- liz.setInfo(type="Video", infoLabels=infoList)
- liz.setArt({"thumb":thumb,"poster":poster,"fanart":FANART})
- liz.setProperty("IsPlayable","true")
- liz.setProperty("IsInternetStream","true")
- if channel['dvrtimeraction'] == 'add':
- opt = '@'.join([str(channel['prgsvcid']),channel['event_time']])#lazy solution rather then create additional url parameters for this single function.
- contextMenu = [('Set single recording' ,'XBMC.RunPlugin(%s)'%(sys.argv[0]+"?url="+urllib.quote_plus(str(channel['connectorid']))+"&mode="+str(6)+"&name="+urllib.quote_plus(opt))),
- ('Set recurring recording','XBMC.RunPlugin(%s)'%(sys.argv[0]+"?url="+urllib.quote_plus(str(channel['connectorid']))+"&mode="+str(7)+"&name="+urllib.quote_plus(opt)))]
- else:
- contextMenu = [('Remove recording','XBMC.RunPlugin(%s)'%(sys.argv[0]+"?url="+urllib.quote_plus(str(channel['scheduleid']))+"&mode="+str(8)+"&name="+urllib.quote_plus(name)))]
- liz.addContextMenuItems(contextMenu)
- log('buildRecordedListItem, label = ' + label + ', url = ' + url)
- return label, url, liz
-
-
- def resolveURL(self, url, dvr=False):
- log('resolveURL, url = ' + url + ', dvr = ' + str(dvr))
- isFree = REAL_SETTINGS.getSetting('User_isFree') == "True"
- if dvr:
- for channel in self.recorded:
- if url == str(channel['scheduleid']):
- try:
- urllink = json.loads(self.net.http_POST(BASEURL + 'stream/1/dvr/play', form_data={'token':self.token,'key':self.passkey,'scheduleid':channel['scheduleid']}, headers=self.buildHeader()).content.encode("utf-8").rstrip())
- '''{u'pr': u'll', u'domain': u'ilvc02.ll.ustvnow.com',u'stream': u'http://ilvc02.ll.ustvnow.com/ilv10/pr/xxl/smil:0B64AWHTMUSTVNOW/playlist.m3u8?',
- u'streamname': u'0B64AWHTMUSTVNOW', u'tr': u'', u'up': 1, u'pd': 0, u'pl': u'vjs'}'''
- if urllink and 'stream' in urllink:
- return urllink['stream']
- except Exception,e:
- if channel and channel['scheduleid']:
- self.replaceToken(url, dvr)
- else:
- for channel in self.channels:
- if url == CHAN_NAMES[channel['stream_code']]:
- try:
- urllink = json.loads(self.net.http_POST(BASEURL + 'stream/1/live/view', form_data={'token':self.token,'key':self.passkey,'scode':channel['scode']}, headers=self.buildHeader()).content.encode("utf-8").rstrip())
- '''{u'pr': u'll', u'domain': u'ilvc02.ll.ustvnow.com',u'stream': u'http://ilvc02.ll.ustvnow.com/ilv10/pr/xxl/smil:0B64AWHTMUSTVNOW/playlist.m3u8?',
- u'streamname': u'0B64AWHTMUSTVNOW', u'tr': u'', u'up': 1, u'pd': 0, u'pl': u'vjs'}'''
- if urllink and 'stream' in urllink:
- return urllink['stream']
- except Exception,e:
- if channel and channel['scode']:
- self.replaceToken(url, dvr)
-
-
- def replaceToken(self, url, dvr):
- #generate alternative token using website endpoint rather then googletv.
- try:
- #get CSRF Token
- responce = urllib2.urlopen(BASEWEB + "account/signin").read()
- CSRF = re.findall(r'var csrf_value = "(.*?)"', responce, re.DOTALL)[0]
- #get WEB Token
- responce = (self.net.http_POST(BASEWEB + 'account/login', form_data={'csrf_ustvnow': CSRF, 'signin_email': USER_EMAIL, 'signin_password':PASSWORD, 'signin_remember':'1'}).content.encode("utf-8").rstrip())
- altToken = re.findall(r'var token(.*?)= "(.*?)";', responce, re.DOTALL)[0][1]
- if altToken and altToken != 'null':
- self.token = altToken
- log('replaceToken, replacing existing token')
- REAL_SETTINGS.setSetting('User_Token',altToken)
- self.resolveURL(url, dvr)
- except Exception,e:
- log('replaceToken, Unable to login ' + str(e), xbmc.LOGERROR)
- xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30005), ICON, 4000)
- raise SystemExit
-
-
- def setRecording(self, name, url, remove=False, recurring=False):
- if remove == True:
- setlink = (self.net.http_POST(BASEURL + 'gtv/1/dvr/updatedvr', form_data={'scheduleid':url,'token':self.token,'action':'add'}, headers=self.buildHeader()).content.encode("utf-8").rstrip())
- else:
- if int(REAL_SETTINGS.getSetting('User_DVRpoints')) <= 1:
- xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30019), ICON, 4000)
- return
- opt = name.split('@')#lazy solution rather then create additional url parameters for this single function.
- if recurring == True:
- setlink = (self.net.http_POST(BASEURL + 'gtv/1/dvr/updatedvrtimer', form_data={'connectorid':url,'prgsvcid':opt[0],'eventtime':opt[1],'token':self.token,'action':'add'}, headers=self.buildHeader()).content.encode("utf-8").rstrip())
- else:
- setlink = (self.net.http_POST(BASEURL + 'gtv/1/dvr/updatedvr' , form_data={'scheduleid':url,'token':self.token,'action':'add'}, headers=self.buildHeader()).content.encode("utf-8").rstrip())
- '''<result><status>failure</status><action>add</action></result>'''
- action = re.findall(r'<action>(.*?)</action>', setlink, re.DOTALL)[0]
- status = re.findall(r'<status>(.*?)</status>', setlink, re.DOTALL)[0]
- log('setRecording, action = ' + action + ', status = ' + status)
- if status == 'failure':
- xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30023)%action.title(), ICON, 4000)
- return
- xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30024)%action.title(), ICON, 4000)
-
-
- def playVideo(self, url, dvr=False):
- log('playVideo, url = ' + url + ', dvr = ' + str(dvr))
- if dvr:
- label, path, liz = self.buildRecordedListItem(url)
- else:
- label, path, liz = self.buildChannelListItem(url)
- liz.setPath(self.resolveURL(url,dvr))
- xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
-
-
- def addLink(self, name, u, mode, liz, total=0):
- log('addLink, name = ' + name)
- u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
- xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,totalItems=total)
-
-
- def addDir(self, name, u, mode, infoList=False, infoArt=False):
- log('addDir, name = ' + name)
- liz=xbmcgui.ListItem(name)
- liz.setProperty('IsPlayable', 'false')
- if infoList == False:
- liz.setInfo(type="Video", infoLabels={"mediatype":"video","label":name,"title":name} )
- else:
- liz.setInfo(type="Video", infoLabels=infoList)
- if infoArt == False:
- liz.setArt({'thumb':ICON,'fanart':FANART})
- else:
- liz.setArt(infoArt)
- u=sys.argv[0]+"?url="+urllib.quote_plus(u)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
- xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
-
-
- def uEPG(self):
- log('uEPG')
- #support for upcoming uEPG universal epg framework module, module will be available from the Kodi repository.
- #https://github.com/Lunatixz/XBMC_Addons/tree/master/script.module.uepg
- isFree = REAL_SETTINGS.getSetting('User_isFree') == "True"
- for idx,channel in enumerate(self.channels):
- try:
- newChannel = {}
- name = CHAN_NAMES[channel['stream_code']]
- if isFree == True and name not in FREE_CHANS:
- continue
-
- mediatype = (channel.get('mediatype','') or (channel.get('connectorid',''))[:2] or (channel.get('content_id',''))[:2] or 'SP')
- mtype = MEDIA_TYPES[mediatype.upper()]
- thumb = IMG_HTTP + str(channel['srsid']) + '&cs=' + channel['callsign'] + '&tid=' + mediatype
- poster = (os.path.join(IMG_PATH,'%s.png'%name) or ICON)
-
- for key, value in channel.iteritems():
- try:
- newChannel[uEPG_PARAMS[key]] = unescape(value)
- except:
- if key in FILE_PARAMS + PVR_PARAMS:
- newChannel[key] = unescape(value)
- newChannel['art'] = {"thumb":thumb,"poster":poster}
- newChannel['mediatype'] = mtype
- newChannel['channelname'] = name
- newChannel['channelnumber'] = idx + 1
- yield newChannel
- except:
- pass
-
-
-params=getParams()
-try:
- url=urllib.unquote_plus(params["url"])
-except:
- url=None
-try:
- name=urllib.unquote_plus(params["name"])
-except:
- name=None
-try:
- mode=int(params["mode"])
-except:
- mode=None
-
-log("Mode: "+str(mode))
-log("URL : "+str(url))
-log("Name: "+str(name))
-
-if mode==None: USTVnow().mainMenu()
-elif mode == 0: USTVnow().browseLive()
-elif mode == 1: USTVnow().browseRecordings()
-elif mode == 2: USTVnow().browseRecordings(recorded=True)
-elif mode == 3: USTVnow().browseGuide()
-elif mode == 4: USTVnow().browseGuide(name)
-elif mode == 5: USTVnow().browseFeatured()
-elif mode == 6: USTVnow().setRecording(name,url)
-elif mode == 7: USTVnow().setRecording(name,url,recurring=True)
-elif mode == 8: USTVnow().setRecording(name,url,remove=True)
-elif mode == 9: USTVnow().playVideo(url)
-elif mode == 10:USTVnow().playVideo(url,dvr=True)
-elif mode == 20:xbmc.executebuiltin("RunScript(script.module.uepg,json=%s&refresh=%s&refresh_interval=%s)"%(urllib.quote_plus(json.dumps(list(USTVnow().uEPG()))),urllib.quote_plus(json.dumps(sys.argv[0]+"?mode=20")),urllib.quote_plus(json.dumps("hours=2"))))
-elif mode == 21:xbmc.executebuiltin("action(ContextMenu)")
-
-xbmcplugin.addSortMethod(int(sys.argv[1]) , xbmcplugin.SORT_METHOD_NONE )
-xbmcplugin.addSortMethod(int(sys.argv[1]) , xbmcplugin.SORT_METHOD_LABEL )
-xbmcplugin.endOfDirectory(int(sys.argv[1]), cacheToDisc=True) \ No newline at end of file
+#entrypoint
+if __name__ == '__main__':
+ from resources.lib import ustvnow \ No newline at end of file
diff --git a/plugin.video.ustvnow/resources/__init__.py b/plugin.video.ustvnow/resources/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.ustvnow/resources/__init__.py
diff --git a/plugin.video.ustvnow/resources/images/screenshot01.png b/plugin.video.ustvnow/resources/images/screenshot01.png
index 9df9333..0a8e5b2 100644
--- a/plugin.video.ustvnow/resources/images/screenshot01.png
+++ b/plugin.video.ustvnow/resources/images/screenshot01.png
Binary files differ
diff --git a/plugin.video.ustvnow/resources/images/screenshot02.png b/plugin.video.ustvnow/resources/images/screenshot02.png
index a795689..199894e 100644
--- a/plugin.video.ustvnow/resources/images/screenshot02.png
+++ b/plugin.video.ustvnow/resources/images/screenshot02.png
Binary files differ
diff --git a/plugin.video.ustvnow/resources/images/screenshot03.png b/plugin.video.ustvnow/resources/images/screenshot03.png
index c8291b1..ae70489 100644
--- a/plugin.video.ustvnow/resources/images/screenshot03.png
+++ b/plugin.video.ustvnow/resources/images/screenshot03.png
Binary files differ
diff --git a/plugin.video.ustvnow/resources/images/screenshot04.png b/plugin.video.ustvnow/resources/images/screenshot04.png
index 74d629c..06f608a 100644
--- a/plugin.video.ustvnow/resources/images/screenshot04.png
+++ b/plugin.video.ustvnow/resources/images/screenshot04.png
Binary files differ
diff --git a/plugin.video.ustvnow/resources/images/screenshot05.png b/plugin.video.ustvnow/resources/images/screenshot05.png
index e27c2b5..06f608a 100644
--- a/plugin.video.ustvnow/resources/images/screenshot05.png
+++ b/plugin.video.ustvnow/resources/images/screenshot05.png
Binary files differ
diff --git a/plugin.video.ustvnow/resources/language/resource.language.en_gb/strings.po b/plugin.video.ustvnow/resources/language/resource.language.en_gb/strings.po
index bb60687..bd88706 100644
--- a/plugin.video.ustvnow/resources/language/resource.language.en_gb/strings.po
+++ b/plugin.video.ustvnow/resources/language/resource.language.en_gb/strings.po
@@ -45,7 +45,7 @@ msgid "Welcome Back "
msgstr ""
msgctxt "#30007"
-msgid "Invalid User Credentials"
+msgid "Something went wrong, please check user credentials and try again."
msgstr ""
msgctxt "#30008"
@@ -89,7 +89,7 @@ msgid "Account Information:"
msgstr ""
msgctxt "#30018"
-msgid "Refreshing Data, Try again..."
+msgid "Subscription expiration - "
msgstr ""
msgctxt "#30019"
@@ -114,4 +114,24 @@ msgstr ""
msgctxt "#30024"
msgid "%s Recording Successful"
-msgstr "" \ No newline at end of file
+msgstr ""
+
+msgctxt "#30025"
+msgid "Preferred Playback Method"
+msgstr ""
+
+msgctxt "#30026"
+msgid "Preferred Stream Quality"
+msgstr ""
+
+msgctxt "#30027"
+msgid "%s - Enter Search Term"
+msgstr ""
+
+msgctxt "#30028"
+msgid "Found No Results for %s"
+msgstr ""
+
+msgctxt "#30029"
+msgid "Video Rentals Coming Soon!"
+msgstr ""
diff --git a/plugin.video.ustvnow/resources/lib/__init__.py b/plugin.video.ustvnow/resources/lib/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.ustvnow/resources/lib/__init__.py
diff --git a/plugin.video.ustvnow/net.py b/plugin.video.ustvnow/resources/lib/net.py
index 769881c..c6237fd 100644
--- a/plugin.video.ustvnow/net.py
+++ b/plugin.video.ustvnow/resources/lib/net.py
@@ -16,22 +16,27 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
'''
-import cookielib
-import gzip
-import re
-import StringIO
-import urllib
-import urllib2
-import socket
-
-#Set Global timeout - Useful for slow connections and Putlocker.
-socket.setdefaulttimeout(30)
+import socket, urllib, urllib2, cookielib, gzip
+import re, StringIO, requests, traceback
+import xbmc, xbmcaddon
+# Plugin Info
+ADDON_ID = 'plugin.video.ustvnow'
+REAL_SETTINGS = xbmcaddon.Addon(id=ADDON_ID)
+ADDON_VERSION = REAL_SETTINGS.getAddonInfo('version')
+DEBUG = REAL_SETTINGS.getSetting('Enable_Debugging') == 'true'
+
+def log(msg, level=xbmc.LOGDEBUG):
+ if DEBUG == False and level != xbmc.LOGERROR: return
+ if level == xbmc.LOGERROR: msg += ' ,' + traceback.format_exc()
+ xbmc.log(ADDON_ID + '-' + ADDON_VERSION + '-' + (msg.encode("utf-8")), level)
+
class HeadRequest(urllib2.Request):
'''A Request class that sends HEAD requests'''
def get_method(self):
return 'HEAD'
+socket.setdefaulttimeout(30)
class Net:
'''
This class wraps :mod:`urllib2` and provides an easy way to make http
@@ -48,9 +53,8 @@ class Net:
_cj = cookielib.LWPCookieJar()
_proxy = None
- _user_agent = 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 ' + \
- '(KHTML, like Gecko) Chrome/13.0.782.99 Safari/535.1'
- _http_debug = False
+ _user_agent = 'Mozilla/5.0'
+ _http_debug = DEBUG
def __init__(self, cookie_file='', proxy='', user_agent='',
@@ -230,6 +234,14 @@ class Net:
return HttpResponse(response)
+ def _json(self, url, form_data={}, headers={}):
+ if not headers:
+ headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36',
+ 'X-Requested-With': 'XMLHttpRequest'}
+ response = requests.get(url, params=form_data, headers=headers)
+ return response.json()
+
+
def _fetch(self, url, form_data={}, headers={}, compression=True):
'''
Perform an HTTP GET or POST request.
@@ -252,16 +264,21 @@ class Net:
meta-information about the page and the page content.
'''
encoding = ''
- req = urllib2.Request(url)
- if form_data:
- form_data = urllib.urlencode(form_data)
- req = urllib2.Request(url, form_data)
- req.add_header('User-Agent', self._user_agent)
- for k, v in headers.items():
- req.add_header(k, v)
- if compression:
- req.add_header('Accept-Encoding', 'gzip')
- response = urllib2.urlopen(req)
+ try:
+ req = urllib2.Request(url)
+ if form_data:
+ form_data = urllib.urlencode(form_data)
+ req = urllib2.Request(url, form_data)
+ req.add_header('User-Agent', self._user_agent)
+ for k, v in headers.items():
+ req.add_header(k, v)
+ if compression:
+ req.add_header('Accept-Encoding', 'gzip')
+ response = urllib2.urlopen(req)
+ except urllib2.HTTPError as e:
+ log('_fetch, failed ' + str(e.code), xbmc.LOGERROR)
+ log('_fetch, failed ' + str(e.msg), xbmc.LOGERROR)
+ return
return HttpResponse(response)
diff --git a/plugin.video.ustvnow/resources/lib/ustvnow.py b/plugin.video.ustvnow/resources/lib/ustvnow.py
new file mode 100644
index 0000000..13d566c
--- /dev/null
+++ b/plugin.video.ustvnow/resources/lib/ustvnow.py
@@ -0,0 +1,787 @@
+# Copyright (C) 2017 Lunatixz
+#
+#
+# This file is part of USTVnow
+#
+# USTVnow is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# USTVnow is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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 USTVnow. If not, see <http://www.gnu.org/licenses/>.
+
+# -*- coding: utf-8 -*-
+import os, sys, datetime, re, traceback, HTMLParser, calendar
+import urllib, urllib2, socket, json, collections, net, random
+import xbmc, xbmcvfs, xbmcgui, xbmcplugin, xbmcaddon
+
+from simplecache import SimpleCache
+# Plugin Info
+ADDON_ID = 'plugin.video.ustvnow'
+REAL_SETTINGS = xbmcaddon.Addon(id=ADDON_ID)
+ADDON_NAME = REAL_SETTINGS.getAddonInfo('name')
+SETTINGS_LOC = REAL_SETTINGS.getAddonInfo('profile')
+ADDON_PATH = REAL_SETTINGS.getAddonInfo('path').decode('utf-8')
+ADDON_VERSION = REAL_SETTINGS.getAddonInfo('version')
+ICON = REAL_SETTINGS.getAddonInfo('icon')
+FANART = REAL_SETTINGS.getAddonInfo('fanart')
+LANGUAGE = REAL_SETTINGS.getLocalizedString
+
+## GLOBALS ##
+TIMEOUT = 30
+CONTENT_TYPE = 'files'
+USER_EMAIL = REAL_SETTINGS.getSetting('User_Email')
+PASSWORD = REAL_SETTINGS.getSetting('User_Password')
+LAST_TOKEN = REAL_SETTINGS.getSetting('User_Token')
+LAST_PASSKEY = REAL_SETTINGS.getSetting('User_Paskey')
+DEBUG = REAL_SETTINGS.getSetting('Enable_Debugging') == 'true'
+PTVL_RUN = xbmcgui.Window(10000).getProperty('PseudoTVRunning') == 'True'
+BASEURL = 'https://m-api.ustvnow.com/'
+BASEWEB = 'https://watch.ustvnow.com'
+BASEMOB = 'http://mc.ustvnow.com/'
+IMG_PATH = os.path.join(ADDON_PATH,'resources','images')
+IMG_BASE = 'http://m.poster.static-ustvnow.com'
+IMG_SOURCE = IMG_BASE + '/%s/%s/%s/med'
+IMG_CHLOGO_W = 'http://tvdata.ustvnow.com/inverse-logos/360/%s.png'
+IMG_CHLOGO = 'http://m.ustvnow.com/images/%s.png'
+COOKIE_JAR = xbmc.translatePath(os.path.join(SETTINGS_LOC, "cookiejar.lwp"))
+MEDIA_TYPES = {'SP':'video','SH':'episode','EP':'episode','MV':'movie'}
+FREE_CHANS = ['CW','ABC','FOX','PBS','CBS','NBC','MY9']
+URL_TYPE = {0:'m3u8',1:'mp4'}[int(REAL_SETTINGS.getSetting('URL_Type'))]
+URL_QUALITY = int(REAL_SETTINGS.getSetting('URL_Quality')) + 1
+CHAN_NAMES = {'whtm':'ABC','ABC':'ABC','amchd':'AMC','AMC':'AMC','animalplanet':'Animal Planet','Animal Planet':'Animal Planet','bravo':'Bravo','Bravo':'Bravo','whphd':'CBS','CBS':'CBS','cnbc':'CNBC','CNBC':'CNBC','wlyh':'CW','CW':'CW','comedycentral':'Comedy Central','Comedy Central':'Comedy Central','discovery':'Discovery Channel','Discovery Channel':'Discovery Channel','espn':'ESPN','ESPN':'ESPN',
+ 'FOX':'FOX','wpmt':'FOX','fxhd':'FX','FX':'FX','Fox News Channel':'Fox News','foxnews':'Fox News','frfrm':'Freeform','Freeform':'Freeform','msnbc':'MSNBC','MSNBC':'MSNBC','wgal':'NBC','NBC':'NBC','natgeo':'National Geographic','National Geographic Channel':'National Geographic','nickelodeon':'Nickelodeon','Nickelodeon':'Nickelodeon','wpsu':'PBS','PBS':'PBS',
+ 'spiketv':'SPIKE TV','SPIKE TV':'SPIKE TV','sndnc':'SundanceTV','SundanceTV':'SundanceTV','syfy':'Syfy','Syfy':'Syfy','AE':'A&E','My9':'MY9','whvl':'MY9','bbca':'BBC America','BBCA':'BBC America','espntwo':'ESPN 2','ESPN2':'ESPN 2','nbcsnhd':'NBCSN','NBCSNHD':'NBCSN','tlchd':'TLC','The Learning Channel':'TLC','Universal HD':'Universal',
+ 'usahd':'USA Network','USA':'USA Network'}
+
+USTVNOW_MENU = [("Live" , '', 0),
+ ("Schedules" , '', 1),
+ ("Recordings" , '', 2),
+ ("Lineup" , '', 3),
+ ("Movies" , '', 5),
+ ("Highlights", '', 12),
+ ("OnDemand" , '', 13),
+ ("Search" , '', 11),
+ ("Guide" , '', 20)]
+
+# if xbmc.getCondVisibility('System.HasAddon(script.module.uepg)') == 1:
+ # USTVNOW_MENU.append(("uEPG Guide", '', 20))
+
+uEPG_PARAMS = {"runtime":"duration","stream_code":"studio","description":"plot","synopsis":"plotoutline","ut_start":"starttime","orig_air_date":"firstaired"}
+FILE_PARAMS = ["title", "artist", "albumartist", "genre", "year", "rating", "album", "track", "duration", "comment", "lyrics", "musicbrainztrackid", "musicbrainzartistid", "musicbrainzalbumid", "musicbrainzalbumartistid", "playcount", "fanart", "director", "trailer", "tagline", "plot", "plotoutline", "originaltitle", "lastplayed", "writer", "studio", "mpaa", "cast", "country", "imdbnumber", "premiered", "productioncode", "runtime", "set", "showlink", "streamdetails", "top250", "votes", "firstaired", "season", "episode", "showtitle", "thumbnail", "file", "resume", "artistid", "albumid", "tvshowid", "setid", "watchedepisodes", "disc", "tag", "art", "genreid", "displayartist", "albumartistid", "description", "theme", "mood", "style", "albumlabel", "sorttitle", "episodeguide", "uniqueid", "dateadded", "size", "lastmodified", "mimetype", "specialsortseason", "specialsortepisode"]
+PVR_PARAMS = ["title","plot","plotoutline","starttime","endtime","runtime","progress","progresspercentage","genre","episodename","episodenum","episodepart","firstaired","hastimer","isactive","parentalrating","wasactive","thumbnail","rating","originaltitle","cast","director","writer","year","imdbnumber","hastimerrule","hasrecording","recording","isseries"]
+ART_PARAMS = ["thumb","poster","fanart","banner","landscape","clearart","clearlogo"]
+
+def uni(string, encoding = 'utf-8'):
+ if isinstance(string, basestring):
+ if not isinstance(string, unicode):
+ string = unicode(string, encoding)
+ elif isinstance(string, unicode):
+ string = string.encode('ascii', 'replace')
+ return string
+
+def unescape(string):
+ try:
+ parser = HTMLParser.HTMLParser()
+ return (parser.unescape(string))
+ except:
+ return string
+
+def log(msg, level=xbmc.LOGDEBUG):
+ if DEBUG == False and level != xbmc.LOGERROR: return
+ if level == xbmc.LOGERROR: msg += ' ,' + traceback.format_exc()
+ xbmc.log(ADDON_ID + '-' + ADDON_VERSION + '-' + (msg.encode("utf-8")), level)
+
+def inputDialog(heading=ADDON_NAME, default='', key=xbmcgui.INPUT_ALPHANUM, opt=0, close=0):
+ retval = xbmcgui.Dialog().input(heading, default, key, opt, close)
+ if len(retval) > 0:
+ return retval
+
+def okDialog(str1, str2='', str3='', header=ADDON_NAME):
+ xbmcgui.Dialog().ok(header, str1, str2, str3)
+
+def yesnoDialog(str1, str2='', str3='', header=ADDON_NAME, yes='', no='', autoclose=0):
+ return xbmcgui.Dialog().yesno(header, str1, str2, str3, no, yes, autoclose)
+
+def getParams():
+ param=[]
+ if len(sys.argv[2])>=2:
+ params=sys.argv[2]
+ cleanedparams=params.replace('?','')
+ if (params[len(params)-1]=='/'):
+ params=params[0:len(params)-2]
+ pairsofparams=cleanedparams.split('&')
+ param={}
+ for i in range(len(pairsofparams)):
+ splitparams={}
+ splitparams=pairsofparams[i].split('=')
+ if (len(splitparams))==2:
+ param[splitparams[0]]=splitparams[1]
+ return param
+
+socket.setdefaulttimeout(TIMEOUT)
+class USTVnow():
+ def __init__(self):
+ log('__init__')
+ self.net = net.Net()
+ self.cache = SimpleCache()
+ self.isFree = REAL_SETTINGS.getSetting('User_isFree') == "True"
+ if self.login(USER_EMAIL, PASSWORD) == False: raise SystemExit
+
+
+ def mainMenu(self):
+ log('mainMenu')
+ for item in USTVNOW_MENU:
+ self.addDir(*item)
+
+
+ def buildHeader(self):
+ header_dict = {}
+ header_dict['Accept'] = 'application/json, text/javascript, */*; q=0.01'
+ header_dict['Host'] = 'm-api.ustvnow.com'
+ header_dict['Connection'] = 'keep-alive'
+ header_dict['Referer'] = 'http://watch.ustvnow.com'
+ header_dict['Origin'] = 'http://watch.ustvnow.com'
+ header_dict['User-Agent'] = 'Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.127 Large Screen Safari/533.4 GoogleTV/162671'
+ return header_dict
+
+
+ def login(self, user, password):
+ log('login')
+ if len(user) > 0:
+ try: xbmcvfs.rmdir(COOKIE_JAR)
+ except: pass
+
+ if xbmcvfs.exists(COOKIE_JAR) == False:
+ try:
+ xbmcvfs.mkdirs(SETTINGS_LOC)
+ f = xbmcvfs.File(COOKIE_JAR, 'w')
+ f.close()
+ except: log('login, Unable to create the storage directory', xbmc.LOGERROR)
+ header_dict = self.buildHeader()
+ self.net.set_cookies(COOKIE_JAR)
+
+ try:
+ #check token
+ dvrlink = None
+ custlink = json.loads(self.net.http_POST(BASEURL + 'gtv/1/live/getcustomerkey', form_data={'token':LAST_TOKEN}, headers=header_dict).content.encode("utf-8").rstrip())
+ '''{u'username': u'', u'ip': u'', u'customerkey': u''}'''
+ self.custkey = (custlink.get('customerkey','') or 0)
+ if custlink and 'username' in custlink and user.lower() == custlink['username'].lower():
+ log('login, using existing token, passkey')
+ self.token = LAST_TOKEN
+ self.passkey = LAST_PASSKEY
+ else:
+ #login
+ loginlink = json.loads(self.net.http_POST(BASEURL + 'gtv/1/live/login', form_data={'username':user,'password':password,'device':'gtv','redir':'0'}, headers=header_dict).content.encode("utf-8").rstrip())
+ '''{u'token': u'', u'result': u'success'}'''
+ if loginlink and 'token' in loginlink and loginlink['result'].lower() == 'success':
+ log('login, creating new token')
+ self.token = loginlink['token']
+ REAL_SETTINGS.setSetting('User_Token',self.token)
+
+ #passkey
+ dvrlink = json.loads(self.net.http_POST(BASEURL + 'gtv/1/live/viewdvrlist', form_data={'token':self.token}, headers=header_dict).content.encode("utf-8").rstrip())
+ '''{u'globalparams': {u'passkey': u''}, u'results': []}'''
+ if dvrlink and 'globalparams' in dvrlink:
+ log('login, creating new passkey')
+ self.passkey = dvrlink['globalparams']['passkey']
+ REAL_SETTINGS.setSetting('User_Paskey',self.passkey)
+ else: raise Exception
+
+ #check user credentials
+ userlink = json.loads(self.net.http_POST(BASEURL + 'gtv/1/live/getuserbytoken', form_data={'token':self.token}, headers=header_dict).content.encode("utf-8").rstrip())
+ '''{u'status': u'success', u'data': {u'username': u'', u'need_account_activation': False, u'plan_id': 1, u'language': u'en', u'plan_free': 1, u'sub_id': u'7', u'lname': u'', u'currency': u'USD', u'points': 1, u'need_account_renew': False, u'fname': u'', u'plan_name': u'Free Plan'}}'''
+ log('login, checking user account')
+ if userlink and 'data' in userlink and userlink['status'].lower() == 'success':
+ REAL_SETTINGS.setSetting('User_Plan' ,userlink['data']['plan_name'])
+ expires = 'Never' if userlink['data']['plan_name'] == 'Free Plan' else ''
+ REAL_SETTINGS.setSetting('User_Expires' ,'%s'%expires)
+ REAL_SETTINGS.setSetting('User_isFree' ,str(userlink['data']['plan_name'] == 'Free Plan'))
+ dvrPlan = 2 if 'dvr' in (userlink['data']['plan_name']).lower() else None
+ REAL_SETTINGS.setSetting('User_DVRpoints' ,str(dvrPlan or userlink['data']['points'] or 0))
+ xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30006) + userlink['data']['fname'], ICON, 4000)
+
+ if userlink['data']['need_account_renew'] == True:
+ xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30016) + userlink['data']['fname'], ICON, 4000)
+ elif userlink['data']['need_account_activation'] == True:
+ xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30022) + userlink['data']['fname'], ICON, 4000)
+ else:
+ if REAL_SETTINGS.getSetting('User_DVRpoints') != REAL_SETTINGS.getSetting('Last_DVRpoints'):
+ REAL_SETTINGS.setSetting('Last_DVRpoints',REAL_SETTINGS.getSetting('User_DVRpoints'))
+ xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30021) + userlink['data']['fname'], ICON, 4000)
+
+ #check subscription
+ try:
+ #error prone, isolate and debug.
+ sublink = json.loads(self.net.http_POST(BASEURL + 'gtv/1/live/getaccountsubscription', form_data={'username':user,'customerkey':self.custkey}, headers=header_dict).content.encode("utf-8").rstrip())
+ '''{u'username': u'', u'billingDatetime': u'', u'currency': u'USD', u'cgaccountstatusreason': u'', u'invoicehistory': u'', u'ocaccountstatus': u'Account active', u'ccLastFour': u'', u'lname': u'', u'x-cg-acnt-USD': False, u'fname': u'', u'sub_info': {u'cost': 0, u'plan': {u'sub_group': 4, u'plan_id': 1, u'name': u'Free Plan', u'language': u'en', u'date_expire': u'0000-00-00', u'sub_id': 7, u'price': 0, u'currency': u'USD', u'plan_code': u'7_FREETRIAL',
+ u'details': u'This plan lets you receive all major US terrestrial stations (ABC, CBS, CW, FOX, NBC, PBS). You can later upgrade to a paid plan with more channels and DVR.'}, u'packages': []}, u'pendinginvoices': u'', u'cgbillingstatus': u'', u'dvrpoints': 1, u'plans': {u'10': {u'price': 15, u'name': u'1 Week All Channel Plan $15 ($2.14/day)',
+ u'details': u'1 Week pass for all channels (No DVR)'}, u'23': {u'price': 19, u'name': u'All Channel Promo Plan $19/mo first 3 months',
+ u'details': u'Monthly subscription for all channels. This promotional price is for the first three months after which it will renew at $29. This plan automatically renews each month but you can cancel anytime and will not be billed again when your current 30 day period has expired. '}, u'31': {u'price': 29, u'name': u'All Channel Promo Plan w/DVR $29/mo first 3 months',
+ u'details': u'Monthly subscription for all channels. This promotional price is for the first three months after which it will renew at $39. This plan automatically renews each month but you can cancel anytime and will not be billed again when your current 30 day period has expired.'}, u'7': {u'price': 0, u'name': u'Free Plan',
+ u'details': u'This plan lets you receive all major US terrestrial stations (ABC, CBS, CW, FOX, NBC, PBS). You can later upgrade to a paid plan with more channels and DVR.'}, u'9': {u'price': 0.00, u'name': u'3 Day All Channel Plan $6.99 ($2.33/day)',
+ u'details': u'3 Day pass for all channels (No DVR)'}, u'8': {u'price': 2.99, u'name': u'1 Day All Channel Plan $2.99',
+ u'details': u'24 hour pass for all channels (No DVR)'}}, u'cgredirectUrl': u'', u'cgaccountstatus': False, u'isfacebookuser': False, u'cgkey': u'', u'ocaccountstatuscode': 0, u'packages': [], u'subscription': u'Free Plan', u'language': u'en', u'sub_id': u'7', u'dateopened': u'December 01, 2000', u'canceledDatetime': u'', u'cgbillingmethod': u''}'''
+ if sublink: REAL_SETTINGS.setSetting('User_Expires' ,'%s'%(sublink['sub_info']['date_expire']))
+ except: pass
+ else: raise Exception
+ self.net.save_cookies(COOKIE_JAR)
+
+ self.channels = self.cache.get(ADDON_NAME + '.channelguide')
+ if not self.channels:
+ log('login, refreshing channels')
+ channels = sorted(json.loads(self.net.http_POST(BASEURL + 'gtv/1/live/channelguide', form_data={'token':self.token}, headers=header_dict).content.encode("utf-8").rstrip())['results'], key=lambda x: x['displayorder'])
+ '''{u'app_name': u'preview', u'stream': u'00000WXYZustvnow', u'af': u'US', u'dvraction': u'add', u'callsign': u'WHTM', u'event_inprogress': 1,
+ u'srsid': 3560383, u'guideremainingtime': 3660, u'scheduleid': 9952642, u'favoriteaction': u'remove', u'event_time': u'00:00:00',u'title': u'Shark Tank',
+ u'timemark': 1498867200, u'recordedon': u'June 30, 2017 20:00', u'prg_img': u'h3/NowShowing/9977826/p9977826_b1t_h3_aa.jpg', u'title_10': u'',
+ u'xcdrappname': u'livehd', u'event_date': u'2017-07-01', u'has_img': 1, u'stream_code': u'ABC', u'updated': u'2017-06-29 11:49:08',
+ u'description': u'Durable bags made out of the material that protects on the front lines of firefighting; a vibrating mat that helps calm babies;
+ an ointment made from essential oils; a natural snack made with acai.', u'actualremainingtime': 3281, u'content_allowed': False,
+ u'dvrtimeraction': u'add', u'mediatype': u'EP', u'auth': None, u'stream_origin': u'dne.ustvnow.com', u'dvrtimertype': 0, u'scode': u'whtm',
+ u'aksid': 1, u'guideheight': 120, u'orig_air_date': u'2017-02-10', u'prgsvcid': 11534, u'runtime': 3660, u'img': u'images/WHTM.png',
+ u'connectorid': u'SH011581290000', u'ut_start': 1498867200, u'streamname': u'00000WXYZustvnow', u'episode_title': u'', u'synopsis':
+ u'A vibrating mat that helps calm babies.', u't': 1, u'edgetypes': 7, u'imgmark': u'live', u'content_id': u'EP011581290171', u'order': 1,
+ u'displayorder': 1}'''
+ self.cache.set(ADDON_NAME + '.channelguide', channels, expiration=datetime.timedelta(minutes=5))
+ self.channels = self.cache.get(ADDON_NAME + '.channelguide')
+
+ self.upcoming = self.cache.get(ADDON_NAME + '.upcoming')
+ if not self.upcoming:
+ log('login, refreshing upcoming')
+ upcoming = json.loads(self.net.http_POST(BASEURL + 'gtv/1/live/upcoming', form_data={'token':self.token}, headers=header_dict).content.encode("utf-8").rstrip())
+ '''{u'prgschid': 19479379, u'dvraction': u'add', u'callsign': u'AMC', u'newtimecat': True, u'srsid': 14930, u'timecat': u'Today', u'scheduleid': 9946282,
+ u'img': u'images/AMC.png', u'title': u'The Fugitive', u'prg_img': u'v5/NowShowing/14930/p14930_p_v5_aa.jpg', u'has_img': 1, u't': 0, u'sname': u'AMC',
+ u'description': u'U.S. marshal (Tommy Lee Jones) hunts doctor (Harrison Ford) for murder of his wife (Sela Ward).', u'dvrtimeraction': u'add',
+ u'auth': None, u'orig_air_date': None, u'dvrtimertype': 0, u'scode': u'amchd', u'prgsvcid': 10021, u'runtime': 10800, u'connectorid': u'MV000371790000',
+ u'episode_title': u'', u'synopsis': u'An innocent man must evade the law as he pursues a killer.', u'event_inprogress': 1, u'ut_start': 1499009400,
+ u'content_allowed': False, u'imgmark': u'live', u'content_id': u'MV000371790000', u'displayorder': 100}'''
+ self.cache.set(ADDON_NAME + '.upcoming', upcoming, expiration=datetime.timedelta(hours=6))
+ self.upcoming = self.cache.get(ADDON_NAME + '.upcoming')
+
+ self.highlights = self.cache.get(ADDON_NAME + '.highlights')
+ if not self.highlights:
+ log('login, refreshing highlights')
+ highlights = json.loads(self.net.http_POST(BASEURL + 'api/1/live/highlights', form_data={'token':self.token}, headers=header_dict).content.encode("utf-8").rstrip())
+ '''{u'prgschid': 114059791, u'dvraction': u'add', u'bb_content': u'How would you like having Jim Morrison as a college roommate? ', u'callsign': u'WPSU', u'newtimecat': True,
+ u'srsid': 185479, u'timecat': u'Tomorrow', u'scheduleid': 49826153, u'img': u'images/WPSU.png', u'title': u'Antiques Roadshow', u'prg_img': u'h3/NowShowing/185479/p185479_b_h3_ag.jpg',
+ u'has_img': 1, u't': 1, u'sname': u'PBS', u'description': u'A French Art Deco diamond and platinum ring; a copy of &quot;The History of Magic&quot; signed by Jim Morrison; four Rembrandt',
+ u'dvrtimeraction': u'add', u'auth': None, u'orig_air_date': u'2014-02-17', u'dvrtimertype': 0, u'scode': u'wpsu', u'prgsvcid': 11786, u'runtime': 3600, u'connectorid': u'SH002036520000',
+ u'episode_title': u'Baton Rouge', u'synopsis': u'Diamond and platinum ring.', u'event_inprogress': 2, u'ut_start': 1508216400, u'content_allowed': True, u'imgmark': u'', u'content_id':
+ u'EP002036520417', u'displayorder': 6}'''
+ self.cache.set(ADDON_NAME + '.highlights', highlights, expiration=datetime.timedelta(hours=6))
+ self.highlights = self.cache.get(ADDON_NAME + '.highlights')
+
+ self.recorded = self.cache.get(ADDON_NAME + '.recorded')
+ if not self.recorded:
+ log('login, refreshing recorded')
+ '''{u'fn1': u'20170702', u'episode_season': 0, u'filename_smil': u'20170702_213000_220000_utc_SH000000010000_11534_11534_ABC.smil', u'app_name': u'dvrrokuplay',
+ u'stream': u'2F1ECWHTMUSTVNOW', u'imgmark': u'rem', u'dvrtimeraction': u'add', u'mediatype': u'SH', u'orig_air_date': None, u'content_id': u'SH000000010000',
+ u'callsign': u'WHTM', u'ut_expires': 1500327000, u'filename_med': u'20170702_213000_220000_utc_SH000000010000_11534_11534_ABC_650.mp4',
+ u'filename_high': u'20170702_213000_220000_utc_SH000000010000_11534_11534_ABC_950.mp4', u'dvrlocation': u'dvr6', u'episode_number': 0, u'srsid': 459763,
+ u'runtime': 1800, u'description': u'Paid programming.', u'scheduleid': 9952747, u'has_img': 1, u'fn3': u'220000', u'fn2': u'213000',
+ u'event_time': u'21:30:00', u'title': u'Paid Programming', u'recordedonmmddyyyy': u'07/02/2017', u'connectorid': u'SH000000010000',
+ u'recordedon': u'July 2, 2017', u'prg_img': u'h3/NowShowing/459763/p459763_b_h3_ae.jpg', u'filename_low': u'20170702_213000_220000_utc_SH000000010000_11534_11534_ABC_350.mp4',
+ u'episode_title': u'', u'synopsis': u'Paid programming.', u'dvrtimertype': 0, u'content_allowed': True, u'xcdrappname': u'livehd', u'event_date': u'2017-07-02',
+ u'event_inprogress': 2, u'prgsvcid': 11534, u'ut_start': 1499031000, u'stream_code': u'ABC'}'''
+ if dvrlink: recorded = dvrlink['results']
+ else: recorded = (json.loads(self.net.http_POST(BASEURL + 'gtv/1/live/viewdvrlist', form_data={'token':self.token}, headers=header_dict).content.encode("utf-8").rstrip()))['results']
+ self.cache.set(ADDON_NAME + '.recorded', recorded, expiration=datetime.timedelta(minutes=1))
+ self.recorded = self.cache.get(ADDON_NAME + '.recorded')
+ self.names = self.getChannelNames()
+ return True
+ except Exception as e:
+ log('login, Unable to login ' + str(e), xbmc.LOGERROR)
+ REAL_SETTINGS.setSetting('User_Token','')
+ REAL_SETTINGS.setSetting('User_Paskey','')
+ REAL_SETTINGS.setSetting('User_Activated',str(False))
+ xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30007), ICON, 4000)
+ return False
+ else:
+ #firstrun wizard
+ if yesnoDialog(LANGUAGE(30008),no=LANGUAGE(30009), yes=LANGUAGE(30010)):
+ user = inputDialog(LANGUAGE(30001))
+ password = inputDialog(LANGUAGE(30002),opt=xbmcgui.ALPHANUM_HIDE_INPUT)
+ REAL_SETTINGS.setSetting('User_Email' ,user)
+ REAL_SETTINGS.setSetting('User_Password',password)
+ return self.login(user, password)
+ else:
+ okDialog(LANGUAGE(30003))
+ return False
+
+
+ def getChannelNames(self):
+ collect = []
+ if self.channels is None: xbmc.executebuiltin("Container.Refresh")
+ for channel in self.channels:
+ try:
+ name = CHAN_NAMES[channel['stream_code']]
+ if self.isFree == True and name not in FREE_CHANS: continue
+ collect.append(name)
+ except: pass
+ counter = collections.Counter(collect)
+ names = sorted(list(set(sorted(counter.elements()))))
+ log('getChannelNames, names = ' + str(names))
+ return names
+
+
+ def browseLive(self):
+ log('browseLive')
+ d = datetime.datetime.utcnow()
+ now = datetime.datetime.fromtimestamp(calendar.timegm(d.utctimetuple()))
+ if self.channels is None: xbmc.executebuiltin("Container.Refresh")
+ for channel in self.channels:
+ try:
+ name = CHAN_NAMES[channel['stream_code']]
+ if self.isFree == True and name not in FREE_CHANS: continue
+ startime = datetime.datetime.fromtimestamp(channel['ut_start'])
+ endtime = startime + datetime.timedelta(seconds=channel['runtime'])
+ if endtime > now and startime <= now:
+ label, url, liz = self.buildChannelListItem(name, channel, opt='Live')
+ self.addLink(label, url, 9, liz, len(self.channels))
+ except Exception as e:
+ log('browseLive, failed ' + str(e), xbmc.LOGERROR)
+
+
+ def browseRecordings(self, recorded=False):
+ log('browseRecordings')
+ d = datetime.datetime.utcnow()
+ now = datetime.datetime.fromtimestamp(calendar.timegm(d.utctimetuple()))
+ if self.recorded is None: xbmc.executebuiltin("Container.Refresh")
+ for channel in self.recorded:
+ try:
+ startime = datetime.datetime.fromtimestamp(channel['ut_start'])
+ endtime = startime + datetime.timedelta(seconds=channel['runtime'])
+ if recorded == False and channel['event_inprogress'] == 0: continue
+ elif recorded == True and channel['event_inprogress'] != 0: continue
+ label, url, liz = self.buildRecordedListItem(CHAN_NAMES[channel['stream_code']])
+ mode = 10 if recorded == True else 21
+ if mode == 21: liz.setProperty("IsPlayable","false")
+ self.addLink(label, url, mode, liz, len(self.recorded))
+ except Exception as e:
+ log('browseRecordings, failed ' + str(e), xbmc.LOGERROR)
+
+
+ def browseGuide(self, name=None, upcoming=False):
+ log('browseGuide')
+ d = datetime.datetime.utcnow()
+ now = datetime.datetime.fromtimestamp(calendar.timegm(d.utctimetuple()))
+ if self.channels is None: xbmc.executebuiltin("Container.Refresh")
+ if name is None and upcoming == False:
+ for channel in sorted(self.names):
+ icon = (os.path.join(IMG_PATH,'logos','%s.png'%channel) or ICON)
+ infoArt = {"thumb":icon,"poster":icon,"icon":icon,"fanart":FANART}
+ self.addDir(channel, channel, 4, infoArt=infoArt)
+ else:
+ for channel in self.channels:
+ try:
+ if self.isFree == True and name not in FREE_CHANS: continue
+ if name == CHAN_NAMES[channel['stream_code']]:
+ startime = datetime.datetime.fromtimestamp(channel['ut_start'])
+ endtime = startime + datetime.timedelta(seconds=channel['runtime'])
+ if endtime > now and (startime <= now):
+ label, url, liz = self.buildChannelListItem(name, channel)
+ self.addLink(label, url, 9, liz, len(self.channels))
+ elif endtime > now and (startime <= now or startime > now):
+ label, url, liz = self.buildChannelListItem(name, channel)
+ mode = 9 if PTVL_RUN == True else 21
+ if mode == 21: liz.setProperty("IsPlayable","false")
+ self.addLink(label, url, mode, liz, len(self.channels))
+ except Exception as e:
+ log('browseGuide, failed ' + str(e), xbmc.LOGERROR)
+
+
+ def browseFeatured(self, hlt=False):
+ log('browseFeatured')
+ d = datetime.datetime.utcnow()
+ now = datetime.datetime.fromtimestamp(calendar.timegm(d.utctimetuple()))
+ CONTENT_TYPE = 'movies' if not hlt else 'episodes'
+ optLST = self.highlights.get('programs') if hlt else self.upcoming
+ if optLST is None: xbmc.executebuiltin("Container.Refresh")
+ for channel in optLST:
+ try:
+ name = CHAN_NAMES[channel['sname']]
+ startime = datetime.datetime.fromtimestamp(channel['ut_start'])
+ endtime = startime + datetime.timedelta(seconds=channel['runtime'])
+ if endtime > now and (startime <= now or startime > now):
+ label, url, liz = self.buildChannelListItem(name, channel, opt='Featured')
+ liz.setProperty("IsPlayable","false")
+ self.addLink(label, url, 21, liz, len(optLST))
+ except Exception as e:
+ log('browseFeatured, failed ' + str(e), xbmc.LOGERROR)
+
+
+ def browseVOD(self, url=None, limit=24):
+ log('browseVOD')
+ '''
+ {u'paging': {u'current': u'/api/1/live/vod/?role=user&limit=24&status%5B0%5D=5', u'next_query': u'role=user&limit=24&status%5B0%5D=5&page=4954', u'next': u'/api/1/live/vod/?role=user&limit=24&status%5B0%5D=5&page=4954'},
+ u'data': [{u'rented': None, u'ratings': [{u'description': u'', u'id': 12585970, u'name': u'TV-Y'}], u'scheduleid': u'V4954', u'description': u"HORSELAND: FIRST LOVE - Tomboyish Alma has a crush on a boy. Chloe . (CC)",
+ u'language': u'en', u'title': u'Horseland: First Love', u'content_allowed': False, u'price': u'0.99', u'created': 1493301489, u'genres': [], u'licensing_start': 1494475260, u'slug': u'V4954', u'director': None,
+ u'closed_caption': True, u'rent_due': 2, u'actors': [{u'lname': u'Donlan', u'id': 30781624, u'fname': u'Dana'}, {u'lname': u'Hernandez', u'id': 30781625, u'fname': u'Emily'}, {u'lname': u'Heyward', u'id': 30781626, u'fname':
+ u'Bianca'}], u'year': 2006, u'images': {u'posters': {u'small': u'/V4954/USTVNOW/mv/small', u'large': u'/V4954/USTVNOW/mv/large', u'medium': u'/V4954/USTVNOW/mv/medium'}}, u'runtime': u'00:21:15', u'id': 4954,
+ u'licensing_end': 1499745540}]}
+ '''
+ if url is None: url = BASEWEB + '/vod/all-items'
+ items = self.net._json(url, form_data={'limit':limit,'token':self.token})
+ if items and len(items) > 0:
+ label = '[B]%s[/B]'%LANGUAGE(30029)
+ liz = xbmcgui.ListItem(label)
+ liz.setArt({"thumb":ICON,"poster":ICON,"fanart":FANART})
+ self.addLink(label, '', 22, liz, len(items))
+ next = (items.get('paging','').get('next','') or '')
+ for item in items['data']:
+ label, url, liz = self.buildVODListItem(item)
+ liz.setProperty("IsPlayable","true")
+ liz.addContextMenuItems([('Purchase','')])
+ self.addLink(label, url, 22, liz, len(items))
+ # self.addDir('>> Next', BASEWEB + next, 13)
+
+
+ def search(self):
+ log('search')
+ kb = xbmc.Keyboard('', LANGUAGE(30027)%ADDON_NAME)
+ xbmc.sleep(1000)
+ kb.doModal()
+ if kb.isConfirmed():
+ try:
+ query = kb.getText()
+ items = json.loads(self.net.http_POST(BASEURL + 'gtv/1/live/search', form_data={'token':self.token,'q_title':query}, headers=self.buildHeader()).content.encode("utf-8").rstrip())['results']['programs']
+ for channel in items:
+ try:
+ name = CHAN_NAMES[channel['progs']['scode']]
+ label, url, liz = self.buildChannelListItem(name, channel['progs'], opt='Search')
+ liz.setProperty("IsPlayable","false")
+ self.addLink(label, url, 21, liz, len(items))
+ except Exception as e:
+ log('search, error ' + str(e), xbmc.LOGERROR)
+ if len(items) == 0:
+ label = LANGUAGE(30028)%query
+ liz = xbmcgui.ListItem(label)
+ liz.setArt({"thumb":ICON,"poster":ICON,"fanart":FANART})
+ self.addLink(label, '', 0, liz, 1)
+ except Exception as e:
+ log('search, failed ' + str(e), xbmc.LOGERROR)
+ else: self.mainMenu()
+
+
+ def buildVODListItem(self, item):
+ url = ''
+ title = unescape(item['title'])
+ price = item['price']
+ year = item['year']
+ h, m, s = item['runtime'].split(':')
+ runtime = int(h) * 3600 + int(m) * 60 + int(s)
+ label = '%s ($%s)'%(title,price)
+ label2 = item['price']
+ plot = unescape(item['description'])
+ liz = xbmcgui.ListItem(label)
+ thumb = IMG_BASE + item['images']['posters']['large']
+ infoList = {"mediatype":'movie',"label":label,"label2":label2,"title":label,"duration":runtime,"plot":plot}
+ liz.setInfo(type="Video", infoLabels=infoList)
+ liz.setArt({"thumb":thumb,"poster":thumb,"fanart":FANART})
+ liz.setProperty("IsPlayable","true")
+ liz.setProperty("IsInternetStream","true")
+ log('buildVODListItem, label = ' + label + ', url = ' + url)
+ return label, url, liz
+
+
+ def buildChannelListItem(self, name, channel=None, opt=''):
+ if channel is None:
+ for idx, channel in enumerate(self.channels):
+ if name == CHAN_NAMES[channel['stream_code']]: break
+ startime = datetime.datetime.fromtimestamp(channel['ut_start'])
+ endtime = startime + datetime.timedelta(seconds=channel['runtime'])
+ title = unescape(channel['title'])
+ mediatype = (channel.get('mediatype','') or (channel.get('connectorid',''))[:2] or (channel.get('content_id',''))[:2] or 'SP')
+ mtype = MEDIA_TYPES[mediatype.upper()]
+ label = name if PTVL_RUN == True else '%s: %s - %s'%(startime.strftime('%I:%M %p').lstrip('0'),name,title)
+ label = '%s - %s'%(name,title) if opt == 'Live' else label
+ label2 = '%s - %s'%(startime.strftime('%I:%M %p').lstrip('0'),endtime.strftime('%I:%M %p').lstrip('0'))
+ url = name
+ liz = xbmcgui.ListItem(label)
+ thumb = IMG_SOURCE%(str(channel['srsid']),channel['callsign'],mediatype)
+ thumb = thumb + '/snapshot' if opt == 'Live' else thumb
+ poster = (os.path.join(IMG_PATH,'%s.png'%name) or ICON)
+ logo = IMG_CHLOGO%(channel['callsign'])
+ tag = ''#urllib.quote(json.dumps({"channelname":name,"channelnumber":self.names.index(name)+1,"channellogo":logo,"label":title,"label2":self.isHD(),"starttime":channel['ut_start']}))
+ infoList = {"mediatype":'episode',"label":label,"label2":label2,"title":label,"tagline":tag,
+ "studio":name,"duration":channel['runtime'],"plotoutline":unescape(channel.get('synopsis','')),
+ "plot":unescape(channel['description']),"aired":startime.strftime('%Y-%m-%d')}
+ liz.setInfo(type="Video", infoLabels=infoList)
+ liz.setArt({"thumb":thumb,"poster":thumb,"fanart":FANART,"clearlogo":logo})
+ liz.setProperty("IsPlayable","true")
+ liz.setProperty("IsInternetStream","true")
+ if channel['dvrtimeraction'] == 'add':
+ opt = '@'.join([str(channel['prgsvcid']),(channel.get('event_time','') or str(channel.get('ut_start','')))])#lazy solution rather then create additional url parameters for this single function.
+ contextMenu = [('Set single recording' ,'XBMC.RunPlugin(%s)'%(sys.argv[0]+"?url="+urllib.quote(str(channel['scheduleid']))+"&mode="+str(6)+"&name="+urllib.quote(opt))),
+ ('Set recurring recording','XBMC.RunPlugin(%s)'%(sys.argv[0]+"?url="+urllib.quote(str(channel['connectorid']))+"&mode="+str(7)+"&name="+urllib.quote(opt)))]
+ else:
+ contextMenu = [('Remove recording','XBMC.RunPlugin(%s)'%(sys.argv[0]+"?url="+urllib.quote(str(channel['scheduleid']))+"&mode="+str(8)+"&name="+urllib.quote(name)))]
+ liz.addContextMenuItems(contextMenu)
+ log('buildChannelListItem, label = ' + label + ', url = ' + url)
+ return label, url, liz
+
+
+ def buildRecordedListItem(self, name):
+ for channel in self.recorded:
+ if name == CHAN_NAMES[channel['stream_code']] or name == str(channel['scheduleid']):
+ startime = datetime.datetime.fromtimestamp(channel['ut_start'])
+ endtime = startime + datetime.timedelta(seconds=channel['runtime'])
+ title = unescape(channel['title'])
+ label = '%s - %s: %s - %s'%(startime.strftime('%Y-%m-%d'),startime.strftime('%I:%M %p').lstrip('0'),name,title)
+ label2 = '%s-%s'%(startime.strftime('%I:%M %p').lstrip('0'),endtime.strftime('%I:%M %p').lstrip('0'))
+ url = str(channel['scheduleid'])
+ liz = xbmcgui.ListItem(label)
+ mediatype = (channel.get('mediatype','') or (channel.get('connectorid',''))[:2] or (channel.get('content_id',''))[:2] or 'SP')
+ mtype = MEDIA_TYPES[mediatype.upper()]
+ infoList = {"mediatype":mtype,"label":label,"label2":label2,"title":label,"studio":CHAN_NAMES[channel['stream_code']],
+ "duration":channel['runtime'],"plotoutline":unescape(channel['synopsis']),"plot":unescape(channel['description']),
+ "aired":startime.strftime('%Y-%m-%d')}
+ thumb = IMG_SOURCE%(str(channel['srsid']),channel['callsign'],mediatype)
+ liz.setInfo(type="Video", infoLabels=infoList)
+ liz.setArt({"thumb":thumb,"poster":thumb,"fanart":FANART})
+ liz.setProperty("IsPlayable","true")
+ liz.setProperty("IsInternetStream","true")
+ contextMenu = []
+ # if channel['dvrtimeraction'] == 'add':
+ # opt = '@'.join([str(channel['prgsvcid']),channel['event_time']])#lazy solution rather then create additional url parameters for this single function.
+ # contextMenu = [('Set single recording' ,'XBMC.RunPlugin(%s)'%(sys.argv[0]+"?url="+urllib.quote(str(channel['scheduleid']))+"&mode="+str(6)+"&name="+urllib.quote(opt))),
+ # ('Set recurring recording','XBMC.RunPlugin(%s)'%(sys.argv[0]+"?url="+urllib.quote(str(channel['connectorid']))+"&mode="+str(7)+"&name="+urllib.quote(opt)))]
+ contextMenu.extend([('Remove recording','XBMC.RunPlugin(%s)'%(sys.argv[0]+"?url="+urllib.quote(str(channel['scheduleid']))+"&mode="+str(8)+"&name="+urllib.quote(name)))])
+ liz.addContextMenuItems(contextMenu)
+ log('buildRecordedListItem, label = ' + label + ', url = ' + url)
+ return label, url, liz
+
+
+ def resolveURL(self, url, dvr=False):
+ log('resolveURL, url = ' + url + ', dvr = ' + str(dvr))
+ if dvr:
+ for channel in self.recorded:
+ if url == str(channel['scheduleid']):
+ try:
+ urllink = json.loads(self.net.http_POST(BASEURL + 'stream/1/dvr/play', form_data={'token':self.token,'key':self.passkey,'scheduleid':channel['scheduleid']}, headers=self.buildHeader()).content.encode("utf-8").rstrip())
+ '''{u'pr': u'll', u'domain': u'ilvc02.ll.ustvnow.com',u'stream': u'http://ilvc02.ll.ustvnow.com/ilv10/pr/xxl/smil:0B64AWHTMUSTVNOW/playlist.m3u8?',
+ u'streamname': u'0B64AWHTMUSTVNOW', u'tr': u'', u'up': 1, u'pd': 0, u'pl': u'vjs'}'''
+ stream = urllink['stream']
+ # if URL_TYPE == 'm3u8': stream = urllink['stream']
+ # else: stream = (urllink['stream'].replace('smil:','mp4:').replace('USTVNOW','USTVNOW%d'%URL_QUALITY))
+ log('resolveURL, url = ' + stream)
+ return stream
+ except Exception as e:
+ if channel and channel['scheduleid']:
+ self.replaceToken(url, dvr)
+ else:
+ for channel in self.channels:
+ if url == CHAN_NAMES[channel['stream_code']]:
+ try:
+ urllink = json.loads(self.net.http_POST(BASEURL + 'stream/1/live/view', form_data={'token':self.token,'key':self.passkey,'scode':channel['scode']}, headers=self.buildHeader()).content.encode("utf-8").rstrip())
+ '''{u'pr': u'll', u'domain': u'ilvc02.ll.ustvnow.com',u'stream': u'http://ilvc02.ll.ustvnow.com/ilv10/pr/xxl/smil:0B64AWHTMUSTVNOW/playlist.m3u8?',
+ u'streamname': u'0B64AWHTMUSTVNOW', u'tr': u'', u'up': 1, u'pd': 0, u'pl': u'vjs'}'''
+ if URL_TYPE == 'm3u8': stream = urllink['stream']
+ else: stream = (urllink['stream'].replace('smil:','mp4:').replace('USTVNOW','USTVNOW%d'%URL_QUALITY))
+ log('resolveURL, stream = ' + stream)
+ return stream
+ except Exception as e:
+ if channel and channel['scode']:
+ self.replaceToken(url, dvr)
+
+
+ def replaceToken(self, url, dvr):
+ #generate alternative token using website endpoint rather then googletv.
+ try:
+ #get CSRF Token
+ response = urllib2.urlopen(BASEWEB + "/account/signin").read()
+ CSRF = re.findall(r'var csrf_value = "(.*?)"', response, re.DOTALL)[0]
+ #get WEB Token
+ response = (self.net.http_POST(BASEWEB + '/account/login', form_data={'csrf_ustvnow': CSRF, 'signin_email': USER_EMAIL, 'signin_password':PASSWORD, 'signin_remember':'1'}).content.encode("utf-8").rstrip())
+ altToken = re.findall(r'var token(.*?)= "(.*?)";', response, re.DOTALL)[0][1]
+ if altToken and altToken != 'null':
+ self.token = altToken
+ log('replaceToken, replacing existing token')
+ REAL_SETTINGS.setSetting('User_Token',altToken)
+ self.resolveURL(url, dvr)
+ except Exception as e:
+ log('replaceToken, Unable to login ' + str(e), xbmc.LOGERROR)
+ xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30005), ICON, 4000)
+ raise SystemExit
+
+
+ def setRecording(self, name, url, remove=False, recurring=False):
+ log('setRecording, name = ' + name + ', url = ' + url + ', remove = ' + str(remove))
+ if remove == True:
+ setlink = (self.net.http_POST(BASEURL + 'gtv/1/dvr/updatedvr', form_data={'scheduleid':url,'token':self.token,'action':'remove'}, headers=self.buildHeader()).content.encode("utf-8").rstrip())
+ else:
+ if int(REAL_SETTINGS.getSetting('User_DVRpoints')) <= 1:
+ xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30019), ICON, 4000)
+ return
+ opt = name.split('@')#lazy solution rather then create additional url parameters for this single function.
+ if recurring == True:
+ setlink = (self.net.http_POST(BASEURL + 'gtv/1/dvr/updatedvrtimer', form_data={'connectorid':url,'prgsvcid':opt[0],'eventtime':opt[1],'token':self.token,'action':'add'}, headers=self.buildHeader()).content.encode("utf-8").rstrip())
+ else:
+ setlink = (self.net.http_POST(BASEURL + 'gtv/1/dvr/updatedvr' , form_data={'scheduleid':url,'token':self.token,'action':'add'}, headers=self.buildHeader()).content.encode("utf-8").rstrip())
+ '''<result><status>failure</status><action>add</action></result>'''
+ action = re.findall(r'<action>(.*?)</action>', setlink, re.DOTALL)[0]
+ status = re.findall(r'<status>(.*?)</status>', setlink, re.DOTALL)[0]
+ log('setRecording, action = ' + action + ', status = ' + status)
+ if status == 'failure':
+ log('setRecording, setlink = ' + str(setlink), xbmc.LOGERROR)
+ xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30023)%action.title(), ICON, 4000)
+ return
+ self.cache.set(ADDON_NAME + '.recorded', None, expiration=datetime.timedelta(seconds=1))
+ xbmcgui.Dialog().notification(ADDON_NAME, LANGUAGE(30024)%action.title(), ICON, 4000)
+ # xbmc.sleep(1001)
+ # xbmc.executebuiltin("Container.Update(plugin://plugin.video.ustvnow/?mode=1)")
+ # xbmc.executebuiltin("Container.Update(plugin://plugin.video.ustvnow/?mode=2)")
+
+
+ def playVideo(self, url, dvr=False):
+ log('playVideo, url = ' + url + ', dvr = ' + str(dvr))
+ if dvr: label, path, liz = self.buildRecordedListItem(url)
+ else: label, path, liz = self.buildChannelListItem(url, opt='Live')
+ liz.setPath(self.resolveURL(url,dvr))
+ xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
+
+
+ def addLink(self, name, u, mode, liz, total=0):
+ log('addLink, name = ' + name)
+ u=sys.argv[0]+"?url="+urllib.quote(u)+"&mode="+str(mode)+"&name="+urllib.quote(uni(name))
+ xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,totalItems=total)
+
+
+ def addDir(self, name, u, mode, infoList=False, infoArt=False):
+ log('addDir, name = ' + name)
+ liz=xbmcgui.ListItem(name)
+ liz.setProperty('IsPlayable', 'false')
+ if infoList == False: liz.setInfo(type="Video", infoLabels={"mediatype":"video","label":name,"title":name} )
+ else: liz.setInfo(type="Video", infoLabels=infoList)
+ if infoArt == False: liz.setArt({'thumb':ICON,'fanart':FANART})
+ else: liz.setArt(infoArt)
+ u=sys.argv[0]+"?url="+urllib.quote(u)+"&mode="+str(mode)+"&name="+urllib.quote(uni(name))
+ xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
+
+
+ def isHD(self):
+ if URL_TYPE == 'm3u8': return 'HD'
+ elif URL_QUALITY > 2: return 'HD'
+ return ''
+
+
+ def hasCC(self):
+ if URL_TYPE == 'm3u8': return True
+ return False
+
+
+ def uEPG(self):
+ log('uEPG')
+ #support for upcoming uEPG universal epg framework module, module will be available from the Kodi repository.
+ #https://github.com/Lunatixz/XBMC_Addons/tree/master/script.module.uepg
+ collect = []
+ if self.channels is None: xbmc.executebuiltin("Container.Refresh")
+ for channel in self.channels:
+ try:
+ name = CHAN_NAMES[channel['stream_code']]
+ if self.isFree == True and name not in FREE_CHANS: continue
+ collect.append(name)
+ except: pass
+
+ channelNum = 0
+ counter = collections.Counter(collect)
+ for key, value in sorted(counter.iteritems()):
+ newChannel = {}
+ guidedata = []
+ channelName = key
+ channelNum = channelNum + 1
+ isHD = self.isHD()
+ hasCC = self.hasCC()
+ newChannel['channelname'] = channelName
+ newChannel['channelnumber'] = channelNum
+ for channel in self.channels:
+ try:
+ name = CHAN_NAMES[channel['stream_code']]
+ if self.isFree == True and name not in FREE_CHANS: continue
+ if name == channelName:
+ tmpdata = {}
+ mediatype = (channel.get('mediatype','') or (channel.get('connectorid',''))[:2] or (channel.get('content_id',''))[:2] or 'SP')
+ mtype = MEDIA_TYPES[mediatype.upper()]
+ thumb = IMG_SOURCE%(str(channel['srsid']),channel['callsign'],mediatype)
+ poster = thumb if mediatype.lower() == 'mv' else ''
+ logo = IMG_CHLOGO_W%(channel['callsign'])
+ newChannel['channellogo'] = logo
+
+ for key, value in channel.iteritems():
+ try:
+ tmpdata[uEPG_PARAMS[key]] = unescape(value)
+ except:
+ if key in FILE_PARAMS + PVR_PARAMS:
+ tmpdata[key] = unescape(value)
+
+ # contextMenu = [('Schedules' ,'XBMC.RunPlugin(%s)'%(sys.argv[0]+"?mode="+str(1))),
+ # ('Recordings','XBMC.RunPlugin(%s)'%(sys.argv[0]+"?mode="+str(2))),
+ # ('OnDemand' ,'XBMC.RunPlugin(%s)'%(sys.argv[0]+"?mode="+str(13)))]
+
+ contextMenu = []
+ if channel['dvrtimeraction'] == 'add':
+ opt = '@'.join([str(channel['prgsvcid']),(channel.get('event_time','') or str(channel.get('ut_start','')))])#lazy solution rather then create additional url parameters for this single function.
+ contextMenu.append(('Set single recording' ,'XBMC.RunPlugin(%s)'%(sys.argv[0]+"?url="+urllib.quote(str(channel['scheduleid']))+"&mode="+str(6)+"&name="+urllib.quote(opt))))
+ contextMenu.append(('Set recurring recording','XBMC.RunPlugin(%s)'%(sys.argv[0]+"?url="+urllib.quote(str(channel['connectorid']))+"&mode="+str(7)+"&name="+urllib.quote(opt))))
+ else:
+ contextMenu.append(('Remove recording','XBMC.RunPlugin(%s)'%(sys.argv[0]+"?url="+urllib.quote(str(channel['scheduleid']))+"&mode="+str(8)+"&name="+urllib.quote(name))))
+
+ isNew = False #todo parse startime and data
+ label2 = isHD
+ tags = {'isHD':isHD,'hasCC':hasCC,'isNew':isNew}
+ tmpdata['label'] = unescape(channel['title'])
+ tmpdata['label2'] = label2
+ # tmpdata['tagline'] = json.dumps(tags)
+ tmpdata['art'] = {"thumb":thumb,"poster":poster,"clearlogo":logo}
+ tmpdata['mediatype'] = mtype
+ tmpdata['url'] = sys.argv[0]+'?mode=9&url=%s'%name
+ tmpdata['contextmenu'] = json.dumps(contextMenu)
+ guidedata.append(tmpdata)
+ except: pass
+ newChannel['guidedata'] = guidedata
+ yield newChannel
+
+params=getParams()
+try: url=urllib.unquote(params["url"])
+except: url=None
+try: name=urllib.unquote(params["name"])
+except: name=None
+try: mode=int(params["mode"])
+except: mode=None
+
+log("Mode: "+str(mode))
+log("URL : "+str(url))
+log("Name: "+str(name))
+
+if mode==None: USTVnow().mainMenu()
+elif mode == 0: USTVnow().browseLive()
+elif mode == 1: USTVnow().browseRecordings()
+elif mode == 2: USTVnow().browseRecordings(recorded=True)
+elif mode == 3: USTVnow().browseGuide()
+elif mode == 4: USTVnow().browseGuide(name)
+elif mode == 5: USTVnow().browseFeatured()
+elif mode == 6: USTVnow().setRecording(name,url)
+elif mode == 7: USTVnow().setRecording(name,url,recurring=True)
+elif mode == 8: USTVnow().setRecording(name,url,remove=True)
+elif mode == 9: USTVnow().playVideo(url)
+elif mode == 10:USTVnow().playVideo(url,dvr=True)
+elif mode == 11:USTVnow().search()
+elif mode == 12: USTVnow().browseFeatured(True)
+elif mode == 13:USTVnow().browseVOD(url)
+elif mode == 19:xbmc.executebuiltin("RunScript(script.module.uepg,listitem=%s&skin_path=%s&refresh_path=%s&refresh_interval=%s&row_count=%s)"%(urllib.quote(sys.argv[0]+"?mode=3"),urllib.quote(json.dumps(ADDON_PATH)),urllib.quote(json.dumps(sys.argv[0]+"?mode=19")),urllib.quote(json.dumps("7200")),urllib.quote(json.dumps("7"))))
+elif mode == 20:xbmc.executebuiltin("RunScript(script.module.uepg,json=%s&skin_path=%s&refresh_path=%s&refresh_interval=%s&row_count=%s)"%(urllib.quote(json.dumps(list(USTVnow().uEPG()))),urllib.quote(json.dumps(ADDON_PATH)),urllib.quote(json.dumps(sys.argv[0]+"?mode=20")),urllib.quote(json.dumps("7200")),urllib.quote(json.dumps("7"))))
+elif mode == 21:xbmc.executebuiltin("action(ContextMenu)")
+
+xbmcplugin.setContent(int(sys.argv[1]) , CONTENT_TYPE)
+xbmcplugin.addSortMethod(int(sys.argv[1]) , xbmcplugin.SORT_METHOD_UNSORTED)
+xbmcplugin.addSortMethod(int(sys.argv[1]) , xbmcplugin.SORT_METHOD_NONE)
+xbmcplugin.addSortMethod(int(sys.argv[1]) , xbmcplugin.SORT_METHOD_LABEL)
+xbmcplugin.addSortMethod(int(sys.argv[1]) , xbmcplugin.SORT_METHOD_TITLE)
+xbmcplugin.endOfDirectory(int(sys.argv[1]), cacheToDisc=True) \ No newline at end of file
diff --git a/plugin.video.ustvnow/resources/settings.xml b/plugin.video.ustvnow/resources/settings.xml
index 66f133f..51b30b1 100644
--- a/plugin.video.ustvnow/resources/settings.xml
+++ b/plugin.video.ustvnow/resources/settings.xml
@@ -2,10 +2,12 @@
<settings>
<setting id="Enable_Debugging" type="bool" label="30000" default="false" />
<setting id="User_Email" type="text" label="30001" default="" />
- <setting id="User_Password" type="text" label="30002" default="" option="hidden"/>
+ <setting id="User_Password" type="text" label="30002" default="" option="hidden"/>
+ <setting id="URL_Type" type="enum" label="30025" default="0" values="M3U8|MP4" />
+ <setting id="URL_Quality" type="enum" label="30026" default="1" values="Low|Medium|High" visible="eq(-1,1)" subsetting="true"/>
<setting type="lsep" label="30017"/>
- <setting id="User_Plan" type="text" label="30020" default="" enable="false"/>
- <setting id="User_Expires" type="text" label="30018" default="" enable="false"/>
- <setting id="User_Token" type="text" label="30002" default="" visible="false"/>
- <setting id="User_Paskey" type="text" label="30002" default="" visible="false"/>
+ <setting id="User_Plan" type="text" label="30020" default="" enable="false"/>
+ <setting id="User_Expires" type="text" label="30018" default="" enable="false"/>
+ <setting id="User_Token" type="text" label="30002" default="" visible="false"/>
+ <setting id="User_Paskey" type="text" label="30002" default="" visible="false"/>
</settings>
diff --git a/plugin.video.ustvnow/resources/skins/default/1080i/script.module.uepg.guide.xml b/plugin.video.ustvnow/resources/skins/default/1080i/script.module.uepg.guide.xml
new file mode 100644
index 0000000..2295767
--- /dev/null
+++ b/plugin.video.ustvnow/resources/skins/default/1080i/script.module.uepg.guide.xml
@@ -0,0 +1,673 @@
+<?xml version="1.0" encoding="utf-8"?>
+<window>
+ <allowoverlay>no</allowoverlay>
+ <depth>2</depth>
+ <zorder>2</zorder>
+ <coordinates>
+ <left>0</left>
+ <top>0</top>
+ </coordinates>
+ <onload>SetProperty(uEPG.timeCount,3,10000)</onload>
+ <onload>SetProperty(uEPG.textColor,0xFFFFFFFF,10000)</onload>
+ <onload>SetProperty(uEPG.disabledColor,0xFFFFFFFF,10000)</onload>
+ <onload>SetProperty(uEPG.focusedColor,0xFFFFFFFF,10000)</onload>
+ <onload>SetProperty(uEPG.shadowColor,0xFF000000,10000)</onload>
+ <onload>SetProperty(uEPG.pastColor,0xFFFFFFFF,10000)</onload>
+ <onload>SetProperty(uEPG.timeColor,0xFFFFFFFF,10000)</onload>
+ <onload>SetProperty(uEPG.textFont,font12,10000)</onload>
+ <onload>SetProperty(uEPGGuide,True,10000)</onload>
+ <onunload>SetProperty(uEPGGuide,False,10000)</onunload>
+ <animation effect="fade" start="0" end="100" time="100">WindowOpen</animation>
+ <animation effect="fade" start="100" end="0" time="100">WindowClose</animation>
+ <controls>
+ <control type="image">
+ <width>1920</width>
+ <height>1080</height>
+ <texture>Splash.png</texture>
+ <animation effect="fade" start="25" end="25" condition="True">Conditional</animation>
+ </control>
+ <control type="image">
+ <width>1920</width>
+ <height>1080</height>
+ <texture>Background.png</texture>
+ <animation effect="fade" start="85" end="85" condition="True">Conditional</animation>
+ </control>
+ <control type="image">
+ <width>1920</width>
+ <height>1080</height>
+ <texture colordiffuse="FF000000">Overlay.png</texture>
+ <animation effect="fade" start="15" end="15" condition="True">Conditional</animation>
+ </control>
+ <control type="image">
+ <description>Artwork</description>
+ <left>1660</left>
+ <top>0</top>
+ <width>200</width>
+ <height>200</height>
+ <!-- <visible>!Control.HasFocus(40001)</visible> -->
+ <aspectratio scalediffuse="true" align="center" aligny="center">keep</aspectratio>
+ <texture fallback="" background="true">USTVnow.png</texture>
+ </control>
+ <control type="fixedlist" id="40000">
+ <itemlayout width="0" height="0">
+ </itemlayout>
+ <focusedlayout height="0" width="0">
+ </focusedlayout>
+ </control>
+ <control type="group">
+ <left>25</left>
+ <top>2</top>
+ <width>1848</width>
+ <height>500</height>
+ <!-- <visible>!Control.HasFocus(40001)</visible> -->
+ <control type="image">
+ <description>Artwork</description>
+ <left>10</left>
+ <top>105</top>
+ <width>375</width>
+ <height>260</height>
+ <aspectratio scalediffuse="true" align="center" aligny="center">stretch</aspectratio>
+ <texture fallback="fanart.png" background="true">$INFO[Container(40000).ListItem.Art(thumb)]</texture>
+ <animation effect="fade" time="100">VisibleChange</animation>
+ <visible>!Player.Playing</visible>
+ </control>
+ <control type="image">
+ <description>Artwork</description>
+ <left>10</left>
+ <top>105</top>
+ <width>375</width>
+ <height>260</height>
+ <aspectratio scalediffuse="true" align="center" aligny="center">stretch</aspectratio>
+ <texture>blur.png</texture>
+ <animation effect="fade" start="85" end="85" condition="True">Conditional</animation>
+ <visible>[!Player.Playing + !String.IsEmpty(Container(40000).ListItem.Art(poster))]</visible>
+ </control>
+ <control type="image">
+ <description>Artwork</description>
+ <left>10</left>
+ <top>105</top>
+ <width>375</width>
+ <height>260</height>
+ <aspectratio scalediffuse="true" align="center" aligny="center">keep</aspectratio>
+ <texture background="true">$INFO[Container(40000).ListItem.Art(poster)]</texture>
+ <animation effect="fade" time="100">VisibleChange</animation>
+ <visible>[!Player.Playing + !String.IsEmpty(Container(40000).ListItem.Art(poster))]</visible>
+ </control>
+ <control type="videowindow">
+ <description>VideoWindow</description>
+ <left>10</left>
+ <top>85</top>
+ <width>375</width>
+ <height>260</height>
+ </control>
+ <control type="label">
+ <description>Show Info</description>
+ <left>411</left>
+ <top>105</top>
+ <width>1468</width>
+ <height>40</height>
+ <font>font60</font>
+ <textcolor>FFFFFFFF</textcolor>
+ <shadowcolor>ff000000</shadowcolor>
+ <aligny>center</aligny>
+ <align>left</align>
+ <label>$INFO[Container(40000).ListItem.Title]</label>
+ </control>
+ <control type="grouplist">
+ <left>405</left>
+ <top>180</top>
+ <itemgap>1</itemgap>
+ <orientation>horizontal</orientation>
+ <control type="image">
+ <width>100</width>
+ <height>40</height>
+ <aspectratio scalediffuse="true" align="center" aligny="center">keep</aspectratio>
+ <texture colordiffuse="FFFF2042">Live.png</texture>
+ <animation effect="fade" time="100">VisibleChange</animation>
+ </control>
+ <control type="image">
+ <width>90</width>
+ <height>40</height>
+ <aspectratio scalediffuse="true" align="center" aligny="center">keep</aspectratio>
+ <texture colordiffuse="C0C0C0C0">CC.png</texture>
+ <animation effect="fade" time="100">VisibleChange</animation>
+ </control>
+ <control type="image">
+ <width>90</width>
+ <height>40</height>
+ <aspectratio scalediffuse="true" align="center" aligny="center">keep</aspectratio>
+ <texture fallback="" background="true">$INFO[Container(40000).ListItem.Art(clearlogo)]</texture>
+ <animation effect="fade" time="100">VisibleChange</animation>
+ </control>
+ </control>
+ <control type="label">
+ <description>Show Info</description>
+ <left>411</left>
+ <top>235</top>
+ <width>1400</width>
+ <height>250</height>
+ <font>font30</font>
+ <textcolor>FFFFFFFF</textcolor>
+ <shadowcolor>FF000000</shadowcolor>
+ <aligny>top</aligny>
+ <align>left</align>
+ <scroll>true</scroll>
+ <wrapmultiline>true</wrapmultiline>
+ <scrollspeed>50</scrollspeed>
+ <scrollsuffix> - </scrollsuffix>
+ <label>$INFO[Container(40000).ListItem..plot]</label>
+ </control>
+ </control>
+ <control type="group">
+ <left>0</left>
+ <top>350</top>
+ <control type="group">
+ <left>0</left>
+ <top>110</top>
+ <control type="image">
+ <left>35</left>
+ <top>2</top>
+ <width>1848</width>
+ <height>40</height>
+ <texture>Bar.png</texture>
+ </control>
+ <control type="image">
+ <left>35</left>
+ <top>42</top>
+ <width>1848</width>
+ <height>40</height>
+ <texture>Lines.png</texture>
+ </control>
+ <control type="label" id="33005">
+ <description>Date Label</description>
+ <left>45</left>
+ <width min="162" max="400">auto</width>
+ <height>38</height>
+ <align>left</align>
+ <aligny>center</aligny>
+ <font>font12</font>
+ <textcolor>FFFFFFFF</textcolor>
+ </control>
+ <control type="label" id="33007">
+ <description>Timebar Current Time Button</description>
+ <left>420</left>
+ <width min="155" max="200">auto</width>
+ <height>38</height>
+ <fadetime>250</fadetime>
+ <textcolor>FFFFFFFF</textcolor>
+ <font>font12</font>
+ <align>center</align>
+ <aligny>center</aligny>
+ </control>
+ <control type="label" id="33101">
+ <description>Time Label</description>
+ <left>405</left>
+ <width min="155" max="200">auto</width>
+ <height>38</height>
+ <label>Time 1</label>
+ <font>font12</font>
+ <align>left</align>
+ <aligny>center</aligny>
+ <textcolor>FFFFFFFF</textcolor>
+ </control>
+ <control type="label" id="33102">
+ <description>Time Label</description>
+ <left>895</left>
+ <width min="155" max="200">auto</width>
+ <height>38</height>
+ <label>Time 2</label>
+ <font>font12</font>
+ <align>left</align>
+ <aligny>center</aligny>
+ <textcolor>FFFFFFFF</textcolor>
+ </control>
+ <control type="label" id="33103">
+ <description>Time Label</description>
+ <left>1390</left>
+ <width min="155" max="200">auto</width>
+ <height>38</height>
+ <label>Time 3</label>
+ <font>font12</font>
+ <align>left</align>
+ <aligny>center</aligny>
+ <textcolor>FFFFFFFF</textcolor>
+ </control>
+ </control>
+ <control type="image" id="33013">
+ <description>Timebar line</description>
+ <left>400</left>
+ <top>507</top>
+ <width>40</width>
+ <height>25</height>
+ <aspectratio>keep</aspectratio>
+ </control>
+ <control type="group">
+ <left>25</left>
+ <top>0</top>
+ <itemgap>0</itemgap>
+ <orientation>vertical</orientation>
+ <control type="image">
+ <left>10</left>
+ <top>189</top>
+ <width>375</width>
+ <height>74</height>
+ <texture>epg-genres\COLOR_ButtonNoFocus.png</texture>
+ </control>
+ <control type="image">
+ <left>10</left>
+ <top>264</top>
+ <width>375</width>
+ <height>74</height>
+ <texture>epg-genres\COLOR_ButtonNoFocus.png</texture>
+ </control>
+ <control type="image">
+ <left>10</left>
+ <top>339</top>
+ <width>375</width>
+ <height>74</height>
+ <texture>epg-genres\COLOR_ButtonNoFocus.png</texture>
+ </control>
+ <control type="image">
+ <left>10</left>
+ <top>414</top>
+ <width>375</width>
+ <height>74</height>
+ <texture>epg-genres\COLOR_ButtonNoFocus.png</texture>
+ </control>
+ <control type="image">
+ <left>10</left>
+ <top>489</top>
+ <width>375</width>
+ <height>74</height>
+ <texture>epg-genres\COLOR_ButtonNoFocus.png</texture>
+ </control>
+ <control type="image">
+ <left>10</left>
+ <top>563</top>
+ <width>375</width>
+ <height>74</height>
+ <texture>epg-genres\COLOR_ButtonNoFocus.png</texture>
+ </control>
+ <control type="image">
+ <left>10</left>
+ <top>637</top>
+ <width>375</width>
+ <height>74</height>
+ <texture>epg-genres\COLOR_ButtonNoFocus.png</texture>
+ </control>
+ </control>
+ <control type="grouplist">
+ <left>10</left>
+ <top>189</top>
+ <itemgap>0</itemgap>
+ <orientation>vertical</orientation>
+ <description>Number</description>
+ <control type="label" id="33111">
+ <description>Channel 1 Number</description>
+ <width>75</width>
+ <height>75</height>
+ <label></label>
+ <font>font32_title</font>
+ <align>right</align>
+ <aligny>center</aligny>
+ <textcolor>FFFFFFFF</textcolor>
+ <shadowcolor>ff000000</shadowcolor>
+ </control>
+ <control type="label" id="33112">
+ <description>Channel 2 Number</description>
+ <width>75</width>
+ <height>75</height>
+ <label></label>
+ <font>font32_title</font>
+ <align>right</align>
+ <aligny>center</aligny>
+ <textcolor>FFFFFFFF</textcolor>
+ <shadowcolor>ff000000</shadowcolor>
+ </control>
+ <control type="label" id="33113">
+ <description>Channel 3 Number</description>
+ <width>75</width>
+ <height>75</height>
+ <label></label>
+ <font>font32_title</font>
+ <align>right</align>
+ <aligny>center</aligny>
+ <textcolor>FFFFFFFF</textcolor>
+ <shadowcolor>ff000000</shadowcolor>
+ </control>
+ <control type="label" id="33114">
+ <description>Channel 4 Number</description>
+ <width>75</width>
+ <height>75</height>
+ <label></label>
+ <font>font32_title</font>
+ <align>right</align>
+ <aligny>center</aligny>
+ <textcolor>FFFFFFFF</textcolor>
+ <shadowcolor>ff000000</shadowcolor>
+ </control>
+ <control type="label" id="33115">
+ <description>Channel 5 Number</description>
+ <width>75</width>
+ <height>75</height>
+ <label></label>
+ <font>font32_title</font>
+ <align>right</align>
+ <aligny>center</aligny>
+ <textcolor>FFFFFFFF</textcolor>
+ <shadowcolor>ff000000</shadowcolor>
+ </control>
+ <control type="label" id="33116">
+ <description>Channel 6 Number</description>
+ <width>75</width>
+ <height>75</height>
+ <label></label>
+ <font>font32_title</font>
+ <align>right</align>
+ <aligny>center</aligny>
+ <textcolor>FFFFFFFF</textcolor>
+ <shadowcolor>ff000000</shadowcolor>
+ </control>
+ <control type="label" id="33117">
+ <description>Channel 7 Number</description>
+ <width>75</width>
+ <height>75</height>
+ <label></label>
+ <font>font32_title</font>
+ <align>right</align>
+ <aligny>center</aligny>
+ <textcolor>FFFFFFFF</textcolor>
+ <shadowcolor>ff000000</shadowcolor>
+ </control>
+ </control>
+ <control type="image" id="33411">
+ <description>Channel 1 Icon</description>
+ <visible>false</visible>
+ </control>
+ <control type="image" id="33412">
+ <description>Channel 2 Icon</description>
+ <visible>false</visible>
+ </control>
+ <control type="image" id="33413">
+ <description>Channel 3 Icon</description>
+ <visible>false</visible>
+ </control>
+ <control type="image" id="33414">
+ <description>Channel 4 Icon</description>
+ <visible>false</visible>
+ </control>
+ <control type="image" id="33415">
+ <description>Channel 5 Icon</description>
+ <visible>false</visible>
+ </control>
+ <control type="image" id="33416">
+ <description>Channel 6 Icon</description>
+ <visible>false</visible>
+ </control>
+ <control type="image" id="33417">
+ <description>Channel 7 Icon</description>
+ <visible>false</visible>
+ </control>
+ <control type="group">
+ <left>25</left>
+ <top>0</top>
+ <width>278</width>
+ <height>75</height>
+ <itemgap>0</itemgap>
+ <orientation>vertical</orientation>
+ <description>Names</description>
+ <control type="label" id="33511">
+ <description>Channel 1 Name</description>
+ <left>90</left>
+ <top>189</top>
+ <width>255</width>
+ <height>75</height>
+ <font>font12</font>
+ <align>left</align>
+ <aligny>center</aligny>
+ <textcolor>FFFFFFFF</textcolor>
+ <shadowcolor>ff000000</shadowcolor>
+ </control>
+ <control type="label" id="33512">
+ <description>Channel 2 Name</description>
+ <left>90</left>
+ <top>264</top>
+ <width>255</width>
+ <height>75</height>
+ <label></label>
+ <font>font12</font>
+ <align>left</align>
+ <aligny>center</aligny>
+ <textcolor>FFFFFFFF</textcolor>
+ <shadowcolor>ff000000</shadowcolor>
+ </control>
+ <control type="label" id="33513">
+ <description>Channel 3 Name</description>
+ <left>90</left>
+ <top>339</top>
+ <width>255</width>
+ <height>75</height>
+ <label></label>
+ <font>font12</font>
+ <align>left</align>
+ <aligny>center</aligny>
+ <textcolor>FFFFFFFF</textcolor>
+ <shadowcolor>ff000000</shadowcolor>
+ </control>
+ <control type="label" id="33514">
+ <description>Channel 4 Name</description>
+ <left>90</left>
+ <top>414</top>
+ <width>255</width>
+ <height>75</height>
+ <label></label>
+ <font>font12</font>
+ <align>left</align>
+ <aligny>center</aligny>
+ <textcolor>FFFFFFFF</textcolor>
+ <shadowcolor>ff000000</shadowcolor>
+ </control>
+ <control type="label" id="33515">
+ <description>Channel 5 Name</description>
+ <left>90</left>
+ <top>489</top>
+ <width>255</width>
+ <height>75</height>
+ <label></label>
+ <font>font12</font>
+ <align>left</align>
+ <aligny>center</aligny>
+ <textcolor>FFFFFFFF</textcolor>
+ <shadowcolor>ff000000</shadowcolor>
+ </control>
+ <control type="label" id="33516">
+ <description>Channel 6 Name</description>
+ <left>90</left>
+ <top>564</top>
+ <width>255</width>
+ <height>75</height>
+ <label></label>
+ <font>font12</font>
+ <align>left</align>
+ <aligny>center</aligny>
+ <textcolor>FFFFFFFF</textcolor>
+ <shadowcolor>ff000000</shadowcolor>
+ </control>
+ <control type="label" id="33517">
+ <description>Channel 7 Name</description>
+ <left>90</left>
+ <top>639</top>
+ <width>255</width>
+ <height>75</height>
+ <label></label>
+ <font>font12</font>
+ <align>left</align>
+ <aligny>center</aligny>
+ <textcolor>FFFFFFFF</textcolor>
+ <shadowcolor>ff000000</shadowcolor>
+ </control>
+ </control>
+ </control>
+ <control type="group" id="33611">
+ <left>411</left>
+ <top>539</top>
+ <width>1475</width>
+ <height>74</height>
+ </control>
+ <control type="group" id="33612">
+ <left>411</left>
+ <top>614</top>
+ <width>1475</width>
+ <height>74</height>
+ </control>
+ <control type="group" id="33613">
+ <left>411</left>
+ <top>689</top>
+ <width>1475</width>
+ <height>74</height>
+ </control>
+ <control type="group" id="33614">
+ <left>411</left>
+ <top>765</top>
+ <width>1475</width>
+ <height>74</height>
+ </control>
+ <control type="group" id="33615">
+ <left>411</left>
+ <top>840</top>
+ <width>1475</width>
+ <height>74</height>
+ </control>
+ <control type="group" id="33616">
+ <left>411</left>
+ <top>913</top>
+ <width>1475</width>
+ <height>74</height>
+ </control>
+ <control type="group" id="33617">
+ <left>411</left>
+ <top>987</top>
+ <width>1475</width>
+ <height>74</height>
+ </control>
+ <control type="image" id="33011">
+ <description>Timebar Optional past fade</description>
+ <left>411</left>
+ <top>539</top>
+ <width>-1</width>
+ <height>520</height>
+ <aspectratio>scale</aspectratio>
+ </control>
+ <control type="image" id="33012">
+ <description>Timebar Optional future fade</description>
+ <left>411</left>
+ <top>539</top>
+ <width>-1</width>
+ <height>520</height>
+ <aspectratio>scale</aspectratio>
+ </control>
+ <control type="image" id="33009">
+ <description>Optional Channel Focus Highlight</description>
+ <left>345</left>
+ <top>-1000</top>
+ <height>74</height>
+ <width>74</width>
+ <texture>Arrow.png</texture>
+ <animation effect="fade" start="85" end="85" condition="True">Conditional</animation>
+ </control>
+ <control type="image" id="33010">
+ <description>Optional Channel Playing Highlight</description>
+ <left>345</left>
+ <top>-1000</top>
+ <height>74</height>
+ <width>74</width>
+ <texture colordiffuse="FF0297eb">Arrow.png</texture>
+ <animation effect="fade" start="85" end="85" condition="True">Conditional</animation>
+ </control>
+ <control type="fixedlist" id="40001">
+ <left>446</left>
+ <top>325</top>
+ <width>1848</width>
+ <height>133</height>
+ <orientation>vertical</orientation>
+ <content target="video" sortby="title" sortorder="" limit="1">plugin://plugin.video.ustvnow/?mode=1</content>
+ <itemlayout height="133" width="1848">
+ <control type="textbox">
+ <left>910</left>
+ <width>120</width>
+ <height>133</height>
+ <font>font12</font>
+ <textcolor>C0C0C0C0</textcolor>
+ <shadowcolor>FF000000</shadowcolor>
+ <aligny>center</aligny>
+ <align>right</align>
+ <wrapmultiline>true</wrapmultiline>
+ <info>ListItem.Label</info>
+ </control>
+ <control type="image">
+ <left>1282</left>
+ <width>120</width>
+ <height>133</height>
+ <aspectratio scalediffuse="true" align="center" aligny="center">keep</aspectratio>
+ <info>ListItem.Art(thumb)</info>
+ </control>
+ </itemlayout>
+ <focusedlayout height="133" width="1848">
+ <control type="textbox">
+ <left>910</left>
+ <width>350</width>
+ <height>133</height>
+ <font>font12</font>
+ <textcolor>C0C0C0C0</textcolor>
+ <shadowcolor>FF000000</shadowcolor>
+ <aligny>center</aligny>
+ <align>right</align>
+ <wrapmultiline>true</wrapmultiline>
+ <info>ListItem.Label</info>
+ </control>
+ <control type="image">
+ <left>1282</left>
+ <width>120</width>
+ <height>133</height>
+ <aspectratio scalediffuse="true" align="center" aligny="center">keep</aspectratio>
+ <animation effect="fade" time="100">VisibleChange</animation>
+ <info>ListItem.Icon</info>
+ </control>
+ </focusedlayout>
+ </control>
+ <!-- <control type="fixedlist" id="40002"> -->
+ <!-- <left>35</left> -->
+ <!-- <top>2</top> -->
+ <!-- <width>1848</width> -->
+ <!-- <height>500</height> -->
+ <!-- <orientation>horizontal</orientation> -->
+ <!-- <content target="video" sortby="title" sortorder="" limit="10">plugin://plugin.video.ustvnow/?mode=2</content> -->
+ <!-- <itemlayout height="200" width="200"> -->
+ <!-- <control type="image"> -->
+ <!-- <left>5</left> -->
+ <!-- <top>35</top> -->
+ <!-- <width>180</width> -->
+ <!-- <height>200</height> -->
+ <!-- <aspectratio scalediffuse="true" align="center" aligny="center">keep</aspectratio> -->
+ <!-- <animation effect="fade" time="100">VisibleChange</animation> -->
+ <!-- <info>ListItem.Icon</info> -->
+ <!-- <visible>Control.HasFocus(40001)</visible> -->
+ <!-- <selectedcolor>FFFFFFFF</selectedcolor> -->
+ <!-- </control> -->
+ <!-- </itemlayout> -->
+ <!-- <focusedlayout height="400" width="400"> -->
+ <!-- <control type="image"> -->
+ <!-- <left>5</left> -->
+ <!-- <top>35</top> -->
+ <!-- <width>360</width> -->
+ <!-- <height>400</height> -->
+ <!-- <aspectratio scalediffuse="true" align="center" aligny="center">keep</aspectratio> -->
+ <!-- <animation effect="fade" time="100">VisibleChange</animation> -->
+ <!-- <info>ListItem.Icon</info> -->
+ <!-- <visible>Control.HasFocus(40001)</visible> -->
+ <!-- <selectedcolor>FFFFFFFF</selectedcolor> -->
+ <!-- </control> -->
+ <!-- </focusedlayout> -->
+ <!-- </control> -->
+ </controls>
+</window>
diff --git a/plugin.video.ustvnow/resources/skins/default/1080i/script.module.uepg.splash.xml b/plugin.video.ustvnow/resources/skins/default/1080i/script.module.uepg.splash.xml
new file mode 100644
index 0000000..d26e46a
--- /dev/null
+++ b/plugin.video.ustvnow/resources/skins/default/1080i/script.module.uepg.splash.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<window>
+ <allowoverlay>no</allowoverlay>
+ <depth>2</depth>
+ <zorder>2</zorder>
+ <coordinates>
+ <left>0</left>
+ <top>0</top>
+ </coordinates>
+ <onload>SetProperty(uEPGSplash,True,10000)</onload>
+ <onunload>SetProperty(uEPGSplash,False,10000)</onunload>
+ <animation effect="fade" start="0" end="100" time="100">WindowOpen</animation>
+ <animation effect="fade" start="100" end="0" time="100">WindowClose</animation>
+ <controls>
+ <control type="image">
+ <width>1920</width>
+ <height>1080</height>
+ <texture>Splash.gif</texture>
+ </control>
+ </controls>
+</window>
diff --git a/plugin.video.ustvnow/resources/skins/default/media/Arrow.png b/plugin.video.ustvnow/resources/skins/default/media/Arrow.png
new file mode 100644
index 0000000..d28de29
--- /dev/null
+++ b/plugin.video.ustvnow/resources/skins/default/media/Arrow.png
Binary files differ
diff --git a/plugin.video.ustvnow/resources/skins/default/media/Background.png b/plugin.video.ustvnow/resources/skins/default/media/Background.png
new file mode 100644
index 0000000..ace234a
--- /dev/null
+++ b/plugin.video.ustvnow/resources/skins/default/media/Background.png
Binary files differ
diff --git a/plugin.video.ustvnow/resources/skins/default/media/Bar.png b/plugin.video.ustvnow/resources/skins/default/media/Bar.png
new file mode 100644
index 0000000..b1cd970
--- /dev/null
+++ b/plugin.video.ustvnow/resources/skins/default/media/Bar.png
Binary files differ
diff --git a/plugin.video.ustvnow/resources/skins/default/media/Blur.png b/plugin.video.ustvnow/resources/skins/default/media/Blur.png
new file mode 100644
index 0000000..9d77d85
--- /dev/null
+++ b/plugin.video.ustvnow/resources/skins/default/media/Blur.png
Binary files differ
diff --git a/plugin.video.ustvnow/resources/skins/default/media/ButtonFocus.png b/plugin.video.ustvnow/resources/skins/default/media/ButtonFocus.png
new file mode 100644
index 0000000..56678cd
--- /dev/null
+++ b/plugin.video.ustvnow/resources/skins/default/media/ButtonFocus.png
Binary files differ
diff --git a/plugin.video.ustvnow/resources/skins/default/media/CC.png b/plugin.video.ustvnow/resources/skins/default/media/CC.png
new file mode 100644
index 0000000..862fc68
--- /dev/null
+++ b/plugin.video.ustvnow/resources/skins/default/media/CC.png
Binary files differ
diff --git a/plugin.video.ustvnow/resources/skins/default/media/Lines.png b/plugin.video.ustvnow/resources/skins/default/media/Lines.png
new file mode 100644
index 0000000..b26c701
--- /dev/null
+++ b/plugin.video.ustvnow/resources/skins/default/media/Lines.png
Binary files differ
diff --git a/plugin.video.ustvnow/resources/skins/default/media/Live.png b/plugin.video.ustvnow/resources/skins/default/media/Live.png
new file mode 100644
index 0000000..982c77a
--- /dev/null
+++ b/plugin.video.ustvnow/resources/skins/default/media/Live.png
Binary files differ
diff --git a/plugin.video.ustvnow/resources/skins/default/media/Overlay.png b/plugin.video.ustvnow/resources/skins/default/media/Overlay.png
new file mode 100644
index 0000000..d7e700b
--- /dev/null
+++ b/plugin.video.ustvnow/resources/skins/default/media/Overlay.png
Binary files differ
diff --git a/plugin.video.ustvnow/resources/skins/default/media/PastFade.png b/plugin.video.ustvnow/resources/skins/default/media/PastFade.png
new file mode 100644
index 0000000..ca1a370
--- /dev/null
+++ b/plugin.video.ustvnow/resources/skins/default/media/PastFade.png
Binary files differ
diff --git a/plugin.video.ustvnow/resources/skins/default/media/Splash.gif b/plugin.video.ustvnow/resources/skins/default/media/Splash.gif
new file mode 100644
index 0000000..d2257b2
--- /dev/null
+++ b/plugin.video.ustvnow/resources/skins/default/media/Splash.gif
Binary files differ
diff --git a/plugin.video.ustvnow/resources/skins/default/media/Splash.png b/plugin.video.ustvnow/resources/skins/default/media/Splash.png
new file mode 100644
index 0000000..f27b010
--- /dev/null
+++ b/plugin.video.ustvnow/resources/skins/default/media/Splash.png
Binary files differ
diff --git a/plugin.video.ustvnow/resources/skins/default/media/TimeBar.png b/plugin.video.ustvnow/resources/skins/default/media/TimeBar.png
new file mode 100644
index 0000000..b7167fe
--- /dev/null
+++ b/plugin.video.ustvnow/resources/skins/default/media/TimeBar.png
Binary files differ
diff --git a/plugin.video.ustvnow/resources/skins/default/media/USTVnow - Copy.png b/plugin.video.ustvnow/resources/skins/default/media/USTVnow - Copy.png
new file mode 100644
index 0000000..b39123b
--- /dev/null
+++ b/plugin.video.ustvnow/resources/skins/default/media/USTVnow - Copy.png
Binary files differ
diff --git a/plugin.video.ustvnow/resources/skins/default/media/USTVnow.png b/plugin.video.ustvnow/resources/skins/default/media/USTVnow.png
new file mode 100644
index 0000000..a224ace
--- /dev/null
+++ b/plugin.video.ustvnow/resources/skins/default/media/USTVnow.png
Binary files differ
diff --git a/plugin.video.ustvnow/resources/skins/default/media/White.png b/plugin.video.ustvnow/resources/skins/default/media/White.png
new file mode 100644
index 0000000..6fc42c1
--- /dev/null
+++ b/plugin.video.ustvnow/resources/skins/default/media/White.png
Binary files differ
diff --git a/plugin.video.ustvnow/resources/skins/default/media/epg-genres/COLOR_ButtonNoFocus.png b/plugin.video.ustvnow/resources/skins/default/media/epg-genres/COLOR_ButtonNoFocus.png
new file mode 100644
index 0000000..4cf2e85
--- /dev/null
+++ b/plugin.video.ustvnow/resources/skins/default/media/epg-genres/COLOR_ButtonNoFocus.png
Binary files differ
diff --git a/plugin.video.vrt.nu/addon.py b/plugin.video.vrt.nu/addon.py
index 0cd1b36..dbeec3d 100644
--- a/plugin.video.vrt.nu/addon.py
+++ b/plugin.video.vrt.nu/addon.py
@@ -1,12 +1,10 @@
import sys
import xbmcaddon
-import os
-import requests
from urlparse import parse_qsl
from resources.lib.vrtplayer import vrtplayer
from resources.lib.kodiwrappers import kodiwrapper
from resources.lib.vrtplayer import actions
-from resources.lib.helperobjects import helperobjects
+from resources.lib.kodiwrappers import sortmethod
_addon_ = xbmcaddon.Addon()
_url = sys.argv[0]
@@ -19,21 +17,21 @@ def router(params_string):
params = dict(parse_qsl(params_string))
if params:
if params['action'] == actions.LISTING_AZ:
- kodi_wrapper.show_listing(vrt_player.get_az_menu_items())
+ kodi_wrapper.show_listing(vrt_player.get_az_menu_items(), sortmethod.ALPHABET)
elif params['action'] == actions.LISTING_CATEGORIES:
- kodi_wrapper.show_listing(vrt_player.get_category_menu_items())
+ kodi_wrapper.show_listing(vrt_player.get_category_menu_items(), sortmethod.ALPHABET)
elif params['action'] == actions.LISTING_LIVE:
- kodi_wrapper.show_listing(vrt_player.get_livestream_items())
+ kodi_wrapper.show_listing(vrt_player.get_livestream_items(), sortmethod.ALPHABET)
elif params['action'] == actions.LISTING_VIDEOS:
kodi_wrapper.show_listing(vrt_player.get_videos(params['video']))
elif params['action'] == actions.LISTING_CATEGORY_VIDEOS:
- kodi_wrapper.show_listing(vrt_player.get_video_category_episodes(params['video']))
+ kodi_wrapper.show_listing(vrt_player.get_video_category_episodes(params['video']), sortmethod.ALPHABET)
elif params['action'] == actions.PLAY:
kodi_wrapper.play_video(params['video'])
elif params['action'] == actions.PLAY_LIVE:
kodi_wrapper.play_livestream(params['video'])
else:
- kodi_wrapper.show_listing(vrt_player.get_main_menu_items())
+ kodi_wrapper.show_listing(vrt_player.get_main_menu_items(), sortmethod.ALPHABET)
if __name__ == '__main__':
router(sys.argv[2][1:])
diff --git a/plugin.video.vrt.nu/addon.xml b/plugin.video.vrt.nu/addon.xml
index 29fbf79..3969872 100644
--- a/plugin.video.vrt.nu/addon.xml
+++ b/plugin.video.vrt.nu/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.vrt.nu"
name="VRT Nu"
- version="0.0.5"
+ version="1.0.0"
provider-name="Martijn Moreel">
<requires>
@@ -23,18 +23,26 @@
<platform>all</platform>
<license>GNU General Public License, v3</license>
<news>
-v0.0.1 (01-05-2017)
-- Initial working release
-v0.0.2 (07-05-2017)
-- Fixed installation issue
-v0.0.3 (22-05-2017)
-- Fixed broken livestreams
+v1.0.0 (01-10-2017)
+- Fixed issue where all the videos would not be able to play, implemented new way of getting the streaming urls
+- Fixed bug where a single video would not be listed when there is also a part "ANDEREN BEKEKEN OOK" present
+- New versioning system now starting from 1.0.0
+v0.0.7 (09-09-2017)
+- Fixed bug where dates were not always shown
+v0.0.6 (06-08-2017)
+- Fixed ordering bug for videos
+v0.0.5 (24-07-2017)
+- Fixed broken Sporza logo
v0.0.4 (20-07-2017)
- Added Sporza livestream
- Added dates to videos (Thanks stevenv)
- Fixed bug where seasons did not get listed
-v0.0.5 (24-07-2017)
-- Fixed broken Sporza logo
+v0.0.3 (22-05-2017)
+- Fixed broken livestreams
+v0.0.2 (07-05-2017)
+- Fixed installation issue
+v0.0.1 (01-05-2017)
+- Initial working release
</news>
<source>https://github.com/pietje666/plugin.video.vrt.nu</source>
<assets>
diff --git a/plugin.video.vrt.nu/resources/lib/kodiwrappers/kodiwrapper.py b/plugin.video.vrt.nu/resources/lib/kodiwrappers/kodiwrapper.py
index 588da79..7edcccd 100644
--- a/plugin.video.vrt.nu/resources/lib/kodiwrappers/kodiwrapper.py
+++ b/plugin.video.vrt.nu/resources/lib/kodiwrappers/kodiwrapper.py
@@ -4,6 +4,7 @@ import xbmcplugin
from urllib import urlencode
from resources.lib.vrtplayer import vrtplayer
from resources.lib.vrtplayer import urltostreamservice
+from resources.lib.kodiwrappers import sortmethod
class KodiWrapper:
@@ -12,7 +13,7 @@ class KodiWrapper:
self._url = url
self._addon = addon
- def show_listing(self, list_items):
+ def show_listing(self, list_items, sort=None):
listing = []
for title_item in list_items:
list_item = xbmcgui.ListItem(label=title_item.title)
@@ -26,7 +27,12 @@ class KodiWrapper:
listing.append((url, list_item, not title_item.is_playable))
xbmcplugin.addDirectoryItems(self._handle, listing, len(listing))
- xbmcplugin.addSortMethod(self._handle, xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE)
+
+ if sort is not None:
+ kodi_sorts = {sortmethod.ALPHABET: xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE}
+ kodi_sortmethod = kodi_sorts.get(sort)
+ xbmcplugin.addSortMethod(self._handle, kodi_sortmethod)
+
xbmcplugin.endOfDirectory(self._handle)
def play_video(self, path):
@@ -36,7 +42,6 @@ class KodiWrapper:
stream = stream_service.get_stream_from_url(path)
if stream is not None:
play_item = xbmcgui.ListItem(path=stream.stream_url)
- play_item.setMimeType('application/x-mpegURL')
if stream.subtitle_url is not None:
play_item.setSubtitles([stream.subtitle_url])
xbmcplugin.setResolvedUrl(self._handle, True, listitem=play_item)
diff --git a/plugin.video.vrt.nu/resources/lib/kodiwrappers/sortmethod.py b/plugin.video.vrt.nu/resources/lib/kodiwrappers/sortmethod.py
new file mode 100644
index 0000000..5ef8135
--- /dev/null
+++ b/plugin.video.vrt.nu/resources/lib/kodiwrappers/sortmethod.py
@@ -0,0 +1 @@
+ALPHABET = 1
diff --git a/plugin.video.vrt.nu/resources/lib/vrtplayer/urltostreamservice.py b/plugin.video.vrt.nu/resources/lib/vrtplayer/urltostreamservice.py
index 1d3cecc..f295d65 100644
--- a/plugin.video.vrt.nu/resources/lib/vrtplayer/urltostreamservice.py
+++ b/plugin.video.vrt.nu/resources/lib/vrtplayer/urltostreamservice.py
@@ -44,13 +44,13 @@ class UrlToStreamService:
'"email": "%s"}' % (uid, sig, ts, cred.username)
response = self._session.post("https://token.vrt.be", data=data, headers=headers)
- securevideo_url = "{0}.securevideo.json".format(self.__cut_slash_if_present(url))
+ securevideo_url = "{0}.mssecurevideo.json".format(self.__cut_slash_if_present(url))
securevideo_response = self._session.get(securevideo_url, cookies=response.cookies)
json = securevideo_response.json()
- mzid = list(json
- .values())[0]['mzid']
- final_url = urlparse.urljoin(self._BASE_GET_STREAM_URL_PATH, mzid)
+ video_id = list(json
+ .values())[0]['videoid']
+ final_url = urlparse.urljoin(self._BASE_GET_STREAM_URL_PATH, video_id)
stream_response = self._session.get(final_url)
hls = self.__get_hls(stream_response.json()['targetUrls']).replace("https", "http")
diff --git a/plugin.video.vrt.nu/resources/lib/vrtplayer/vrtplayer.py b/plugin.video.vrt.nu/resources/lib/vrtplayer/vrtplayer.py
index 6543fe0..3b413ce 100644
--- a/plugin.video.vrt.nu/resources/lib/vrtplayer/vrtplayer.py
+++ b/plugin.video.vrt.nu/resources/lib/vrtplayer/vrtplayer.py
@@ -97,14 +97,20 @@ class VRTPlayer:
if len(option_tags) != 0:
title_items.extend(self.__get_episodes(option_tags))
else:
- episodes = soup.find_all(class_="tile")
- if len(episodes) != 0:
+ episodes_list_slider = soup.find(id="episodelist__slider")
+ if episodes_list_slider is not None:
title_items.extend(self.__get_multiple_videos(soup))
else:
title_items.extend(self.__get_single_video(relevant_path.url, soup))
return title_items
+
def __get_episodes(self, option_tags):
+ """
+ This method gets all the episodes = seasons from the dropdownmenus on the vrt.nu website
+ :param option_tags:
+ :return:
+ """
title_items = []
for option_tag in option_tags:
title = statichelper.replace_newlines_and_strip(option_tag.text)
@@ -139,7 +145,7 @@ class VRTPlayer:
list_item_title = soup.find(class_="content__title").text
if "shortdate" in video_dictionary:
- video_dictionary["shortdate"] + " " + list_item_title
+ list_item_title = video_dictionary["shortdate"] + " " + list_item_title
vrt_video = soup.find(class_="vrtvideo")
thumbnail = VRTPlayer.__format_image_url(vrt_video)
diff --git a/plugin.video.wakanim/LICENSE.txt b/plugin.video.wakanim/LICENSE.txt
new file mode 100644
index 0000000..dba13ed
--- /dev/null
+++ b/plugin.video.wakanim/LICENSE.txt
@@ -0,0 +1,661 @@
+ GNU AFFERO GENERAL PUBLIC LICENSE
+ Version 3, 19 November 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU Affero General Public License is a free, copyleft license for
+software and other kinds of works, specifically designed to ensure
+cooperation with the community in the case of network server software.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+our General Public Licenses are intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ Developers that use our General Public Licenses protect your rights
+with two steps: (1) assert copyright on the software, and (2) offer
+you this License which gives you legal permission to copy, distribute
+and/or modify the software.
+
+ A secondary benefit of defending all users' freedom is that
+improvements made in alternate versions of the program, if they
+receive widespread use, become available for other developers to
+incorporate. Many developers of free software are heartened and
+encouraged by the resulting cooperation. However, in the case of
+software used on network servers, this result may fail to come about.
+The GNU General Public License permits making a modified version and
+letting the public access it on a server without ever releasing its
+source code to the public.
+
+ The GNU Affero General Public License is designed specifically to
+ensure that, in such cases, the modified source code becomes available
+to the community. It requires the operator of a network server to
+provide the source code of the modified version running there to the
+users of that server. Therefore, public use of a modified version, on
+a publicly accessible server, gives the public access to the source
+code of the modified version.
+
+ An older license, called the Affero General Public License and
+published by Affero, was designed to accomplish similar goals. This is
+a different license, not a version of the Affero GPL, but Affero has
+released a new version of the Affero GPL which permits relicensing under
+this license.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU Affero General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Remote Network Interaction; Use with the GNU General Public License.
+
+ Notwithstanding any other provision of this License, if you modify the
+Program, your modified version must prominently offer all users
+interacting with it remotely through a computer network (if your version
+supports such interaction) an opportunity to receive the Corresponding
+Source of your version by providing access to the Corresponding Source
+from a network server at no charge, through some standard or customary
+means of facilitating copying of software. This Corresponding Source
+shall include the Corresponding Source for any work covered by version 3
+of the GNU General Public License that is incorporated pursuant to the
+following paragraph.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the work with which it is combined will remain governed by version
+3 of the GNU General Public License.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU Affero General Public License from time to time. Such new versions
+will be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU Affero General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU Affero General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU Affero General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source. For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code. There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU AGPL, see
+<http://www.gnu.org/licenses/>.
diff --git a/plugin.video.wakanim/README.md b/plugin.video.wakanim/README.md
new file mode 100644
index 0000000..ea4a596
--- /dev/null
+++ b/plugin.video.wakanim/README.md
@@ -0,0 +1,42 @@
+# Wakanim plugin for Kodi
+
+Wakanim a KODI (XBMC) plugin for Wakanim.tv.
+
+Git repo: https://github.com/MrKrabat/plugin.video.wakanim
+
+Forum posting: https://www.kodinerds.net/index.php/Thread/58348-Release-Wakanim-tv/
+
+**WARNING: You MUST be a PREMIUM member OR buy videos to use this plugin!**
+***
+
+Compatibility
+
+| Device | Kodi | Status |
+| ------------- | ------------- | ------------- |
+| Windows | 17.x | Yes |
+| Linux | 17.x | Yes |
+| MacOS | 17.x | untested |
+| Android | 17.x | Yes |
+| iOS | 17.x | untested |
+| RaspberryPi | 17.x | Yes |
+***
+
+What this plugin currently can do:
+- [x] Supports Wakanim France, Germany and Nordic
+- [x] Login with your account
+- [x] Search for animes
+- [x] Show "My Downloads"
+- [x] Show "My Collection"
+- [x] Show/browse all available anime
+- [x] Show/browse all seasons/arcs of an anime
+- [x] Show/browse all episodes of an season/arc
+- [x] Display various informations (Kodi displays not all we provide)
+- [x] Reactivate videos/streams
+- [x] Watch videos you have bought
+- [x] Watch videos with premium subscription
+***
+
+_This website and addon is not affiliated with Wakanim._
+
+_Kodi® (formerly known as XBMC™) is a registered trademark of the XBMC Foundation.
+This website and addon is not affiliated with Kodi, Team Kodi, or the XBMC Foundation._ \ No newline at end of file
diff --git a/plugin.video.wakanim/addon.xml b/plugin.video.wakanim/addon.xml
new file mode 100644
index 0000000..77ef39f
--- /dev/null
+++ b/plugin.video.wakanim/addon.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<addon id="plugin.video.wakanim" name="Wakanim" version="0.5.0" provider-name="MrKrabat">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="script.module.beautifulsoup4" version="4.3.2"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource" library="default.py">
+ <provides>video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <platform>all</platform>
+ <language>en de fr</language>
+ <summary lang="en_GB">Wakanim.tv - Anime streaming live from japan</summary>
+ <summary lang="de_DE">Wakanim.tv - Anime Streaming live aus Japan</summary>
+ <summary lang="fr_FR">Wakanim.tv - Streaming d'animes VOSTFR en direct du Japon</summary>
+ <description lang="en_GB">A constantly growing selection of subtitled animes, which can be discovered - new and popular titles.</description>
+ <description lang="de_DE">Eine stetig wachsende Auswahl deutsch untertitelter Animes, die es zu entdecken gilt - neue und beliebte Titel.</description>
+ <description lang="fr_FR">Des dizaines d'animes VOSTFR en streaming à découvrir - nouveautés et séries les plus prisées.</description>
+ <disclaimer lang="en_GB">WARNING: You MUST be a PREMIUM member or BUY videos to use this plugin</disclaimer>
+ <disclaimer lang="de_DE">HINWEIS: Du MUSST PREMIUM Mitglied sein oder Videos KAUFEN um dieses Plugin zu benutzen</disclaimer>
+ <disclaimer lang="fr_FR">AVERTISSEMENT: VOUS DEVEZ être un membre PREMIUM ou ACHETER des vidéos pour utiliser ce plugin</disclaimer>
+ <news>v0.5.0 (2017.10.10)[CR]- Removed internal server redirect</news>
+ <license>GNU Affero General Public License, v3</license>
+ <forum>https://www.kodinerds.net/index.php/Thread/58348-Release-Wakanim-tv/</forum>
+ <website>https://www.wakanim.tv/</website>
+ <source>https://github.com/MrKrabat/plugin.video.wakanim</source>
+ <email></email>
+ <assets>
+ <icon>icon.png</icon>
+ <fanart>fanart.jpg</fanart>
+ <screenshot>resources/media/screenshot-01.jpg</screenshot>
+ <screenshot>resources/media/screenshot-02.jpg</screenshot>
+ <screenshot>resources/media/screenshot-03.jpg</screenshot>
+ </assets>
+ </extension>
+</addon>
diff --git a/plugin.video.wakanim/changelog.txt b/plugin.video.wakanim/changelog.txt
new file mode 100644
index 0000000..f879a30
--- /dev/null
+++ b/plugin.video.wakanim/changelog.txt
@@ -0,0 +1,25 @@
+v0.5.0 (2017.10.10)
+- Removed internal server redirect
+
+v0.4.0 (2017.10.10)
+- Added screenshots
+- Small optimations
+- Internal rewrites
+- Fixed possible encoding problem
+
+v0.3.2 (2017.10.08)
+- Fix playback not possible due security changes
+- Fix playback bought videos
+
+v0.3.1 (2017.10.07)
+- Cleanup of never implemented feature
+
+v0.3.0 (2017.10.03)
+- Added nordic support
+
+v0.2.0 (2017.09.24)
+- Added france support
+- Added API for other addons
+
+v0.1.0 (2017.09.23)
+- Initial BETA release
diff --git a/plugin.video.wakanim/default.py b/plugin.video.wakanim/default.py
new file mode 100644
index 0000000..33a2a3e
--- /dev/null
+++ b/plugin.video.wakanim/default.py
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+# Wakanim - Watch videos from the german anime platform Wakanim.tv on Kodi.
+# Copyright (C) 2017 MrKrabat
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import sys
+import xbmc
+import xbmcaddon
+
+
+_plugId = "plugin.video.wakanim"
+
+# plugin constants
+_addon = xbmcaddon.Addon(id=_plugId)
+_plugin = _addon.getAddonInfo("name")
+_version = _addon.getAddonInfo("version")
+
+xbmc.log("[PLUGIN] %s: version %s initialized" % (_plugin, _version))
+
+if __name__ == "__main__":
+ from resources.lib import wakanim
+ # start addon
+ wakanim.main()
+
+sys.modules.clear()
diff --git a/plugin.video.wakanim/fanart.jpg b/plugin.video.wakanim/fanart.jpg
new file mode 100644
index 0000000..3a44074
--- /dev/null
+++ b/plugin.video.wakanim/fanart.jpg
Binary files differ
diff --git a/plugin.video.wakanim/icon.png b/plugin.video.wakanim/icon.png
new file mode 100644
index 0000000..f7d46ff
--- /dev/null
+++ b/plugin.video.wakanim/icon.png
Binary files differ
diff --git a/plugin.video.wakanim/resources/__init__.py b/plugin.video.wakanim/resources/__init__.py
new file mode 100644
index 0000000..b93054b
--- /dev/null
+++ b/plugin.video.wakanim/resources/__init__.py
@@ -0,0 +1 @@
+# Dummy file to make this directory a package.
diff --git a/plugin.video.wakanim/resources/language/resource.language.de_de/strings.po b/plugin.video.wakanim/resources/language/resource.language.de_de/strings.po
new file mode 100644
index 0000000..16fcfd2
--- /dev/null
+++ b/plugin.video.wakanim/resources/language/resource.language.de_de/strings.po
@@ -0,0 +1,87 @@
+# Kodi Media Center language file
+msgid ""
+msgstr ""
+"Project-Id-Version: Kodi Addons\n"
+"Report-Msgid-Bugs-To: alanwww1@kodi.org\n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: de\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+
+# Wakanim Settings
+
+msgctxt "#30001"
+msgid "Username"
+msgstr "Benutzername"
+
+msgctxt "#30002"
+msgid "Password"
+msgstr "Passwort"
+
+msgctxt "#30010"
+msgid "Region"
+msgstr "Region"
+
+msgctxt "#30011"
+msgid "Germany"
+msgstr "Deutschland"
+
+msgctxt "#30012"
+msgid "France, Belgium, Switzerland, Quebec"
+msgstr "Frankreich, Belgien, Schweiz, Quebec"
+
+msgctxt "#30013"
+msgid "Sweden, Norway, Iceland, Finland, Denmark"
+msgstr "Schweden, Norwegen, Island, Finnland, Dänemark"
+
+
+# Wakanim Menue
+
+msgctxt "#30020"
+msgid "Catalog"
+msgstr "Katalog"
+
+msgctxt "#30021"
+msgid "Search"
+msgstr "Suchen"
+
+msgctxt "#30022"
+msgid "My downloads"
+msgstr "Meine Downloads"
+
+msgctxt "#30023"
+msgid "My collection"
+msgstr "Meine Sammlung"
+
+msgctxt "#30024"
+msgid "Watch trailer"
+msgstr "Trailer ansehen"
+
+
+# Wakanim Messages
+
+msgctxt "#30040"
+msgid "Login failed"
+msgstr "Login fehlgeschlagen"
+
+msgctxt "#30041"
+msgid "An error occurred"
+msgstr "Ein Fehler ist aufgetreten"
+
+msgctxt "#30042"
+msgid "Reactivation failed of this video"
+msgstr "Reaktivierung fehlgeschlagen dieses Videos"
+
+msgctxt "#30043"
+msgid "You need to be a premium member or own this video"
+msgstr "Du musst premium nutzer sein oder das Video gekauft haben"
+
+msgctxt "#30044"
+msgid "Failed to play video"
+msgstr "Fehlgeschlagen das Video abzuspielen"
diff --git a/plugin.video.wakanim/resources/language/resource.language.en_gb/strings.po b/plugin.video.wakanim/resources/language/resource.language.en_gb/strings.po
new file mode 100644
index 0000000..cdff971
--- /dev/null
+++ b/plugin.video.wakanim/resources/language/resource.language.en_gb/strings.po
@@ -0,0 +1,87 @@
+# Kodi Media Center language file
+msgid ""
+msgstr ""
+"Project-Id-Version: Kodi Addons\n"
+"Report-Msgid-Bugs-To: alanwww1@kodi.org\n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+
+# Wakanim Settings
+
+msgctxt "#30001"
+msgid "Username"
+msgstr ""
+
+msgctxt "#30002"
+msgid "Password"
+msgstr ""
+
+msgctxt "#30010"
+msgid "Region"
+msgstr ""
+
+msgctxt "#30011"
+msgid "Germany"
+msgstr ""
+
+msgctxt "#30012"
+msgid "France, Belgium, Switzerland, Quebec"
+msgstr ""
+
+msgctxt "#30013"
+msgid "Sweden, Norway, Iceland, Finland, Denmark"
+msgstr ""
+
+msgctxt "#30024"
+msgid "Watch trailer"
+msgstr ""
+
+
+# Wakanim Menue
+
+msgctxt "#30020"
+msgid "Catalog"
+msgstr ""
+
+msgctxt "#30021"
+msgid "Search"
+msgstr ""
+
+msgctxt "#30022"
+msgid "My downloads"
+msgstr ""
+
+msgctxt "#30023"
+msgid "My collection"
+msgstr ""
+
+
+# Wakanim Messages
+
+msgctxt "#30040"
+msgid "Login failed"
+msgstr ""
+
+msgctxt "#30041"
+msgid "An error occurred"
+msgstr ""
+
+msgctxt "#30042"
+msgid "Reactivation failed of this video"
+msgstr ""
+
+msgctxt "#30043"
+msgid "You need to be a premium member or own this video"
+msgstr ""
+
+msgctxt "#30044"
+msgid "Failed to play video"
+msgstr ""
diff --git a/plugin.video.wakanim/resources/language/resource.language.fr_fr/strings.po b/plugin.video.wakanim/resources/language/resource.language.fr_fr/strings.po
new file mode 100644
index 0000000..a9d0ba3
--- /dev/null
+++ b/plugin.video.wakanim/resources/language/resource.language.fr_fr/strings.po
@@ -0,0 +1,87 @@
+# Kodi Media Center language file
+msgid ""
+msgstr ""
+"Project-Id-Version: Kodi Addons\n"
+"Report-Msgid-Bugs-To: alanwww1@kodi.org\n"
+"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: fr\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+
+# Wakanim Settings
+
+msgctxt "#30001"
+msgid "Username"
+msgstr "Utilisateur"
+
+msgctxt "#30002"
+msgid "Password"
+msgstr "Mot de passe"
+
+msgctxt "#30010"
+msgid "Region"
+msgstr "Région"
+
+msgctxt "#30011"
+msgid "Germany"
+msgstr "Allemagne"
+
+msgctxt "#30012"
+msgid "France, Belgium, Switzerland, Quebec"
+msgstr "France, Belgique, Suisse, Quebec"
+
+msgctxt "#30013"
+msgid "Sweden, Norway, Iceland, Finland, Denmark"
+msgstr "Suède, Norvège, Islande, Finlande, Danemark"
+
+
+# Wakanim Menue
+
+msgctxt "#30020"
+msgid "Catalog"
+msgstr "Catalogue"
+
+msgctxt "#30021"
+msgid "Search"
+msgstr "Rechercher"
+
+msgctxt "#30022"
+msgid "My downloads"
+msgstr "Mes téléchargements"
+
+msgctxt "#30023"
+msgid "My collection"
+msgstr "Ma collection"
+
+msgctxt "#30024"
+msgid "Watch trailer"
+msgstr "Regarde la bande-annonce"
+
+
+# Wakanim Messages
+
+msgctxt "#30040"
+msgid "Login failed"
+msgstr "Échec de la connexion"
+
+msgctxt "#30041"
+msgid "An error occurred"
+msgstr "Une erreur s'est produite"
+
+msgctxt "#30042"
+msgid "Reactivation failed of this video"
+msgstr "La réactivation a échoué de cette vidéo"
+
+msgctxt "#30043"
+msgid "You need to be a premium member or own this video"
+msgstr "Vous devez être un membre premium ou posséder cette vidéo"
+
+msgctxt "#30044"
+msgid "Failed to play video"
+msgstr "Impossible de lire de la vidéo"
diff --git a/plugin.video.wakanim/resources/lib/__init__.py b/plugin.video.wakanim/resources/lib/__init__.py
new file mode 100644
index 0000000..b93054b
--- /dev/null
+++ b/plugin.video.wakanim/resources/lib/__init__.py
@@ -0,0 +1 @@
+# Dummy file to make this directory a package.
diff --git a/plugin.video.wakanim/resources/lib/cmdargs.py b/plugin.video.wakanim/resources/lib/cmdargs.py
new file mode 100644
index 0000000..9a0ac61
--- /dev/null
+++ b/plugin.video.wakanim/resources/lib/cmdargs.py
@@ -0,0 +1,51 @@
+# -*- coding: utf-8 -*-
+# Wakanim - Watch videos from the german anime platform Wakanim.tv on Kodi.
+# Copyright (C) 2017 MrKrabat
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import sys
+import urllib
+import urlparse
+
+
+def parse():
+ """Decode arguments
+ """
+ if (sys.argv[2]):
+ return Args(urlparse.parse_qs(sys.argv[2][1:]))
+ else:
+ return Args({})
+
+
+class Args(object):
+ """Arguments class
+ Hold all arguments passed to the script and also persistent user data and
+ reference to the addon. It is intended to hold all data necessary for the
+ script.
+ """
+ def __init__(self, kwargs):
+ """Initialize arguments object
+ Hold also references to the addon which can't be kept at module level.
+ """
+ self._addon = sys.modules["__main__"]._addon
+ self._addonname = sys.modules["__main__"]._plugin
+ self._addonid = sys.modules["__main__"]._plugId
+ self._cj = None
+
+ for key, value in kwargs.iteritems():
+ if value:
+ kwargs[key] = urllib.unquote_plus(value[0])
+
+ self.__dict__.update(kwargs)
diff --git a/plugin.video.wakanim/resources/lib/login.py b/plugin.video.wakanim/resources/lib/login.py
new file mode 100644
index 0000000..4d92a54
--- /dev/null
+++ b/plugin.video.wakanim/resources/lib/login.py
@@ -0,0 +1,95 @@
+# -*- coding: utf-8 -*-
+# Wakanim - Watch videos from the german anime platform Wakanim.tv on Kodi.
+# Copyright (C) 2017 MrKrabat
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import os
+import cookielib
+import urllib
+import urllib2
+
+import xbmc
+
+
+def login(username, password, args):
+ """Login and session handler
+ """
+ login_url = "https://www.wakanim.tv/" + args._country + "/v2/account/login?ReturnUrl=%2Fde%2Fv2%2Fdiscover"
+
+ # create cookie path
+ cookiepath = os.path.join(
+ xbmc.translatePath(args._addon.getAddonInfo("profile")).decode("utf-8"),
+ "cookies.lwp")
+
+ # create cookiejar
+ cj = cookielib.LWPCookieJar()
+ args._cj = cj
+
+ # lets urllib2 handle cookies
+ opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
+ opener.addheaders = [("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36")]
+ opener.addheaders = [("Accept-Charset", "utf-8")]
+ urllib2.install_opener(opener)
+
+ # check if session exists
+ try:
+ cj.load(cookiepath, ignore_discard=True)
+
+ # check if session is valid
+ response = urllib2.urlopen("https://www.wakanim.tv/" + args._country + "/v2/catalogue")
+ html = response.read()
+
+ if ("Meine Benachrichtigungen verwalten" in html) or ("Gérer mes notifications" in html) or ("Manage my notifications" in html):
+ # session is valid
+ return True
+
+ except IOError:
+ # cookie file does not exist
+ pass
+
+ # build POST data
+ post_data = urllib.urlencode({"username": username,
+ "password": password,
+ "remember": "1"})
+
+ # POST to login page
+ response = urllib2.urlopen(login_url, post_data)
+
+ # check for login string
+ html = response.read()
+
+ if ("Meine Benachrichtigungen verwalten" in html) or ("Gérer mes notifications" in html) or ("Manage my notifications" in html):
+ # save session to disk
+ cj.save(cookiepath, ignore_discard=True)
+ return True
+ else:
+ return False
+
+
+def getCookie(args):
+ """Returns all cookies as string and urlencoded
+ """
+ # create cookie path
+ cookiepath = os.path.join(
+ xbmc.translatePath(args._addon.getAddonInfo("profile")).decode("utf-8"),
+ "cookies.lwp")
+ # save session to disk
+ args._cj.save(cookiepath, ignore_discard=True)
+
+ ret = ""
+ for cookie in args._cj:
+ ret += urllib.urlencode({cookie.name : cookie.value}) + ";"
+
+ return "|User-Agent=Mozilla%2F5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F60.0.3112.113%20Safari%2F537.36&Cookie=" + ret[:-1]
diff --git a/plugin.video.wakanim/resources/lib/netapi.py b/plugin.video.wakanim/resources/lib/netapi.py
new file mode 100644
index 0000000..334279a
--- /dev/null
+++ b/plugin.video.wakanim/resources/lib/netapi.py
@@ -0,0 +1,299 @@
+# -*- coding: utf-8 -*-
+# Wakanim - Watch videos from the german anime platform Wakanim.tv on Kodi.
+# Copyright (C) 2017 MrKrabat
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import re
+import sys
+import urllib
+import urllib2
+from bs4 import BeautifulSoup
+
+import xbmc
+import xbmcgui
+import xbmcplugin
+
+import login
+import view
+
+
+def showCatalog(args):
+ """Show all animes
+ """
+ response = urllib2.urlopen("https://www.wakanim.tv/" + args._country + "/v2/catalogue")
+ html = response.read()
+
+ soup = BeautifulSoup(html, "html.parser")
+ ul = soup.find("ul", {"class": "catalog_list"})
+
+ for li in ul.find_all("li"):
+ plot = li.find("p", {"class": "tooltip_text"})
+ stars = li.find("div", {"class": "stars"})
+ star = stars.find_all("span", {"class": "-no"})
+ thumb = li.img["src"].replace(" ", "%20")
+ if thumb[:4] != "http":
+ thumb = "https:" + thumb
+
+ view.add_item(args,
+ {"url": li.a["href"],
+ "title": li.find("div", {"class": "slider_item_description"}).span.strong.string.strip().encode("utf-8"),
+ "tvshowtitle": li.find("div", {"class": "slider_item_description"}).span.strong.string.strip().encode("utf-8"),
+ "mode": "list_season",
+ "thumb": thumb,
+ "fanart": thumb,
+ "rating": str(10 - len(star) * 2),
+ "plot": plot.contents[3].string.strip().encode("utf-8"),
+ "year": li.time.string.strip().encode("utf-8")},
+ isFolder=True, mediatype="video")
+
+ view.endofdirectory()
+
+
+def searchAnime(args):
+ """Search for animes
+ """
+ d = xbmcgui.Dialog().input(args._addon.getLocalizedString(30021), type=xbmcgui.INPUT_ALPHANUM)
+ if not d:
+ return
+
+ post_data = urllib.urlencode({"search": d})
+ response = urllib2.urlopen("https://www.wakanim.tv/" + args._country + "/v2/catalogue/search", post_data)
+ html = response.read()
+
+ soup = BeautifulSoup(html, "html.parser")
+ ul = soup.find("ul", {"class": "catalog_list"})
+ if not ul:
+ view.endofdirectory()
+ return
+
+ for li in ul.find_all("li"):
+ plot = li.find("p", {"class": "tooltip_text"})
+ stars = li.find("div", {"class": "stars"})
+ star = stars.find_all("span", {"class": "-no"})
+ thumb = li.img["src"].replace(" ", "%20")
+ if thumb[:4] != "http":
+ thumb = "https:" + thumb
+
+ view.add_item(args,
+ {"url": li.a["href"],
+ "title": li.find("div", {"class": "slider_item_description"}).span.strong.string.strip().encode("utf-8"),
+ "mode": "list_season",
+ "thumb": thumb,
+ "fanart": thumb,
+ "rating": str(10 - len(star) * 2),
+ "plot": plot.contents[3].string.strip().encode("utf-8"),
+ "year": li.time.string.strip().encode("utf-8")},
+ isFolder=True, mediatype="video")
+
+ view.endofdirectory()
+
+
+def myDownloads(args):
+ """View download able animes
+ May not every episode is download able.
+ """
+ response = urllib2.urlopen("https://www.wakanim.tv/" + args._country + "/v2/mydownloads")
+ html = response.read()
+
+ soup = BeautifulSoup(html, "html.parser")
+ container = soup.find("div", {"class": "big-item-list"})
+ if not container:
+ view.endofdirectory()
+ return
+
+ for div in container.find_all("div", {"class": "big-item-list_item"}):
+ thumb = div.img["src"].replace(" ", "%20")
+ if thumb[:4] != "http":
+ thumb = "https:" + thumb
+
+ view.add_item(args,
+ {"url": div.a["href"].replace("mydownloads/detail", "catalogue/show"),
+ "title": div.find("h3", {"class": "big-item_title"}).string.strip().encode("utf-8"),
+ "mode": "list_season",
+ "thumb": thumb,
+ "fanart": thumb},
+ isFolder=True, mediatype="video")
+
+ view.endofdirectory()
+
+
+def myCollection(args):
+ """View collection
+ """
+ response = urllib2.urlopen("https://www.wakanim.tv/" + args._country + "/v2/collection")
+ html = response.read()
+
+ soup = BeautifulSoup(html, "html.parser")
+ container = soup.find("div", {"class": "big-item-list"})
+ if not container:
+ view.endofdirectory()
+ return
+
+ for div in container.find_all("div", {"class": "big-item-list_item"}):
+ thumb = div.img["src"].replace(" ", "%20")
+ if thumb[:4] != "http":
+ thumb = "https:" + thumb
+
+ view.add_item(args,
+ {"url": div.a["href"].replace("collection/detail", "catalogue/show"),
+ "title": div.find("h3", {"class": "big-item_title"}).string.strip().encode("utf-8"),
+ "mode": "list_season",
+ "thumb": thumb,
+ "fanart": thumb},
+ isFolder=True, mediatype="video")
+
+ view.endofdirectory()
+
+
+def listSeason(args):
+ """Show all seasons/arcs of an anime
+ """
+ response = urllib2.urlopen("https://www.wakanim.tv" + args.url)
+ html = response.read()
+
+ soup = BeautifulSoup(html, "html.parser")
+
+ date = soup.find_all("span", {"class": "border-list_text"})[0].find_all("span")
+ year = date[2].string.strip().encode("utf-8")
+ date = year + "-" + date[1].string.strip().encode("utf-8") + "-" + date[0].string.strip().encode("utf-8")
+ originaltitle = soup.find_all("span", {"class": "border-list_text"})[1].string.strip().encode("utf-8")
+ plot = soup.find("div", {"class": "serie_description"}).string.strip().encode("utf-8")
+ credits = soup.find("div", {"class": "serie_description_more"}).p.string.strip().encode("utf-8")
+ trailer = soup.find("div", {"class": "TrailerEp-iframeWrapperRatio"})
+ try:
+ trailer = trailer.iframe["src"]
+ trailer = "plugin://plugin.video.youtube/play/?video_id=" + re.search(r"(?:\.be/|/embed)/?([^&=%:/\?]{11})", trailer).group(1)
+ view.add_item(args,
+ {"url": trailer,
+ "mode": "trailer",
+ "thumb": args.thumb.replace(" ", "%20"),
+ "fanart": args.fanart.replace(" ", "%20"),
+ "title": args._addon.getLocalizedString(30024)},
+ isFolder=False, mediatype="video")
+ except AttributeError:
+ trailer = ""
+
+ for section in soup.find_all("h2", {"class": "slider-section_title"}):
+ if not section.span:
+ continue
+ title = section.get_text()[6:].strip()
+
+ view.add_item(args,
+ {"url": args.url,
+ "title": title.encode("utf-8"),
+ "mode": "list_episodes",
+ "thumb": args.thumb.replace(" ", "%20"),
+ "fanart": args.fanart.replace(" ", "%20"),
+ "season": title.encode("utf-8"),
+ "plot": plot,
+ "plotoutline": getattr(args, "plot", ""),
+ "year": year,
+ "premiered": date,
+ "trailer": trailer,
+ "originaltitle": originaltitle,
+ "credits": credits},
+ isFolder=True, mediatype="video")
+
+ view.endofdirectory()
+
+
+def listEpisodes(args):
+ """Show all episodes of an season/arc
+ """
+ response = urllib2.urlopen("https://www.wakanim.tv" + args.url)
+ html = response.read()
+
+ soup = BeautifulSoup(html, "html.parser")
+
+ for season in soup.findAll(text=args.title):
+ parent = season.find_parent("li")
+ if not parent:
+ continue
+
+ thumb = parent.img["src"].replace(" ", "%20")
+ if thumb[:4] != "http":
+ thumb = "https:" + thumb
+
+ view.add_item(args,
+ {"url": parent.a["href"],
+ "title": parent.img["alt"].encode("utf-8"),
+ "mode": "videoplay",
+ "thumb": args.thumb.replace(" ", "%20"),
+ "fanart": args.fanart.replace(" ", "%20")},
+ isFolder=False, mediatype="video")
+
+ view.endofdirectory()
+
+
+def startplayback(args):
+ """Plays a video
+ """
+ response = urllib2.urlopen("https://www.wakanim.tv" + args.url)
+ html = response.read()
+
+ soup = BeautifulSoup(html, "html.parser")
+
+ # check if not premium
+ if ("Diese Folge ist für Abonnenten reserviert" in html) or ("Cet épisode est reservé à nos abonnés" in html) or ("This episode is reserved for our subscribers" in html):
+ xbmc.log("[PLUGIN] %s: You need to own this video or be a premium member '%s'" % (args._addonname, args.url), xbmc.LOGERROR)
+ xbmcgui.Dialog().ok(args._addonname, args._addon.getLocalizedString(30043))
+ return
+
+ # check if we have to reactivate video
+ if "reactivate" in html:
+ # reactivate video
+ a = soup.find("div", {"id": "jwplayer-container"}).a["href"]
+ response = urllib2.urlopen("https://www.wakanim.tv" + a)
+ html = response.read()
+
+ # reload page
+ response = urllib2.urlopen("https://www.wakanim.tv" + args.url)
+ html = response.read()
+ soup = BeautifulSoup(html, "html.parser")
+
+ # check if successfull
+ if "reactivate" in html:
+ xbmc.log("[PLUGIN] %s: Reactivation failed '%s'" % (args._addonname, args.url), xbmc.LOGERROR)
+ xbmcgui.Dialog().ok(args._addonname, args._addon.getLocalizedString(30042))
+ return
+
+ # using stream with hls+aes
+ if ("Unser Player ist in der Beta-Phase. Klicke hier, um den alten Player zu benutzen" in html) or ("Changer de lecteur" in html) or ("Our player is in beta, click here to go back to the old one" in html):
+ # streaming is only for premium subscription
+ if (("<span>Kostenlos</span>" in html) or ("<span>Gratuit</span>" in html) or ("<span>Free</span>" in html)) and not ("episode_premium_title" in html):
+ xbmc.log("[PLUGIN] %s: You need to own this video or be a premium member '%s'" % (args._addonname, args.url), xbmc.LOGERROR)
+ xbmcgui.Dialog().ok(args._addonname, args._addon.getLocalizedString(30043))
+ return
+
+ # get stream file
+ regex = r"file: \"(.*?)\","
+ matches = re.search(regex, html).group(1)
+
+ if matches:
+ # manifest url
+ url = "https://www.wakanim.tv" + matches
+
+ # play stream
+ item = xbmcgui.ListItem(getattr(args, "title", "Title not provided"), path=url + login.getCookie(args))
+ item.setMimeType("application/vnd.apple.mpegurl")
+ item.setContentLookup(False)
+ xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item)
+ else:
+ xbmc.log("[PLUGIN] %s: Failed to play stream" % args._addonname, xbmc.LOGERROR)
+ xbmcgui.Dialog().ok(args._addonname, args._addon.getLocalizedString(30044))
+
+ else:
+ xbmc.log("[PLUGIN] %s: You need to own this video or be a premium member '%s'" % (args._addonname, args.url), xbmc.LOGERROR)
+ xbmcgui.Dialog().ok(args._addonname, args._addon.getLocalizedString(30043))
diff --git a/plugin.video.wakanim/resources/lib/view.py b/plugin.video.wakanim/resources/lib/view.py
new file mode 100644
index 0000000..c8a00ff
--- /dev/null
+++ b/plugin.video.wakanim/resources/lib/view.py
@@ -0,0 +1,110 @@
+# -*- coding: utf-8 -*-
+# Wakanim - Watch videos from the german anime platform Wakanim.tv on Kodi.
+# Copyright (C) 2017 MrKrabat
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import sys
+import urllib
+
+import xbmc
+import xbmcgui
+import xbmcplugin
+
+
+# keys allowed in setInfo
+types = ["count", "size", "date", "genre", "year", "episode", "season", "top250", "tracknumber",
+ "rating", "userrating", "watched", "playcount", "overlay", "cast", "castandrole", "director",
+ "mpaa", "plot", "plotoutline", "title", "originaltitle", "sorttitle", "duration", "studio",
+ "tagline", "writer", "tvshowtitle", "premiered", "status", "code", "aired", "credits", "lastplayed",
+ "album", "artist", "votes", "trailer", "dateadded", "mediatype"]
+
+def endofdirectory():
+ # sort methods are required in library mode
+ xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_NONE)
+
+ # let xbmc know the script is done adding items to the list
+ xbmcplugin.endOfDirectory(handle = int(sys.argv[1]))
+
+
+def add_item(args, info, isFolder=True, total_items=0, mediatype="video"):
+ """Add item to directory listing.
+ """
+
+ # create list item
+ li = xbmcgui.ListItem(label = info["title"])
+
+ # get infoLabels
+ infoLabels = make_infolabel(args, info)
+ infoLabels["genre"] = "Anime"
+
+ # get url
+ u = build_url(args, info)
+
+ if isFolder:
+ # directory
+ li.setInfo(mediatype, infoLabels)
+ else:
+ # playable video
+ infoLabels["mediatype"] = "video"
+ li.setInfo(mediatype, infoLabels)
+ li.setProperty("IsPlayable", "true")
+
+ # set media image
+ li.setArt({"thumb": info.get("thumb", "DefaultFolder.png"),
+ "poster": info.get("thumb", "DefaultFolder.png"),
+ "banner": info.get("thumb", "DefaultFolder.png"),
+ "fanart": info.get("fanart", xbmc.translatePath(args._addon.getAddonInfo("fanart"))),
+ "icon": info.get("thumb", "DefaultFolder.png")})
+
+ # add item to list
+ xbmcplugin.addDirectoryItem(handle = int(sys.argv[1]),
+ url = u,
+ listitem = li,
+ isFolder = isFolder,
+ totalItems = total_items)
+
+
+def build_url(args, info):
+ """Create url
+ """
+ s = ""
+ # step 1 copy new information from info
+ for key, value in info.iteritems():
+ if value:
+ s = s + "&" + key + "=" + urllib.quote_plus(value)
+
+ # step 2 copy old information from args, but don't append twice
+ for key, value in args.__dict__.iteritems():
+ if value and key in types and not "&" + str(key) + "=" in s:
+ s = s + "&" + key + "=" + urllib.quote_plus(value)
+
+ return sys.argv[0] + "?" + s[1:]
+
+
+def make_infolabel(args, info):
+ """Generate infoLabels from existing dict
+ """
+ infoLabels = {}
+ # step 1 copy new information from info
+ for key, value in info.iteritems():
+ if value and key in types:
+ infoLabels[key] = value
+
+ # step 2 copy old information from args, but don't overwrite
+ for key, value in args.__dict__.iteritems():
+ if value and key in types and key not in infoLabels:
+ infoLabels[key] = value
+
+ return infoLabels
diff --git a/plugin.video.wakanim/resources/lib/wakanim.py b/plugin.video.wakanim/resources/lib/wakanim.py
new file mode 100644
index 0000000..3c53fcb
--- /dev/null
+++ b/plugin.video.wakanim/resources/lib/wakanim.py
@@ -0,0 +1,125 @@
+# -*- coding: utf-8 -*-
+# Wakanim - Watch videos from the german anime platform Wakanim.tv on Kodi.
+# Copyright (C) 2017 MrKrabat
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import sys
+
+import xbmc
+import xbmcgui
+import xbmcplugin
+
+import cmdargs
+import login
+import netapi
+import view
+
+
+def main():
+ """Main function for the addon
+ """
+ args = cmdargs.parse()
+
+ # check if account is set
+ username = args._addon.getSetting("wakanim_username")
+ password = args._addon.getSetting("wakanim_password")
+
+ # set country
+ args._country = args._addon.getSetting("country")
+ if args._country == "0":
+ args._country = "de"
+ elif args._country == "1":
+ args._country = "fr"
+ elif args._country == "2":
+ args._country = "sc"
+ else:
+ args._country = "de"
+
+ if not (username and password):
+ # open addon settings
+ args._addon.openSettings()
+ return False
+ else:
+ # login
+ success = login.login(username, password, args)
+ if success:
+ # list menue
+ xbmcplugin.setContent(int(sys.argv[1]), "tvshows")
+ check_mode(args)
+ else:
+ # login failed
+ xbmc.log("[PLUGIN] %s: Login failed" % args._addonname, xbmc.LOGERROR)
+ xbmcgui.Dialog().ok(args._addonname, args._addon.getLocalizedString(30040))
+ return False
+
+
+def check_mode(args):
+ """Run mode-specific functions
+ """
+ if hasattr(args, "mode"):
+ mode = args.mode
+ elif hasattr(args, "id"):
+ # call from other plugin
+ mode = "videoplay"
+ args.url = "/" + args._country + "/v2/catalogue/episode/" + args.id
+ elif hasattr(args, "id"):
+ # call from other plugin
+ mode = "videoplay"
+ args.url = args.url[22:]
+ else:
+ mode = None
+
+ if not mode:
+ showMainMenue(args)
+ elif mode == "catalog":
+ netapi.showCatalog(args)
+ elif mode == "search":
+ netapi.searchAnime(args)
+ elif mode == "downloads":
+ netapi.myDownloads(args)
+ elif mode == "collection":
+ netapi.myCollection(args)
+ elif mode == "list_season":
+ netapi.listSeason(args)
+ elif mode == "list_episodes":
+ netapi.listEpisodes(args)
+ elif mode == "videoplay":
+ netapi.startplayback(args)
+ elif mode == "trailer":
+ item = xbmcgui.ListItem(getattr(args, "title", "Title not provided"), path=args.url)
+ xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item)
+ else:
+ # unkown mode
+ xbmc.log("[PLUGIN] %s: Failed in check_mode '%s'" % (args._addonname, str(mode)), xbmc.LOGERROR)
+ xbmcgui.Dialog().notification(args._addonname, args._addon.getLocalizedString(30041), xbmcgui.NOTIFICATION_ERROR)
+ showMainMenue(args)
+
+
+def showMainMenue(args):
+ """Show main menu
+ """
+ view.add_item(args,
+ {"title": args._addon.getLocalizedString(30020),
+ "mode": "catalog"})
+ view.add_item(args,
+ {"title": args._addon.getLocalizedString(30021),
+ "mode": "search"})
+ view.add_item(args,
+ {"title": args._addon.getLocalizedString(30022),
+ "mode": "downloads"})
+ view.add_item(args,
+ {"title": args._addon.getLocalizedString(30023),
+ "mode": "collection"})
+ view.endofdirectory()
diff --git a/plugin.video.wakanim/resources/media/screenshot-01.jpg b/plugin.video.wakanim/resources/media/screenshot-01.jpg
new file mode 100644
index 0000000..d6f468c
--- /dev/null
+++ b/plugin.video.wakanim/resources/media/screenshot-01.jpg
Binary files differ
diff --git a/plugin.video.wakanim/resources/media/screenshot-02.jpg b/plugin.video.wakanim/resources/media/screenshot-02.jpg
new file mode 100644
index 0000000..1ae92a1
--- /dev/null
+++ b/plugin.video.wakanim/resources/media/screenshot-02.jpg
Binary files differ
diff --git a/plugin.video.wakanim/resources/media/screenshot-03.jpg b/plugin.video.wakanim/resources/media/screenshot-03.jpg
new file mode 100644
index 0000000..d1a2035
--- /dev/null
+++ b/plugin.video.wakanim/resources/media/screenshot-03.jpg
Binary files differ
diff --git a/plugin.video.wakanim/resources/settings.xml b/plugin.video.wakanim/resources/settings.xml
new file mode 100644
index 0000000..bc00cb9
--- /dev/null
+++ b/plugin.video.wakanim/resources/settings.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<settings>
+ <setting id="country" type="select" lvalues="30011|30012|30013" label="30010" default="0" />
+ <setting type="sep" />
+ <setting id="wakanim_username" type="text" label="30001" default=""/>
+ <setting id="wakanim_password" type="text" label="30002" option="hidden" default=""/>
+</settings>
diff --git a/plugin.video.watchmojo/LICENSE.txt b/plugin.video.watchmojo/LICENSE.txt
new file mode 100644
index 0000000..d159169
--- /dev/null
+++ b/plugin.video.watchmojo/LICENSE.txt
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY 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, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/plugin.video.watchmojo/addon.py b/plugin.video.watchmojo/addon.py
new file mode 100644
index 0000000..29873e9
--- /dev/null
+++ b/plugin.video.watchmojo/addon.py
@@ -0,0 +1,177 @@
+# -*- coding: utf-8 -*-
+# Copyright: (c) 2016 - 2017 William Forde (willforde+kodi@gmail.com)
+#
+# License: GPLv2, see LICENSE for more details
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY 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, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+from __future__ import unicode_literals
+from codequick import Route, Resolver, Listitem, run, utils
+
+# Localized string Constants
+TAGS = 20459
+
+# Base url constructor
+url_constructor = utils.urljoin_partial("http://www.watchmojo.com")
+
+
+# ###### Functions ###### #
+
+def extract_videos(lbl_tags, elem, date_format):
+ item = Listitem()
+ item.label = elem.findtext(".//div[@class='hptitle']").replace("\t", " ").strip()
+ item.art["thumb"] = url_constructor(elem.find(".//img").get("src"))
+
+ duration = elem.find(".//img[@class='hpplay']").tail
+ if duration:
+ item.info["duration"] = duration.strip(";")
+
+ url = elem.find("a").get("href")
+ item.info.date(elem.findtext(".//div[@class='hpdate']").strip(), date_format)
+ item.context.container(lbl_tags, tags, url=url)
+ item.context.related(related, url=url)
+ item.set_callback(play_video, url=url)
+ return item
+
+
+# ###### Callbacks ###### #
+
+@Route.register
+def root(plugin):
+ """
+ Lists all categories and link's to 'Shows', 'MsMojo' and 'All videos'.
+
+ site: http://www.watchmojo.com
+
+ :param Route plugin: Tools related to callback.
+ :return: A generator of listitems.
+ """
+ # Item youtube link as a all videos option
+ yield Listitem.youtube("UCaWd5_7JhbQBe4dknZhsHJg")
+
+ url = url_constructor("/")
+ source = plugin.request.get(url)
+
+ # Parse only the main category elements
+ root_elem = source.parse()
+ for elem in root_elem.find(".//div[@id='owl-demo4']").iterfind("div"):
+ # Image element contains image url and label as the alt attribute
+ img_tag = elem.find("./a/img")
+
+ item = Listitem()
+ item.label = img_tag.get("alt")
+ item.art["thumb"] = url_constructor(img_tag.get("src"))
+ item.set_callback(video_list, url=elem.find("a").get("href").replace("/i/home/", "http://"))
+ yield item
+
+ # Parse only the show category elements
+ menu_elem = root_elem.find(".//ul[@class='top-ul left']")
+ for elem in menu_elem.iterfind(".//a"):
+ url = elem.get("href")
+ if url and elem.text and (url.startswith("/shows/") or url.startswith("/msmojo/")):
+ item = Listitem()
+ item.label = elem.text
+ item.set_callback(video_list, url=url)
+ yield item
+
+
+@Route.register
+def video_list(plugin, url):
+ """
+ List all video for given url.
+
+ site: http://www.watchmojo.com/shows/Top%2010
+
+ :param Route plugin: Tools related to Route callbacks.
+ :param unicode url: The url to a list of videos.
+ :return: A generator of listitems.
+ """
+ url = url_constructor(url)
+ source = plugin.request.get(url)
+ lbl_tags = plugin.localize(TAGS)
+
+ # Parse all the video elements
+ root_elem = source.parse()
+ for elem in root_elem.iterfind(".//div[@class='item']"):
+ yield extract_videos(lbl_tags, elem, "%b %d, %Y")
+
+ # Add link to next page if available
+ next_page = root_elem.find(".//div[@class='cat-next']")
+ if next_page is not None:
+ url = next_page.find("a").get("href")
+ yield Listitem.next_page(url=url)
+
+
+@Route.register
+def related(plugin, url):
+ """
+ List all related videos to selected video.
+
+ site: http://www.watchmojo.com/video/id/19268/
+
+ :param Route plugin: Tools related to Route callbacks.
+ :param unicode url: The url to a video.
+ :return: A generator of listitems.
+ """
+ url = url_constructor(url)
+ source = plugin.request.get(url)
+ lbl_tags = plugin.localize(TAGS)
+
+ # Parse all the video elements
+ root_elem = source.parse("div", attrs={"id": "owl-demo1"})
+ for elem in root_elem.iterfind(".//div[@class='item']"):
+ yield extract_videos(lbl_tags, elem, "%B %d, %Y")
+
+
+@Route.register
+def tags(plugin, url):
+ """
+ List tags for a video.
+
+ site: http://www.watchmojo.com/video/id/19268/
+
+ :param Route plugin: Tools related to Route callbacks.
+ :param unicode url: The url to a video.
+ :return: A generator of listitems.
+ """
+ url = url_constructor(url)
+ source = plugin.request.get(url)
+
+ # Parse all video tags
+ root_elem = source.parse("div", attrs={"id": "tags"})
+ for elem in root_elem.iterfind("a"):
+ item = Listitem()
+ item.label = elem.text.title()
+ item.set_callback(video_list, url=elem.get("href"))
+ yield item
+
+
+@Resolver.register
+def play_video(plugin, url):
+ """
+ Resolve video url.
+
+ site: http://www.watchmojo.com/video/id/19268/
+
+ :param Resolver plugin: Tools related to Resolver callbacks.
+ :param unicode url: The url to a video.
+ :return: A playable video url.
+ """
+ url = url_constructor(url)
+ return plugin.extract_source(url)
+
+
+if __name__ == "__main__":
+ run()
diff --git a/plugin.video.watchmojo/addon.xml b/plugin.video.watchmojo/addon.xml
new file mode 100644
index 0000000..45ea20b
--- /dev/null
+++ b/plugin.video.watchmojo/addon.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<addon id="plugin.video.watchmojo" name="Watchmojo" provider-name="willforde" version="3.0.0">
+ <requires>
+ <import addon="xbmc.python" version="2.25.0"/>
+ <import addon="script.module.codequick" version="0.9.0"/>
+ </requires>
+ <extension point="xbmc.python.pluginsource" library="addon.py">
+ <provides>video</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <summary lang="en_GB">Top 10 lists on Music, TV, Film and Video Games.</summary>
+ <description lang="en_GB">Top 10 lists on Music, TV, Film and Video Games. We publish 4 or more Top 10s daily. Subscribe for new top 10 lists every day, and binge watch on Top 10s covering Pop Culture, Celebrity, Movies, Music, TV, Film, Video Games, Politics, News, Comics and Superheroes. WatchMojo’s back catalogue has ten thousand videos on Top 10 lists, Origins, Biographies, Tips, How To’s, Reviews, Commentary and more Your trusted authority on ranking Pop Culture.</description>
+ <license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license>
+ <source>https://github.com/willforde/plugin.video.watchmojo</source>
+ <forum>http://forum.kodi.tv/showthread.php?tid=178802</forum>
+ <website>http://www.watchmojo.com</website>
+ <email>willforde+addon@gmail.com</email>
+ <platform>all</platform>
+ <language>en</language>
+ <assets>
+ <icon>resources/icon.png</icon>
+ <fanart>resources/fanart.jpg</fanart>
+ <screenshot>resources/screenshots/screenshot000.jpg</screenshot>
+ <screenshot>resources/screenshots/screenshot001.jpg</screenshot>
+ <screenshot>resources/screenshots/screenshot002.jpg</screenshot>
+ </assets>
+ <news>[upd] Upgraded to use the codequick framework.</news>
+ </extension>
+</addon>
diff --git a/plugin.video.watchmojo/resources/fanart.jpg b/plugin.video.watchmojo/resources/fanart.jpg
new file mode 100644
index 0000000..39df7bf
--- /dev/null
+++ b/plugin.video.watchmojo/resources/fanart.jpg
Binary files differ
diff --git a/plugin.video.watchmojo/resources/icon.png b/plugin.video.watchmojo/resources/icon.png
new file mode 100644
index 0000000..fa4b9bd
--- /dev/null
+++ b/plugin.video.watchmojo/resources/icon.png
Binary files differ
diff --git a/plugin.video.watchmojo/resources/screenshots/screenshot000.jpg b/plugin.video.watchmojo/resources/screenshots/screenshot000.jpg
new file mode 100644
index 0000000..0485f2d
--- /dev/null
+++ b/plugin.video.watchmojo/resources/screenshots/screenshot000.jpg
Binary files differ
diff --git a/plugin.video.watchmojo/resources/screenshots/screenshot001.jpg b/plugin.video.watchmojo/resources/screenshots/screenshot001.jpg
new file mode 100644
index 0000000..91b7014
--- /dev/null
+++ b/plugin.video.watchmojo/resources/screenshots/screenshot001.jpg
Binary files differ
diff --git a/plugin.video.watchmojo/resources/screenshots/screenshot002.jpg b/plugin.video.watchmojo/resources/screenshots/screenshot002.jpg
new file mode 100644
index 0000000..cbcc031
--- /dev/null
+++ b/plugin.video.watchmojo/resources/screenshots/screenshot002.jpg
Binary files differ