summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
m---------.tests0
-rw-r--r--.travis.yml4
-rw-r--r--plugin.video.btsportvideo/LICENSE21
-rw-r--r--plugin.video.btsportvideo/README.md9
-rw-r--r--plugin.video.btsportvideo/addon.py152
-rw-r--r--plugin.video.btsportvideo/addon.xml31
-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.po37
-rw-r--r--plugin.video.btsportvideo/resources/lib/__init__.py0
-rw-r--r--plugin.video.btsportvideo/resources/lib/api.py106
-rw-r--r--plugin.video.btsportvideo/resources/screenshot001.pngbin0 -> 2092760 bytes
-rw-r--r--plugin.video.btsportvideo/resources/screenshot002.pngbin0 -> 1277125 bytes
-rw-r--r--plugin.video.btsportvideo/resources/screenshot003.pngbin0 -> 947806 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/LICENSE.txt0
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/README.md33
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/addon.py5
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/addon.xml57
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/fanart.jpgbin599681 -> 599681 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/icon.pngbin233631 -> 233631 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/__init__.py0
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/language/resource.language.en_gb/strings.po15
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/language/resource.language.fr_fr/strings.po20
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/language/resource.language.he.il/strings.po18
-rw-r--r--plugin.video.catchuptvandmore/resources/language/resource.language.he_il/strings.po177
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/lib/__init__.py0
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/lib/channels/__init__.py0
-rw-r--r--plugin.video.catchuptvandmore/resources/lib/channels/be/__init__.py0
-rw-r--r--plugin.video.catchuptvandmore/resources/lib/channels/be/rtbf.py348
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/lib/channels/eu/__init__.py0
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/lib/channels/eu/arte.py45
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/lib/channels/eu/euronews.py34
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/lib/channels/fr/6play.py91
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/lib/channels/fr/__init__.py0
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/lib/channels/fr/bfmtv.py106
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/lib/channels/fr/france24.py196
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/lib/channels/fr/groupecanal.py163
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/lib/channels/fr/gulli.py44
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/lib/channels/fr/lcp.py170
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/lib/channels/fr/lequipe.py51
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/lib/channels/fr/nrj.py58
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/lib/channels/fr/numero23.py116
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/lib/channels/fr/pluzz.py63
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/lib/channels/fr/publicsenat.py142
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/lib/channels/fr/tf1.py388
-rw-r--r--plugin.video.catchuptvandmore/resources/lib/channels/uk/__init__.py0
-rw-r--r--plugin.video.catchuptvandmore/resources/lib/channels/uk/blaze.py339
-rw-r--r--plugin.video.catchuptvandmore/resources/lib/channels/uk/uktvplay.py473
-rw-r--r--plugin.video.catchuptvandmore/resources/lib/channels/ws/__init__.py0
-rw-r--r--plugin.video.catchuptvandmore/resources/lib/channels/ws/allocine.py661
-rw-r--r--plugin.video.catchuptvandmore/resources/lib/channels/ws/tetesaclaques.py326
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/lib/common.py1
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/lib/simpleplugin.py403
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/lib/skeleton.py29
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/lib/utils.py0
-rw-r--r--plugin.video.catchuptvandmore/resources/media/categories/be.pngbin0 -> 31245 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/categories/eu.pngbin54623 -> 54623 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/categories/fr.pngbin35083 -> 35083 bytes
-rw-r--r--plugin.video.catchuptvandmore/resources/media/categories/uk.pngbin0 -> 49906 bytes
-rw-r--r--plugin.video.catchuptvandmore/resources/media/categories/ws.pngbin0 -> 59921 bytes
-rw-r--r--plugin.video.catchuptvandmore/resources/media/channels/be/auvio.pngbin0 -> 52280 bytes
-rw-r--r--plugin.video.catchuptvandmore/resources/media/channels/be/auvio_fanart.pngbin0 -> 14059 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/eu/arte.pngbin23700 -> 23700 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/eu/arte_fanart.pngbin9650 -> 9650 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/eu/euronews.pngbin30470 -> 30470 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/eu/euronews_fanart.pngbin338427 -> 338427 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/01net.pngbin68110 -> 68110 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/01net_fanart.pngbin735809 -> 735809 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/6ter.pngbin100963 -> 100963 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/6ter_fanart.pngbin277616 -> 277616 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/bfmbusiness.pngbin69286 -> 69286 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/bfmbusiness_fanart.pngbin250165 -> 250165 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/bfmtv.pngbin35775 -> 35775 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/bfmtv_fanart.pngbin483976 -> 483976 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/bruce.pngbin73215 -> 73215 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/bruce_fanart.pngbin213058 -> 213058 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/c8.pngbin85413 -> 85413 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/c8_fanart.pngbin201320 -> 201320 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/cherie25.pngbin65360 -> 65360 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/cherie25_fanart.pngbin72366 -> 72366 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/cnews.pngbin25355 -> 25355 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/cnews_fanart.pngbin59350 -> 59350 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/comedy.pngbin65960 -> 65960 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/comedy_fanart.pngbin143152 -> 143152 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/cplus.pngbin23038 -> 23038 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/cplus_fanart.pngbin104838 -> 104838 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/crazy_kitchen.pngbin101293 -> 101293 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/crazy_kitchen_fanart.pngbin282736 -> 282736 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/cstar.pngbin36243 -> 36243 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/cstar_fanart.pngbin128048 -> 128048 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/france2.pngbin53728 -> 53728 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/france24.pngbin72117 -> 72117 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/france24_fanart.pngbin70440 -> 70440 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/france2_fanart.pngbin333122 -> 333122 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/france3.pngbin31569 -> 31569 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/france3_fanart.pngbin176208 -> 176208 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/france4.pngbin78093 -> 78093 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/france4_fanart.pngbin37397 -> 37397 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/france5.pngbin51222 -> 51222 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/france5_fanart.pngbin59985 -> 59985 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/franceinfo.pngbin25302 -> 25302 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/franceinfo_fanart.pngbin8461 -> 8461 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/franceo.pngbin46934 -> 46934 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/franceo_fanart.pngbin131619 -> 131619 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/gulli.pngbin162929 -> 162929 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/gulli_fanart.pngbin318305 -> 318305 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/hd1.pngbin24214 -> 24214 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/hd1_fanart.pngbin629402 -> 629402 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/home.pngbin109893 -> 109893 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/home_fanart.pngbin142116 -> 142116 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/la_1ere.pngbin41223 -> 41223 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/la_1ere_fanart.pngbin187947 -> 187947 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/lci.pngbin72945 -> 72945 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/lci_fanart.pngbin31063 -> 31063 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/lcp.pngbin41450 -> 41450 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/lcp_fanart.pngbin31906 -> 31906 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/lequipe.pngbin32528 -> 32528 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/lequipe_fanart.pngbin82760 -> 82760 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/m6.pngbin125343 -> 125343 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/m6_fanart.pngbin569115 -> 569115 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/nrj12.pngbin73550 -> 73550 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/nrj12_fanart.pngbin340086 -> 340086 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/nt1.pngbin178003 -> 178003 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/nt1_fanart.pngbin339900 -> 339900 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/numero23.pngbin38500 -> 38500 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/numero23_fanart.pngbin96249 -> 96249 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/parispremiere.pngbin39528 -> 39528 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/parispremiere_fanart.pngbin233673 -> 233673 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/publicsenat.pngbin34680 -> 34680 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/publicsenat_fanart.pngbin72575 -> 72575 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/rmc.pngbin55653 -> 55653 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/rmc_fanart.pngbin612196 -> 612196 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/rmcdecouverte.pngbin105602 -> 105602 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/stories.pngbin100143 -> 100143 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/stories_fanart.pngbin276211 -> 276211 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/styles.pngbin157869 -> 157869 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/styles_fanart.pngbin193117 -> 193117 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/teva.pngbin49930 -> 49930 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/teva_fanart.pngbin60951 -> 60951 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/tf1.pngbin38203 -> 38203 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/tf1_fanart.pngbin694530 -> 694530 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/tfou.pngbin249979 -> 249979 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/tfou_fanart.pngbin229547 -> 229547 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/tmc.pngbin25166 -> 25166 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/tmc_fanart.pngbin345299 -> 345299 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/w9.pngbin115591 -> 115591 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/w9_fanart.pngbin31425 -> 31425 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/media/channels/fr/xtra.pngbin59140 -> 59140 bytes
-rw-r--r--plugin.video.catchuptvandmore/resources/media/channels/uk/blaze.pngbin0 -> 33020 bytes
-rw-r--r--plugin.video.catchuptvandmore/resources/media/channels/uk/dave.pngbin0 -> 27072 bytes
-rw-r--r--plugin.video.catchuptvandmore/resources/media/channels/uk/drama.pngbin0 -> 166990 bytes
-rw-r--r--plugin.video.catchuptvandmore/resources/media/channels/uk/drama_fanart.pngbin0 -> 108025 bytes
-rw-r--r--plugin.video.catchuptvandmore/resources/media/channels/uk/really.pngbin0 -> 24395 bytes
-rw-r--r--plugin.video.catchuptvandmore/resources/media/channels/uk/yesterday.pngbin0 -> 43833 bytes
-rw-r--r--plugin.video.catchuptvandmore/resources/media/channels/ws/allocine.pngbin0 -> 44475 bytes
-rw-r--r--plugin.video.catchuptvandmore/resources/media/channels/ws/allocine_fanart.pngbin0 -> 122243 bytes
-rw-r--r--plugin.video.catchuptvandmore/resources/media/channels/ws/tetesaclaques.pngbin0 -> 178543 bytes
-rw-r--r--plugin.video.catchuptvandmore/resources/media/channels/ws/tetesaclaques_fanart.pngbin0 -> 198798 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/screenshots/screenshot-01.jpgbin534015 -> 534015 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/screenshots/screenshot-02.jpgbin543386 -> 543386 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/screenshots/screenshot-03.jpgbin532567 -> 532567 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/screenshots/screenshot-04.jpgbin809400 -> 809400 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/screenshots/screenshot-05.jpgbin849740 -> 849740 bytes
-rw-r--r--[-rwxr-xr-x]plugin.video.catchuptvandmore/resources/settings.xml49
-rw-r--r--plugin.video.disclosetv/LICENSE674
-rw-r--r--plugin.video.disclosetv/README.md1
-rw-r--r--plugin.video.disclosetv/addon.xml29
-rw-r--r--plugin.video.disclosetv/default.py23
-rw-r--r--plugin.video.disclosetv/resources/__init__.py0
-rw-r--r--plugin.video.disclosetv/resources/images/fanart.jpgbin0 -> 104590 bytes
-rw-r--r--plugin.video.disclosetv/resources/images/icon.pngbin0 -> 24557 bytes
-rw-r--r--plugin.video.disclosetv/resources/images/screenshot01.pngbin0 -> 511182 bytes
-rw-r--r--plugin.video.disclosetv/resources/images/screenshot02.pngbin0 -> 802901 bytes
-rw-r--r--plugin.video.disclosetv/resources/images/screenshot03.pngbin0 -> 731163 bytes
-rw-r--r--plugin.video.disclosetv/resources/language/resource.language.en_gb/strings.po29
-rw-r--r--plugin.video.disclosetv/resources/lib/__init__.py0
-rw-r--r--plugin.video.disclosetv/resources/lib/disclosetv.py189
-rw-r--r--plugin.video.disclosetv/resources/settings.xml5
-rw-r--r--plugin.video.iplayerwww/addon.xml5
-rw-r--r--plugin.video.iplayerwww/resources/icon.pngbin27305 -> 21971 bytes
-rw-r--r--plugin.video.iplayerwww/resources/lib/ipwww_video.py104
-rw-r--r--plugin.video.kla.tv/addon.py14
-rw-r--r--plugin.video.kla.tv/addon.xml18
-rw-r--r--plugin.video.kla.tv/resources/language/resource.language.de_de/strings.po10
-rw-r--r--plugin.video.kla.tv/resources/language/resource.language.en_gb/strings.po10
-rw-r--r--plugin.video.kla.tv/resources/language/resource.language.fr_fr/strings.po10
-rw-r--r--plugin.video.kla.tv/resources/language/resource.language.it_it/strings.po47
-rw-r--r--plugin.video.kla.tv/resources/language/resource.language.nl_nl/strings.po47
-rw-r--r--plugin.video.kla.tv/resources/language/resource.language.pl_pl/strings.po10
-rw-r--r--plugin.video.kla.tv/resources/settings.xml4
-rw-r--r--plugin.video.mediacorp/README.txt3
-rw-r--r--plugin.video.mediacorp/addon.xml2
-rw-r--r--plugin.video.mediacorp/changelog.txt1
-rw-r--r--plugin.video.mediacorp/resources/lib/scraper.py2
-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.psvue/addon.xml9
-rw-r--r--plugin.video.psvue/resources/language/resource.language.en_gb/strings.po2
-rw-r--r--plugin.video.psvue/resources/language/resource.language.he_il/strings.po181
-rw-r--r--plugin.video.psvue/resources/lib/ps_vue.py134
-rw-r--r--plugin.video.psvue/resources/lib/sony.py51
-rw-r--r--plugin.video.rtpplay/LICENSE692
-rw-r--r--plugin.video.rtpplay/README.md5
-rw-r--r--plugin.video.rtpplay/addon.xml28
-rw-r--r--plugin.video.rtpplay/changelog.txt77
-rw-r--r--plugin.video.rtpplay/fanart.jpgbin0 -> 96967 bytes
-rw-r--r--plugin.video.rtpplay/icon.pngbin0 -> 27382 bytes
-rw-r--r--plugin.video.rtpplay/main.py16
-rw-r--r--plugin.video.rtpplay/resources/__init__.py0
-rw-r--r--plugin.video.rtpplay/resources/language/resource.language.en_gb/strings.po29
-rw-r--r--plugin.video.rtpplay/resources/lib/__init__.py0
-rw-r--r--plugin.video.rtpplay/resources/lib/kodilogging.py43
-rw-r--r--plugin.video.rtpplay/resources/lib/kodiutils.py83
-rw-r--r--plugin.video.rtpplay/resources/lib/plugin.py97
-rw-r--r--plugin.video.rtpplay/resources/settings.xml5
-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.thinktv/LICENSE.txt282
-rw-r--r--plugin.video.thinktv/README.txt17
-rw-r--r--plugin.video.thinktv/addon.xml27
-rw-r--r--plugin.video.thinktv/changelog.txt10
-rw-r--r--plugin.video.thinktv/default.py13
-rw-r--r--plugin.video.thinktv/fanart.jpgbin0 -> 138931 bytes
-rw-r--r--plugin.video.thinktv/icon.pngbin0 -> 45140 bytes
-rw-r--r--plugin.video.thinktv/resources/__init__.py1
-rw-r--r--plugin.video.thinktv/resources/language/resource.language.en_gb/strings.po134
-rw-r--r--plugin.video.thinktv/resources/lib/__init__.py1
-rw-r--r--plugin.video.thinktv/resources/lib/scraper.py316
-rw-r--r--plugin.video.thinktv/resources/settings.xml19
-rw-r--r--plugin.video.vrt.nu/addon.py24
-rw-r--r--plugin.video.vrt.nu/addon.xml4
-rw-r--r--plugin.video.vrt.nu/resources/lib/helperobjects/helperobjects.py8
-rw-r--r--plugin.video.vrt.nu/resources/lib/kodiwrappers/kodiwrapper.py20
-rw-r--r--plugin.video.vrt.nu/resources/lib/vrtplayer/metadatacreator.py2
-rw-r--r--plugin.video.vrt.nu/resources/lib/vrtplayer/urltostreamservice.py18
-rw-r--r--plugin.video.vrt.nu/resources/lib/vrtplayer/vrtplayer.py62
241 files changed, 7798 insertions, 941 deletions
diff --git a/.tests b/.tests
-Subproject 749ab0cbaa6c42a30b5e4f33bd3acbcae59ac4e
+Subproject 36f9831a41de119feb8cb91c108305db00fcfc8
diff --git a/.travis.yml b/.travis.yml
index 33caa66..47f570f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,5 +7,5 @@ install:
# command to run our tests
script:
- - cd .tests
- - python check_repo.py \ No newline at end of file
+ - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then python .tests/check_repo.py; fi'
+ - 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then python .tests/check_repo.py $(git diff --name-only HEAD~ | grep / | cut -d / -f1 | sort | uniq); fi'
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..ac0db52
--- /dev/null
+++ b/plugin.video.btsportvideo/addon.py
@@ -0,0 +1,152 @@
+###############################################################################
+#
+# 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.'
+from datetime import datetime
+import operator
+import _strptime # pylint: disable=unused-import
+
+from kodiswift import Plugin
+
+from resources.lib import api
+
+
+PAGE_SIZE = 9
+
+plugin = Plugin(addon_id='plugin.video.btsportvideo')
+
+
+def categories():
+ yield {'label': u'[B]{}[/B]'.format(plugin.get_string(30002)),
+ 'path': plugin.url_for('search')}
+ yield {'label': u'[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
+ )
+
+
+def previous_search_items():
+ for search_term, _timestamp in sorted(plugin.get_storage('searches').items(),
+ key=operator.itemgetter(1),
+ reverse=True):
+ yield {
+ 'label': search_term,
+ 'path': plugin.url_for('show_search_results_first_page', term=search_term)
+ }
+
+
+@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/<term>', name='show_search_results_first_page',
+ options={'update_listing': False})
+@plugin.route('/search/term/<term>/<page>')
+def show_search_results(term, page='1', update_listing=True):
+ plugin.get_storage('searches')[term] = datetime.now()
+ return show_videos(api.search_results, 'show_search_results', int(page),
+ update_listing, term=term)
+
+
+@plugin.route('/search/input')
+def new_search():
+ term = plugin.keyboard(heading=plugin.get_string(30002))
+ if term:
+ url = plugin.url_for('show_search_results_first_page', term=term)
+ plugin.request.url = url
+ return plugin.redirect(url)
+ return plugin.redirect(plugin.url_for('search'))
+
+
+@plugin.route('/search')
+def search():
+ yield {
+ 'label': u'[B]{}[/B]'.format(plugin.get_string(30005)),
+ 'path': plugin.url_for('new_search')
+ }
+ for item in previous_search_items():
+ yield item
+
+
+if __name__ == '__main__':
+ import rollbar.kodi
+ try:
+ plugin.run()
+ except Exception as exc:
+ plugin.log.error(traceback.format_exc())
+ if rollbar.kodi.error_report_requested(exc):
+ rollbar.kodi.report_error(
+ access_token='cc56a52c62c5418ebc87f97b1aa44669',
+ version=plugin.addon.getAddonInfo('version'),
+ url=plugin.request.url
+ )
diff --git a/plugin.video.btsportvideo/addon.xml b/plugin.video.btsportvideo/addon.xml
new file mode 100644
index 0000000..7ef46dc
--- /dev/null
+++ b/plugin.video.btsportvideo/addon.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<addon id="plugin.video.btsportvideo" name="BT Sport Video" version="0.2.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 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>
+ <forum>https://forum.kodi.tv/showthread.php?tid=325188</forum>
+ <assets>
+ <icon>resources/icon.png</icon>
+ <fanart>resources/fanart.jpg</fanart>
+ <screenshot>resources/screenshot001.png</screenshot>
+ <screenshot>resources/screenshot002.png</screenshot>
+ <screenshot>resources/screenshot003.png</screenshot>
+ </assets>
+ <news>Added a search history</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..e7355e7
--- /dev/null
+++ b/plugin.video.btsportvideo/resources/language/resource.language.en_gb/strings.po
@@ -0,0 +1,37 @@
+# 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 ""
+
+msgctxt "#30005"
+msgid "New Search"
+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..22a8e10
--- /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=video.get('publicationdate') and _date_from_str(video['publicationdate']),
+ duration=video.get('duration') and 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.btsportvideo/resources/screenshot001.png b/plugin.video.btsportvideo/resources/screenshot001.png
new file mode 100644
index 0000000..40d008a
--- /dev/null
+++ b/plugin.video.btsportvideo/resources/screenshot001.png
Binary files differ
diff --git a/plugin.video.btsportvideo/resources/screenshot002.png b/plugin.video.btsportvideo/resources/screenshot002.png
new file mode 100644
index 0000000..f76eddb
--- /dev/null
+++ b/plugin.video.btsportvideo/resources/screenshot002.png
Binary files differ
diff --git a/plugin.video.btsportvideo/resources/screenshot003.png b/plugin.video.btsportvideo/resources/screenshot003.png
new file mode 100644
index 0000000..1acdade
--- /dev/null
+++ b/plugin.video.btsportvideo/resources/screenshot003.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/LICENSE.txt b/plugin.video.catchuptvandmore/LICENSE.txt
index 0d6e108..0d6e108 100755..100644
--- 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 fb92358..158525e 100755..100644
--- a/plugin.video.catchuptvandmore/README.md
+++ b/plugin.video.catchuptvandmore/README.md
@@ -3,13 +3,24 @@
## Descritpion
Catch-Up TV & More est un plugin vidéo pour le media center Kodi (ex XBMC).
-Cette extension regroupe l'ensemble des vidéos des différents services et chaînes de Replay TV (rattrapage TV). De plus, cette extension vous permet d'accéder rapidement aux vidéos et contenus proposés par certains sites internet (à venir).
+Cette extension regroupe l'ensemble des vidéos des différents services et chaînes de Replay TV (rattrapage TV). De plus, cette extension vous permet d'accéder rapidement aux vidéos et contenus proposés par certains sites internet.
Catch-Up TV & More est compatible avec la dernière version de Kodi (Kodi 17 Krypton).
*Catch-Up TV & More is a video addon for the Kodi media center (former XBMC).*
-*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).*
+*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.*
## Chaînes disponibles — *Available channels*
+### Angleterre — *United Kingdom*
+- Blaze *(Replay, Live TV)*
+- Dave *(Replay with UKTVPlay account)*
+- Drama *(Replay with UKTVPlay account)*
+- Really *(Replay with UKTVPlay account)*
+- Yesterday *(Replay with UKTVPlay account)*
+
+### Belgique — *Belgium*
+##### TV Communauté française — *French Community TV*
+- RTBF Auvio (La Une, La Deux, La Trois, ...) *(Replay, Live TV)*
+
### Europe
- Arte *(Replay, Live TV)*
- Euronews *(Live TV)*
@@ -57,17 +68,23 @@ Catch-Up TV & More est compatible avec la dernière version de Kodi (Kodi 17 Kry
- Comic — 6play *(Replay)*
- Tfou — MyTF1 *(Replay)*
- Xtra — MyTF1 *(Replay)*
-- 01Net TV
-
-### Belgique — *Belgium*
-- *à venir* — *coming soon*
+- 01Net TV *(Replay)*
### Sites internet — *Websites*
-- *à venir* — *coming soon*
+#### Canada
+##### Communauté française — *French Community*
+- Au pays des Têtes à claques <https://www.tetesaclaques.tv/>
+
+#### France
+- Allociné <http://www.allocine.fr/>
## Bugs et améliorations — *Bugs and improvements*
Retours de bugs, propositions d'améliorations ou d'ajout de contenus sont les bienvenue ! GitHub ou e-mail.
*Bug reports, suggestions for improvements or content additions are welcome! GitHub or e-mail.*
-## French Forum
+## Forums
+### Français — *French*
<https://forum.mpdb.tv/index.php/topic,35713.0.html>
+
+### Anglais — *English*
+<https://forum.kodi.tv/showthread.php?tid=307107>
diff --git a/plugin.video.catchuptvandmore/addon.py b/plugin.video.catchuptvandmore/addon.py
index 57eeee4..ec67d8d 100755..100644
--- a/plugin.video.catchuptvandmore/addon.py
+++ b/plugin.video.catchuptvandmore/addon.py
@@ -301,7 +301,8 @@ def hide(params):
@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
+ # 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)
@@ -313,7 +314,7 @@ def download_video(params):
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
+ with YDStreamUtils.DownloadProgress() as prog:
try:
YDStreamExtractor.setOutputCallback(prog)
result = YDStreamExtractor.downloadVideo(vid, path)
diff --git a/plugin.video.catchuptvandmore/addon.xml b/plugin.video.catchuptvandmore/addon.xml
index 5e7bda0..b69f895 100755..100644
--- a/plugin.video.catchuptvandmore/addon.xml
+++ b/plugin.video.catchuptvandmore/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.catchuptvandmore"
name="Catch-up TV &amp; More"
- version="0.1.3"
+ version="0.1.4"
provider-name="SylvainCecchetto">
<requires>
<!-- TODO before official repo submission: xbmc.python version="2.25.0"/> -->
@@ -20,6 +20,9 @@
<summary lang="en_gb">Catch-Up TV &amp; More: It's all in the title.</summary>
<description lang="en_gb">Catch-Up TV &amp; More brings together in one Kodi plugin 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.</description>
<disclaimer lang="en_gb">Bug reports, suggestions for improvements or content additions are welcome! GitHub or e-mail.</disclaimer>
+ <description lang="he_il">ההרחבה מאפשרת לך להתעדכן בתוכן השידורים תוסף אחד של קודי מרכז את כל קטעי וידאו של שירותים שונים וערוצי תוכן משודר. בנוסף, תוספת זו מאפשרת לך לגשת במהירות לסרטונים ולתכנים המוצעים על ידי אתרים מסוימים.</description>
+ <disclaimer lang="he_il">דוחות שגיאה, הצעות לשיפור או תוספות תוכן יתקבלו בברכה! ל-GitHub או אימייל.</disclaimer>
+
<language>fr</language>
<platform>all</platform>
<license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license>
@@ -28,37 +31,27 @@
<email>catch.up.tv.and.more [AT] gmail [DOT] com</email>
<source>https://github.com/SylvainCecchetto/plugin.video.catchuptvandmore</source>
<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)
+[Add channel — Live TV] Blaze (UK) (wwark)
+[Add channel — Live TV] RTBF (BE) (La Une, La Deux, La Trois, ...) (wwark)
+[Add channel] Dave (UK) (wwark)
+[Add channel] Drama (UK) (wwark)
+[Add channel] Really (UK) (wwark)
+[Add channel] Yesterday (UK) (wwark)
+[Fix] Get Meteo Video for Channel TF1 (wwark)
+[Fix] Program without videos for Group TF1 (wwark)
+[Improvement] Detect DRM video for Group TF1 and send notification (wwark)
+[Improvement] Add More Videos button for Group TF1 (wwark)
+[Improvement] Add Spanish content, Last News, Last Weather, Last Business for Channel France 24 (wwark)
+[Add WebSite] Allociné (wwark)
+[Fix] Change API to get the video for Group M6 (kagonia from mpdb.tv)
+[Add WebSite] tetesaclaques.tv (wwark)
+[Fix] Video without date for Channel Numero 23 (wwark)
+[Improvement] Detect premium video and send notification for Group M6 (wwark)
+[Improvement] Update simpleplugin module and used mem_cache for all websites and channels. Gain little speedup (wwark)
+[Fix] Change website for Replay LCI (wwark)
+[Update] Verify Pep8 in all files (SylvainCecchetto)
+[Update] Fanart, Image for channel (SylvainCecchetto)
+[Improvement] Remove choice if there is just replay or live tv for a channel (SylvainCecchetto)
</news>
<assets>
<icon>icon.png</icon>
diff --git a/plugin.video.catchuptvandmore/fanart.jpg b/plugin.video.catchuptvandmore/fanart.jpg
index 2d2fc2f..2d2fc2f 100755..100644
--- 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 100755..100644
--- 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 100755..100644
--- 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 0fb703f..cff1272 100755..100644
--- a/plugin.video.catchuptvandmore/resources/language/resource.language.en_gb/strings.po
+++ b/plugin.video.catchuptvandmore/resources/language/resource.language.en_gb/strings.po
@@ -75,6 +75,10 @@ msgctxt "#30025"
msgid "United States channels"
msgstr ""
+msgctxt "#30026"
+msgid "Websites"
+msgstr ""
+
# Context menu (from 30040 to 30049)
msgctxt "#30040"
msgid "Move down"
@@ -92,6 +96,7 @@ msgctxt "#30043"
msgid "Download"
msgstr ""
+
# Dialog boxes (from 30050 to 30069)
msgctxt "#30050"
msgid "Information"
@@ -116,7 +121,7 @@ msgid "Arte: Choose Channel"
msgstr ""
msgctxt "#30081"
-msgid "France24: Choose Channel"
+msgid "France 24: Choose Channel"
msgstr ""
msgctxt "#30082"
@@ -173,6 +178,14 @@ msgctxt "#30110"
msgid "Choose video quality"
msgstr ""
+msgctxt "#30111"
+msgid "Video stream no longer exists"
+msgstr ""
+
+msgctxt "#30112"
+msgid "Video with an account needed"
+msgstr ""
+
# Download (from 30200 to 30240)
msgctxt "#30200"
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 ee2e81c..de0143c 100755..100644
--- a/plugin.video.catchuptvandmore/resources/language/resource.language.fr_fr/strings.po
+++ b/plugin.video.catchuptvandmore/resources/language/resource.language.fr_fr/strings.po
@@ -75,6 +75,10 @@ msgctxt "#30025"
msgid "United States channels"
msgstr "Chaînes américaines"
+msgctxt "#30026"
+msgid "Websites"
+msgstr "Sites Web"
+
# Context menu (from 30040 to 30049)
msgctxt "#30040"
msgid "Move down"
@@ -114,15 +118,15 @@ msgstr "Contenus"
msgctxt "#30080"
msgid "Arte: Choose Channel"
-msgstr "Arte : Choix de la chaîne"
+msgstr "Arte: Choix de la chaîne"
msgctxt "#30081"
-msgid "France24: Choose Channel"
-msgstr "France24 : Choix de la chaîne"
+msgid "France 24: Choose Channel"
+msgstr "France 24: Choix de la chaîne"
msgctxt "#30082"
msgid "Euronews: Choose Channel"
-msgstr "Euronews : Choix de la chaîne"
+msgstr "Euronews: Choix de la chaîne"
msgctxt "#30087"
msgid "Video quality (BEST|DEFAULT|DIALOG)"
@@ -173,6 +177,14 @@ msgctxt "#30110"
msgid "Choose video quality"
msgstr "Choisir la qualité vidéo"
+msgctxt "#30111"
+msgid "Video stream no longer exists"
+msgstr "Le flux vidéo n'existe plus"
+
+msgctxt "#30112"
+msgid "Video with an account needed"
+msgstr "Vidéo avec un compte requis"
+
# Download (from 30200 to 30240)
msgctxt "#30200"
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
index 4133130..0c4c4cd 100755..100644
--- a/plugin.video.catchuptvandmore/resources/language/resource.language.he.il/strings.po
+++ b/plugin.video.catchuptvandmore/resources/language/resource.language.he.il/strings.po
@@ -75,6 +75,10 @@ msgctxt "#30025"
msgid "United States channels"
msgstr "ערוצים אמריקאיים"
+msgctxt "#30026"
+msgid "Websites"
+msgstr "אתרי רשת"
+
# Context menu (from 30040 to 30049)
msgctxt "#30040"
msgid "Move down"
@@ -99,7 +103,7 @@ msgstr "מידע"
msgctxt "#30051"
msgid "To re-enable hidden items go to the plugin settings"
-msgstr "כדי להפעיל מחדש את הפריטים המוסתרים, עבור אל ההגדרות של תוסף"
+msgstr "כדי להפעיל מחדש את הפריטים המוסתרים, עבור אל ההגדרות של ההרחבה"
# Settings quality and content (from 30070 to 30099)
@@ -116,8 +120,8 @@ msgid "Arte: Choose Channel"
msgstr "Arte: בחר ערוץ"
msgctxt "#30081"
-msgid "France24: Choose Channel"
-msgstr "France24: בחר ערוץ"
+msgid "France 24: Choose Channel"
+msgstr "France 24: בחר ערוץ"
msgctxt "#30082"
msgid "Euronews: Choose Channel"
@@ -173,6 +177,14 @@ msgctxt "#30110"
msgid "Choose video quality"
msgstr "בחר איכות וידאו"
+msgctxt "#30111"
+msgid "Video stream no longer exists"
+msgstr "הזרמת הווידאו כבר לא קיימת"
+
+msgctxt "#30112"
+msgid "Video with an account needed"
+msgstr "נדרש וידאו שמקושר לחשבון"
+
# Download (from 30200 to 30240)
msgctxt "#30200"
msgid "Folder to Download"
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 100644
index 0000000..0c7932d
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/language/resource.language.he_il/strings.po
@@ -0,0 +1,177 @@
+# Kodi Media Center language file
+# Addon Name: Catch-up TV & More
+# Addon id: plugin.video.catchuptvandmore
+# Addon Provider: SylvainCecchetto
+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: 2017-10-22 09:08+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 100755..100644
--- 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 100755..100644
--- 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/be/__init__.py b/plugin.video.catchuptvandmore/resources/lib/channels/be/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/be/__init__.py
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/be/rtbf.py b/plugin.video.catchuptvandmore/resources/lib/channels/be/rtbf.py
new file mode 100644
index 0000000..91fb046
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/be/rtbf.py
@@ -0,0 +1,348 @@
+# -*- 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
+import re
+import time
+from bs4 import BeautifulSoup as bs
+from resources.lib import utils
+from resources.lib import common
+
+# TO DO
+# Add geoblock (info in JSON)
+# Add Quality Mode
+
+# 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_EMISSIONS_AUVIO = 'https://www.rtbf.be/auvio/emissions'
+
+URL_JSON_EMISSION_BY_ID = 'https://www.rtbf.be/api/media/video?' \
+ 'method=getVideoListByEmissionOrdered&args[]=%s'
+# emission_id
+
+URL_ROOT_IMAGE_RTBF = 'https://ds1.static.rtbf.be'
+
+URL_JSON_LIVE = 'https://www.rtbf.be/api/partner/generic/live/' \
+ 'planninglist?target_site=media&partner_key=%s'
+# partener_key
+
+URL_ROOT_LIVE = 'https://www.rtbf.be/auvio/direct#/'
+
+
+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)
+ else:
+ return None
+
+
+def get_partener_key(params):
+
+ file_path_root_live = utils.download_catalog(
+ URL_ROOT_LIVE,
+ '%s_root_live.html' % params.channel_name,
+ )
+ html_root_live = open(file_path_root_live).read()
+
+ list_js_files = re.compile(
+ r'<script type="text\/javascript" src="(.*?)">'
+ ).findall(html_root_live)
+
+ partener_key_value = ''
+ i = 0
+
+ for js_file in list_js_files:
+ # Get partener key
+ file_path_js = utils.download_catalog(
+ js_file,
+ '%s_partener_key_%s.js' % (params.channel_name, str(i)),
+ )
+ partener_key_js = open(file_path_js).read()
+
+ partener_key = re.compile(
+ 'partner_key: \'(.+?)\'').findall(partener_key_js)
+ if len(partener_key) > 0:
+ partener_key_value = partener_key[0]
+ i = i + 1
+
+ return partener_key_value
+
+
+def format_hours(date):
+ date_list = date.split('T')
+ date_hour = date_list[1][:5]
+ return date_hour
+
+
+def format_day(date):
+ date_list = date.split('T')
+ date_dmy = date_list[0].replace('-', '/')
+ return date_dmy
+
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
+def root(params):
+ 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.mem_cached(common.CACHE_TIME)
+def list_shows(params):
+ shows = []
+
+ if params.next == 'list_shows_1':
+
+ file_path = utils.download_catalog(
+ URL_EMISSIONS_AUVIO,
+ 'url_emissions_auvio.html')
+ emissions_html = open(file_path).read()
+ emissions_soup = bs(emissions_html, 'html.parser')
+ list_emissions = emissions_soup.find_all(
+ 'article', class_="rtbf-media-item col-xxs-12 ")
+
+ for emission in list_emissions:
+
+ emission_id = emission.get('data-id')
+ emission_title = emission.find('h4').get_text().encode('utf-8')
+
+ shows.append({
+ 'label': emission_title,
+ 'url': common.PLUGIN.get_url(
+ emission_title=emission_title,
+ action='channel_entry',
+ emission_id=emission_id,
+ next='list_videos_1',
+ window_title=emission_title
+ )
+ })
+
+ return common.PLUGIN.create_listing(
+ shows,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ )
+ )
+
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
+def list_videos(params):
+ videos = []
+
+ if params.next == 'list_videos_1':
+
+ file_path = utils.download_catalog(
+ URL_JSON_EMISSION_BY_ID % params.emission_id,
+ 'url_videos_emission_%s.html' % params.emission_id)
+ videos_json = open(file_path).read()
+ videos_jsonparser = json.loads(videos_json)
+
+ for video in videos_jsonparser['data']:
+
+ if video["subtitle"]:
+ title = video["title"].encode('utf-8') + \
+ ' - ' + video["subtitle"].encode('utf-8')
+ else:
+ title = video["title"].encode('utf-8')
+ img = URL_ROOT_IMAGE_RTBF + video["thumbnail"]["full_medium"]
+ url_video = video["urlHls"]
+ plot = ''
+ if video["description"]:
+ plot = video["description"].encode('utf-8')
+ duration = 0
+ duration = video["durations"]
+
+ value_date = time.strftime(
+ '%d %m %Y', time.localtime(video["liveFrom"]))
+ 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': plot,
+ # 'episode': episode_number,
+ # 'season': season_number,
+ # 'rating': note,
+ 'aired': aired,
+ 'date': date,
+ 'duration': duration,
+ 'year': year,
+ '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
+ })
+
+ return common.PLUGIN.create_listing(
+ videos,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_DATE
+ ),
+ content='tvshows',
+ update_listing='update_listing' in params)
+
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
+def list_live(params):
+
+ lives = []
+
+ title = ''
+ # subtitle = ' - '
+ plot = ''
+ duration = 0
+ img = ''
+ url_live = ''
+
+ file_path = utils.download_catalog(
+ URL_JSON_LIVE % (get_partener_key(params)),
+ '%s_live.json' % (params.channel_name))
+ live_json = open(file_path).read()
+ live_jsonparser = json.loads(live_json)
+
+ # channel_live_in_process = False
+
+ for live in live_jsonparser:
+
+ if type(live["channel"]) is dict:
+ live_channel = live["channel"]["label"]
+ else:
+ live_channel = 'Exclu Auvio'
+
+ start_date_value = format_hours(live["start_date"])
+ end_date_value = format_hours(live["end_date"])
+ day_value = format_day(live["start_date"])
+
+ title = live_channel + ' : ' + live["title"] + \
+ ' - ' + day_value + ' - ' + start_date_value + '-' + end_date_value
+
+ url_live = ''
+ if live["url_streaming"]:
+ url_live = live["url_streaming"]["url_hls"]
+ plot = live["description"].encode('utf-8')
+ img = live["images"]["illustration"]["16x9"]["1248x702"]
+
+ 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.mem_cached(common.CACHE_TIME)
+def get_video_url(params):
+ if params.next == 'play_l':
+ return params.url_live
+ elif params.next == 'play_r':
+ return params.url_video
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/eu/__init__.py b/plugin.video.catchuptvandmore/resources/lib/channels/eu/__init__.py
index e69de29..e69de29 100755..100644
--- a/plugin.video.catchuptvandmore/resources/lib/channels/eu/__init__.py
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/eu/__init__.py
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/eu/arte.py b/plugin.video.catchuptvandmore/resources/lib/channels/eu/arte.py
index 9fe6d0b..9957f8a 100755..100644
--- a/plugin.video.catchuptvandmore/resources/lib/channels/eu/arte.py
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/eu/arte.py
@@ -41,6 +41,7 @@ URL_REPLAY = 'https://www.arte.tv/papi/tvguide/videos/' \
URL_LIVE_ARTE = 'https://api.arte.tv/api/player/v1/livestream/%s'
# Langue, ...
+
def channel_entry(params):
"""Entry function of the module"""
if 'root' in params.next:
@@ -55,14 +56,15 @@ def channel_entry(params):
return get_video_url(params)
return None
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def root(params):
"""Add Replay and Live in the listing"""
modes = []
# Add Replay
modes.append({
- 'label' : 'Replay',
+ 'label': 'Replay',
'url': common.PLUGIN.get_url(
action='channel_entry',
next='list_shows_1',
@@ -72,7 +74,7 @@ def root(params):
})
modes.append({
- 'label' : 'Live TV',
+ 'label': 'Live TV',
'url': common.PLUGIN.get_url(
action='channel_entry',
next='live_cat',
@@ -89,7 +91,8 @@ def root(params):
),
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_shows(params):
"""Build categories listing"""
shows = []
@@ -118,17 +121,17 @@ def list_shows(params):
emission_dict['image'] = emission['programImage'].encode('utf-8')
try:
emission_dict['genre'] = emission['genre'].encode('utf-8')
- except:
+ except Exception:
emission_dict['genre'] = 'Unknown'
try:
emission_dict['director'] = emission['director'].encode('utf-8')
- except:
+ except Exception:
emission_dict['director'] = ''
emission_dict['production_year'] = emission['productionYear']
emission_dict['program_title'] = emission['VTI'].encode('utf-8')
try:
emission_dict['emission_title'] = emission['VSU'].encode('utf-8')
- except:
+ except Exception:
emission_dict['emission_title'] = ''
emission_dict['category'] = emission['VCH'][0]['label'].encode('utf-8')
@@ -138,7 +141,7 @@ def list_shows(params):
try:
emission_dict['desc'] = emission['VDE'].encode('utf-8')
- except:
+ except Exception:
emission_dict['desc'] = ''
emissions_list.append(emission_dict)
@@ -167,7 +170,7 @@ def list_shows(params):
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_videos(params):
"""Build videos listing"""
videos = []
@@ -227,7 +230,7 @@ def list_videos(params):
),
'is_playable': True,
'info': info,
- 'context_menu': context_menu # A ne pas oublier pour ajouter le bouton "Download" à chaque vidéo
+ 'context_menu': context_menu
})
return common.PLUGIN.create_listing(
@@ -242,7 +245,8 @@ def list_videos(params):
),
content='tvshows')
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_live(params):
"""Build live listing"""
lives = []
@@ -287,7 +291,7 @@ def list_live(params):
'label': title,
'fanart': img,
'thumb': img,
- 'url' : common.PLUGIN.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
next='play_l',
url=url_live,
@@ -304,7 +308,8 @@ def list_live(params):
)
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_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':
@@ -324,20 +329,24 @@ def get_video_url(params):
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.setLabel(
+ datas['mediaType'] + " (" +
+ datas['versionLibelle'] + ")")
new_list_item.setPath(datas['url'])
all_datas_videos.append(new_list_item)
- seleted_item = common.sp.xbmcgui.Dialog().select("Choose Stream", all_datas_videos)
+ seleted_item = common.sp.xbmcgui.Dialog().select(
+ "Choose Stream", all_datas_videos)
- url_selected = all_datas_videos[seleted_item].getPath().encode('utf-8')
+ url_selected = all_datas_videos[seleted_item]
+ url_selected = url_selected.getPath().encode('utf-8')
elif desired_quality == "BEST":
- url_selected = video_streams['HTTP_MP4_SQ_1']['url'].encode('utf-8')
+ url_selected = video_streams['HTTP_MP4_SQ_1']['url']
+ url_selected = url_selected.encode('utf-8')
else:
url_selected = video_streams['HLS_SQ_1']['url'].encode('utf-8')
return url_selected
elif params.next == 'play_l':
return params.url
-
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/eu/euronews.py b/plugin.video.catchuptvandmore/resources/lib/channels/eu/euronews.py
index be0edad..ef4b57d 100755..100644
--- a/plugin.video.catchuptvandmore/resources/lib/channels/eu/euronews.py
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/eu/euronews.py
@@ -37,6 +37,7 @@ _ = 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:
@@ -51,14 +52,16 @@ def channel_entry(params):
return get_video_url(params)
return None
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def root(params):
modes = []
+ """
# Add Replay Desactiver
if params.channel_name != 'euronews':
modes.append({
- 'label' : 'Replay',
+ 'label': 'Replay',
'url': common.PLUGIN.get_url(
action='channel_entry',
next='list_shows_1',
@@ -69,7 +72,7 @@ def root(params):
# Add Live
modes.append({
- 'label' : 'Live TV',
+ 'label': 'Live TV',
'url': common.PLUGIN.get_url(
action='channel_entry',
next='live_cat',
@@ -85,16 +88,24 @@ def root(params):
common.sp.xbmcplugin.SORT_METHOD_LABEL
),
)
+ """
+
+ params.next = "list_live"
+ return channel_entry(params)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_shows(params):
return None
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_videos(params):
+
return None
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_live(params):
lives = []
@@ -142,7 +153,8 @@ def list_live(params):
file_path = utils.download_catalog(
url_live_json,
- '%s_%s_live.json' % (params.channel_name,desired_language.lower())
+ '%s_%s_live.json' % (
+ params.channel_name, desired_language.lower())
)
json_live = open(file_path).read()
json_parser = json.loads(json_live)
@@ -150,7 +162,8 @@ def list_live(params):
file_path_2 = utils.download_catalog(
url_2nd_json,
- '%s_%s_live_2.json' % (params.channel_name,desired_language.lower())
+ '%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)
@@ -169,7 +182,7 @@ def list_live(params):
'label': title,
'fanart': img,
'thumb': img,
- 'url' : common.PLUGIN.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
next='play_l',
url=url_live,
@@ -186,7 +199,8 @@ def list_live(params):
)
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def get_video_url(params):
if params.next == 'play_l':
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/fr/6play.py b/plugin.video.catchuptvandmore/resources/lib/channels/fr/6play.py
index b779d94..2f4d2b1 100755..100644
--- a/plugin.video.catchuptvandmore/resources/lib/channels/fr/6play.py
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/fr/6play.py
@@ -29,6 +29,15 @@ 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
+# Clip and Playlist (cas les blagues de TOTO)
+# Case MP4:
+# https://pc.middleware.6play.fr/6play/v2/platforms/m6group_web/services/6play/videos/playlist_2248?csa=6&with=clips,freemiumpacks,program_images,service_display_images
+# Case without ISM (One flux m3u8) :
+# https://pc.middleware.6play.fr/6play/v2/platforms/m6group_web/services/6play/videos/clip_11740712?csa=6&with=clips,freemiumpacks,program_images,service_display_images
+# Case Video Protected :
+# https://pc.middleware.6play.fr/6play/v2/platforms/m6group_web/services/6play/videos/clip_11288922?csa=6&with=clips,freemiumpacks,program_images,service_display_images
+# Rework Quality Video
+# Get vtt subtitle
# Initialize GNU gettext emulation in addon
# This allows to use UI strings from addon’s English
@@ -46,7 +55,7 @@ URL_ROOT = 'http://pc.middleware.6play.fr/6play/v2/platforms/' \
# We get an id by program
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'
+ '?limit=999&offset=0&csa=6&with=parentcontext'
# Url to get program's subfolders
# e.g. Saison 5, Les meilleurs moments, les recettes pas à pas, ...
@@ -70,7 +79,7 @@ URL_VIDEOS2 = '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'
+ '?csa=6&with=clips,freemiumpacks'
URL_IMG = 'https://images.6play.fr/v1/images/%s/raw'
@@ -85,20 +94,21 @@ def channel_entry(params):
elif 'list_videos' in params.next:
return list_videos(params)
elif 'live' in params.next:
- return list_live(params)
+ return None
elif 'play' in params.next:
return get_video_url(params)
return None
-@common.PLUGIN.cached(common.CACHE_TIME)
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def root(params):
"""Add Replay and Live in the listing"""
+ """
modes = []
# Add Replay
modes.append({
- 'label' : 'Replay',
+ 'label': 'Replay',
'url': common.PLUGIN.get_url(
action='channel_entry',
next='list_shows_1',
@@ -114,8 +124,12 @@ def root(params):
common.sp.xbmcplugin.SORT_METHOD_LABEL
),
)
+ """
+ params.next = "list_shows_1"
+ return channel_entry(params)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_shows(params):
"""Build categories listing"""
shows = []
@@ -123,9 +137,12 @@ def list_shows(params):
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':
+ 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')
@@ -228,7 +245,7 @@ def list_shows(params):
try:
program_fanart = params.program_fanart
- except:
+ except Exception:
program_fanart = ''
for sub_category in json_parser['program_subcats']:
@@ -288,7 +305,7 @@ def list_shows(params):
return shows
-@common.PLUGIN.cached(common.CACHE_TIME)
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_videos(params):
"""Build videos listing"""
videos = []
@@ -320,7 +337,7 @@ def list_videos(params):
year = aired.split('-')[0]
date = '.'.join((day, mounth, year))
- except:
+ except Exception:
aired = ''
year = ''
date = ''
@@ -378,7 +395,7 @@ def list_videos(params):
content='tvshows')
-@common.PLUGIN.cached(common.CACHE_TIME)
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def get_video_url(params):
"""Get video URL and start video player"""
video_json = utils.get_webcontent(
@@ -387,6 +404,9 @@ def get_video_url(params):
json_parser = json.loads(video_json)
video_assets = json_parser['clips'][0]['assets']
+ if video_assets is None:
+ utils.send_notification(common.ADDON.get_localized_string(30112))
+ return ''
url = ''
url2 = ''
url3 = ''
@@ -405,41 +425,10 @@ def get_video_url(params):
manifest_url = url2
else:
manifest_url = url3
-
- manifest = utils.get_webcontent(
- manifest_url,
- random_ua=True)
- if 'drm' in manifest:
- utils.send_notification(common.ADDON.get_localized_string(30102))
- return ''
-
- desired_quality = common.PLUGIN.get_setting(
- params.channel_id + '.quality')
-
- if desired_quality == 'Auto':
- return manifest_url
-
- root = common.os.path.dirname(manifest_url)
-
- url_sd = ''
- url_hd = ''
- url_ultra_sd = ''
- url_ultra_hd = ''
-
- lines = manifest.splitlines()
- for k in range(0, len(lines) - 1):
- if 'RESOLUTION=400' in lines[k]:
- url_ultra_sd = root + '/' + lines[k + 1]
- elif 'RESOLUTION=640' in lines[k]:
- url_sd = root + '/' + lines[k + 1]
- elif 'RESOLUTION=720' in lines[k]:
- url_hd = root + '/' + lines[k + 1]
- elif 'RESOLUTION=1080' in lines[k]:
- url_ultra_hd = root + '/' + lines[k + 1]
-
- desired_quality = common.PLUGIN.get_setting('quality')
-
- if (desired_quality == 'BEST' or desired_quality == 'DIALOG') and url_ultra_hd:
- return url_ultra_hd
- else:
- return manifest_url
+ manifest = utils.get_webcontent(
+ manifest_url,
+ random_ua=True)
+ if 'drm' in manifest:
+ utils.send_notification(common.ADDON.get_localized_string(30102))
+ return ''
+ 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 100755..100644
--- 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 e52cbf4..2059fbd 100755..100644
--- a/plugin.video.catchuptvandmore/resources/lib/channels/fr/bfmtv.py
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/fr/bfmtv.py
@@ -33,7 +33,7 @@ from resources.lib import common
# BFMTV, RMC, ONENET, etc ...
URL_TOKEN = 'http://api.nextradiotv.com/%s-applications/'
-#channel
+# channel
URL_MENU = 'http://www.bfmtv.com/static/static-mobile/bfmtv/' \
'ios-smartphone/v0/configuration.json'
@@ -68,7 +68,8 @@ 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'
+URL_VIDEO_HTML_RMCDECOUVERTE = 'http://rmcdecouverte.bfmtv.com/'\
+ 'mediaplayer-replay/?id=%s'
# VideoId_html
URL_LIVE_RMCDECOUVERTE = 'http://rmcdecouverte.bfmtv.com/mediaplayer-direct/'
@@ -76,7 +77,8 @@ 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'
+URL_VIDEO_JSON_BRIGHTCOVE = 'https://edge.api.brightcove.com/'\
+ 'playback/v1/accounts/%s/videos/%s'
# AccountId, VideoId
# Initialize GNU gettext emulation in addon
@@ -84,7 +86,8 @@ URL_VIDEO_JSON_BRIGHTCOVE = 'https://edge.api.brightcove.com/playback/v1/account
# strings.po file instead of numeric codes
_ = common.ADDON.initialize_gettext()
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def get_token(channel_name):
"""Get session token"""
file_token = utils.get_webcontent(URL_TOKEN % (channel_name))
@@ -92,10 +95,11 @@ def get_token(channel_name):
return token_json['session']['token'].encode('utf-8')
-@common.PLUGIN.cached(common.CACHE_TIME)
+@common.PLUGIN.mem_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))
+ file_js = utils.get_webcontent(
+ URL_JS_POLICY_KEY % (data_account, data_player))
return re.compile('policyKey:"(.+?)"').findall(file_js)[0]
@@ -113,14 +117,15 @@ def channel_entry(params):
return get_video_url(params)
return None
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def root(params):
"""Add Replay and Live in the listing"""
modes = []
# Add Replay Desactiver
modes.append({
- 'label' : 'Replay',
+ 'label': 'Replay',
'url': common.PLUGIN.get_url(
action='channel_entry',
next='list_shows_1',
@@ -132,7 +137,7 @@ def root(params):
# Add Live
if params.channel_name != '01net':
modes.append({
- 'label' : 'Live TV',
+ 'label': 'Live TV',
'url': common.PLUGIN.get_url(
action='channel_entry',
next='live_cat',
@@ -149,7 +154,8 @@ def root(params):
),
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_shows(params):
"""Build categories listing"""
shows = []
@@ -166,8 +172,12 @@ def list_shows(params):
'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_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(
@@ -193,7 +203,8 @@ def list_shows(params):
else:
if params.next == 'list_shows_1':
file_path = utils.download_catalog(
- URL_REPLAY % (params.channel_name, get_token(params.channel_name)),
+ 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)
@@ -227,7 +238,7 @@ def list_shows(params):
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_videos(params):
"""Build videos listing"""
videos = []
@@ -259,12 +270,12 @@ def list_videos(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_title = program_title + \
+ json_parser["name"].encode('utf-8').lower()
video_img = ''
for poster in json_parser["poster_sources"]:
video_img = poster["src"]
@@ -344,11 +355,12 @@ def list_videos(params):
category = video['category'].encode('utf-8')
title = video['title'].encode('utf-8')
description = video['description'].encode('utf-8')
- begin_date = video['begin_date'] # 1486725600,
+ # 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"]))
+ value_date = time.strftime(
+ '%d %m %Y', time.localtime(video["begin_date"]))
date = str(value_date).split(' ')
day = date[0]
mounth = date[1]
@@ -423,7 +435,7 @@ def list_videos(params):
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_live(params):
"""Build live listing"""
lives = []
@@ -480,7 +492,7 @@ def list_live(params):
'label': title,
'fanart': img,
'thumb': img,
- 'url' : common.PLUGIN.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
next='play_l',
url_live=url_live,
@@ -515,7 +527,7 @@ def list_live(params):
'label': title,
'fanart': img,
'thumb': img,
- 'url' : common.PLUGIN.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
next='play_l',
url_live=url_live,
@@ -524,22 +536,27 @@ def list_live(params):
'info': info
})
- #BFM PARIS
+ # 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_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']
+ 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),
+ 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',
@@ -554,7 +571,8 @@ def list_live(params):
title_paris = json_parser_paris["name"]
plot_paris = ''
if json_parser_paris["long_description"]:
- plot_paris = json_parser_paris["long_description"].encode('utf-8')
+ plot_paris = json_parser_paris["long_description"]
+ plot_paris = plot_paris.encode('utf-8')
for url_paris in json_parser_paris["sources"]:
url_live_paris = url_paris["src"].encode('utf-8')
@@ -571,7 +589,7 @@ def list_live(params):
'label': title_paris,
'fanart': img,
'thumb': img,
- 'url' : common.PLUGIN.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
next='play_l',
url_live=url_live_paris,
@@ -582,7 +600,7 @@ def list_live(params):
elif params.channel_name == 'bfmbusiness':
- #BFM BUSINESS
+ # BFM BUSINESS
file_path = utils.download_catalog(
URL_LIVE_BFMBUSINESS,
'%s_live.html' % (params.channel_name))
@@ -630,7 +648,7 @@ def list_live(params):
'label': title,
'fanart': img,
'thumb': img,
- 'url' : common.PLUGIN.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
next='play_l',
url_live=url_live,
@@ -641,7 +659,7 @@ def list_live(params):
elif params.channel_name == 'rmc':
- #BFM SPORT
+ # BFM SPORT
file_path = utils.download_catalog(
URL_LIVE_BFM_SPORT,
'bfm_sport_live.html')
@@ -690,7 +708,7 @@ def list_live(params):
'label': title,
'fanart': img,
'thumb': img,
- 'url' : common.PLUGIN.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
next='play_l',
url_live=url_live,
@@ -713,18 +731,23 @@ def list_live(params):
)
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_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':
+ 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'):
+ 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))
+ URL_VIDEO % (
+ params.channel_name,
+ get_token(params.channel_name), params.video_id))
json_parser = json.loads(file_medias)
if params.next == 'download_video':
@@ -739,22 +762,23 @@ def get_video_url(params):
for datas in video_streams:
new_list_item = common.sp.xbmcgui.ListItem()
new_list_item.setLabel(
- "Video Height : " + str(datas['frame_height']) + \
+ "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)
+ 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)
+ # 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
+ # DEFAULT VIDEO
return json_parser['video']['video_url'].encode('utf-8')
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/fr/france24.py b/plugin.video.catchuptvandmore/resources/lib/channels/fr/france24.py
index 6d61ec9..a7a65c5 100755..100644
--- a/plugin.video.catchuptvandmore/resources/lib/channels/fr/france24.py
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/fr/france24.py
@@ -25,14 +25,14 @@ import time
import re
import json
from bs4 import BeautifulSoup as bs
+from youtube_dl import YoutubeDL
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)
+# 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
@@ -45,10 +45,12 @@ URL_LIVE_SITE = 'http://www.france24.com/%s/'
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' \
+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:
@@ -61,32 +63,52 @@ def channel_entry(params):
return list_live(params)
elif 'play' in params.next:
return get_video_url(params)
+ elif 'list_nwb' in params.next:
+ return list_nwb(params)
return None
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def root(params):
"""Add Replay and Live in the listing"""
modes = []
+ desired_language = common.PLUGIN.get_setting(
+ params.channel_id + '.language')
+
# 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()
- ),
- })
+ if desired_language != 'ES':
+ 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 desired_language != 'ES':
+ 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()
+ ),
+ })
+
modes.append({
- 'label' : 'Live TV',
+ 'label': 'News - Weather - Business',
'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()
+ next='list_nwb_1',
+ category='%s News - Weather - Business' % (
+ params.channel_name.upper()),
+ window_title='%s News - Weather - Business' % (
+ params.channel_name.upper())
),
})
@@ -98,7 +120,8 @@ def root(params):
),
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_shows(params):
"""Build shows listing"""
shows = []
@@ -108,13 +131,17 @@ def list_shows(params):
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())
+ 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"]
+ list_caterories = json_parser["result"]
+ list_caterories = list_caterories["f24%s" % desired_language.lower()]
+ list_caterories = list_caterories["list"]
for category in list_caterories:
category_name = category["title"].encode('utf-8')
@@ -144,7 +171,8 @@ def list_shows(params):
),
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_videos(params):
"""Build videos listing"""
videos = []
@@ -159,7 +187,9 @@ def list_videos(params):
json_vod = open(file_path).read()
json_parser = json.loads(json_vod)
- list_caterories = json_parser["result"]["f24%s" % desired_language.lower()]["list"]
+ list_caterories = json_parser["result"]
+ list_caterories = list_caterories["f24%s" % desired_language.lower()]
+ list_caterories = list_caterories["list"]
for category in list_caterories:
if str(params.nid) == str(category["nid"]):
for video in category["editions"]["list"]:
@@ -169,7 +199,8 @@ def list_videos(params):
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"])))
+ value_date = time.strftime(
+ '%d %m %Y', time.localtime(int(video["created"])))
date = str(value_date).split(' ')
day = date[0]
mounth = date[1]
@@ -182,9 +213,9 @@ def list_videos(params):
'title': title,
'aired': aired,
'date': date,
- #'duration': video_duration,
+ # 'duration': video_duration,
'year': year,
- 'plot' : plot,
+ 'plot': plot,
'mediatype': 'tvshow'
}
}
@@ -212,7 +243,6 @@ def list_videos(params):
'context_menu': context_menu
})
-
# TO DO add More button Video
return common.PLUGIN.create_listing(
@@ -223,7 +253,8 @@ def list_videos(params):
),
content='tvshows')
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_live(params):
"""Build live listing"""
lives = []
@@ -246,14 +277,18 @@ def list_live(params):
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']
+ json_parser = json.loads(
+ root_soup.select_one("script[type=application/json]").text)
+ media_datas_list = json_parser['medias']['media']
+ media_datas_list = media_datas_list['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]
+ 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': {
@@ -267,7 +302,7 @@ def list_live(params):
'label': title,
'fanart': img,
'thumb': img,
- 'url' : common.PLUGIN.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
next='play_l',
url=url_live,
@@ -284,11 +319,100 @@ def list_live(params):
)
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
+def list_nwb(params):
+ """Build News - Weather - Business listing"""
+ nbe = []
+
+ desired_language = common.PLUGIN.get_setting(
+ params.channel_id + '.language')
+
+ url_news = ''
+ url_weather = ''
+ url_business = ''
+
+ if 'FR' == desired_language:
+ url_news = URL_LIVE_SITE % desired_language.lower() + \
+ 'vod/journal-info'
+ url_weather = URL_LIVE_SITE % desired_language.lower() + \
+ 'vod/meteo-internationale'
+ url_business = URL_LIVE_SITE % desired_language.lower() + \
+ 'vod/journal-economie'
+ elif 'ES' == desired_language:
+ url_news = URL_LIVE_SITE % desired_language.lower() + \
+ 'vod/ultimo-noticiero'
+ url_weather = URL_LIVE_SITE % desired_language.lower() + \
+ 'vod/el-tiempo'
+ url_business = URL_LIVE_SITE % desired_language.lower() + \
+ 'vod/economia'
+ elif 'EN' == desired_language or 'AR' == desired_language:
+ url_news = URL_LIVE_SITE % desired_language.lower() + \
+ 'vod/latest-news'
+ url_weather = URL_LIVE_SITE % desired_language.lower() + \
+ 'vod/international-weather-forecast'
+ url_business = URL_LIVE_SITE % desired_language.lower() + \
+ 'vod/business-news'
+
+ url_nbe_list = []
+ url_nbe_list.append(url_news)
+ url_nbe_list.append(url_weather)
+ url_nbe_list.append(url_business)
+
+ ydl = YoutubeDL()
+
+ for url_nbe in url_nbe_list:
+ url_nbe_html = utils.get_webcontent(url_nbe)
+ root_soup = bs(url_nbe_html, 'html.parser')
+ url_nbe_yt_html = utils.get_webcontent(
+ root_soup.find(
+ 'div', class_='yt-vod-container').find('iframe').get('src'))
+ url_yt = re.compile(
+ '<link rel="canonical" href="(.*?)"').findall(url_nbe_yt_html)[0]
+ ydl.add_default_info_extractors()
+ with ydl:
+ result = ydl.extract_info(url_yt, download=False)
+ for format_video in result['formats']:
+ url_nbe_stream = format_video['url']
+ title = result['title']
+ plot = ''
+ duration = 0
+ img = result['thumbnail']
+
+ info = {
+ 'video': {
+ 'title': title,
+ 'plot': plot,
+ 'duration': duration
+ }
+ }
+
+ nbe.append({
+ 'label': title,
+ 'fanart': img,
+ 'thumb': img,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='play_r',
+ url=url_nbe_stream,
+ ),
+ 'is_playable': True,
+ 'info': info
+ })
+
+ return common.PLUGIN.create_listing(
+ nbe,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ )
+ )
+
+
+@common.PLUGIN.mem_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
index f2e5f84..ecedfdb 100755..100644
--- a/plugin.video.catchuptvandmore/resources/lib/channels/fr/groupecanal.py
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/fr/groupecanal.py
@@ -30,7 +30,8 @@ from resources.lib import common
# TO DO
-# Replay (More Refactoring todo) / Find API for all channel (JSON) get Replay/Live ?
+# Replay (More Refactoring todo) /
+# Find API for all channel (JSON) get Replay/Live ?
# Get URL Live FROM SITE
# QUALITY
# Add Button "More Videos"
@@ -49,14 +50,17 @@ 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'
+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'
+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'
+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
@@ -65,7 +69,8 @@ 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'
+URL_INFO_CONTENT = 'http://service.canal-plus.com/' \
+ 'video/rest/getvideos/%s/%s?format=json'
CHANNEL_NAME_CATALOG = {
'cplus': 'cplus',
@@ -79,6 +84,7 @@ CHANNEL_NAME_CATALOG = {
# 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:
@@ -93,14 +99,17 @@ def channel_entry(params):
return get_video_url(params)
return None
+
+""" Unused
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)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def get_channel_id(params):
"""Get channel id by name"""
if params.channel_name == 'c8':
@@ -108,14 +117,15 @@ def get_channel_id(params):
elif params.channel_name == 'cstar':
return '2'
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def root(params):
"""Add Replay and Live in the listing"""
modes = []
# Add Replay
modes.append({
- 'label' : 'Replay',
+ 'label': 'Replay',
'url': common.PLUGIN.get_url(
action='channel_entry',
next='list_shows_1',
@@ -126,7 +136,7 @@ def root(params):
# Add Live
modes.append({
- 'label' : _('Live TV'),
+ 'label': _('Live TV'),
'url': common.PLUGIN.get_url(
action='channel_entry',
next='live_cat',
@@ -143,12 +153,13 @@ def root(params):
),
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_shows(params):
"""Create categories list"""
shows = []
- ################### BEGIN CNEWS ###########################
+ # ################## BEGIN CNEWS ###########################
if params.next == 'list_shows_1' and params.channel_name == 'cnews':
file_path = utils.download_catalog(
@@ -165,7 +176,8 @@ def list_shows(params):
for category in categories_soup:
category_name = category.get_text().encode('utf-8')
- category_url = (URL_ROOT_SITE % params.channel_name) + category.get('href')
+ category_url = (
+ URL_ROOT_SITE % params.channel_name) + category.get('href')
if category_name != 'Les tops':
shows.append({
@@ -186,7 +198,7 @@ def list_shows(params):
file_path = utils.download_catalog(
params.category_url,
'%s_%s.html' % (
- params.channel_name,params.category_name))
+ 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")
@@ -194,7 +206,8 @@ def list_shows(params):
for category in categories_soup:
category_name = category.get_text().encode('utf-8')
- category_url = (URL_ROOT_SITE % params.channel_name) + category.get('href')
+ category_url = (
+ URL_ROOT_SITE % params.channel_name) + category.get('href')
shows.append({
'label': category_name,
@@ -221,7 +234,10 @@ def list_shows(params):
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_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({
@@ -238,12 +254,12 @@ def list_shows(params):
)
})
+ # ################## END CNEWS ###########################
- ################### END CNEWS ###########################
-
- ################### BEGIN C8 and CStar ##################
- elif params.next == 'list_shows_1' and (params.channel_name == 'c8' or \
- params.channel_name == 'cstar'):
+ # ################## 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))
@@ -265,8 +281,9 @@ def list_shows(params):
)
})
- elif params.next == 'list_shows_2' and (params.channel_name == 'c8' or \
- params.channel_name == 'cstar'):
+ 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),
@@ -294,9 +311,9 @@ def list_shows(params):
window_title=title
)
})
- ################### END C8 and CStar ##################
+ # ################## END C8 and CStar ##################
- ################### BEGIN CANAL + ##################
+ # ################## BEGIN CANAL + ##################
elif params.next == 'list_shows_1' and params.channel_name == 'cplus':
file_path = utils.download_catalog(
@@ -333,7 +350,7 @@ def list_shows(params):
file_path = utils.download_catalog(
params.category_url,
'%s_%s.html' % (
- params.channel_name,params.category_name))
+ params.channel_name, params.category_name))
root_html = open(file_path).read()
root_soup = bs(root_html, 'html.parser')
@@ -355,7 +372,7 @@ def list_shows(params):
)
})
- ################### END CANAL + ##################
+ # ################## END CANAL + ##################
return common.PLUGIN.create_listing(
shows,
@@ -365,21 +382,23 @@ def list_shows(params):
)
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_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 ###########################
+ # ################## 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))
+ '%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')
@@ -388,15 +407,19 @@ def list_videos(params):
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'))
+ # 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
+ # Get Description
datas_video = bs(video_html, 'html.parser')
- description = datas_video.find('article', class_='entry-body').get_text().encode('utf-8')
+ 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('-')
+ 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]
@@ -412,14 +435,14 @@ def list_videos(params):
'date': date,
'duration': duration,
'year': year,
- #'genre': category,
+ # 'genre': category,
'mediatype': 'tvshow'
}
}
context_menu = []
download_video = (
- _('Download'),
+ _('Download'),
'XBMC.RunPlugin(' + common.PLUGIN.get_url(
action='download_video',
id=id) + ')'
@@ -453,12 +476,13 @@ def list_videos(params):
previous_listing=str(videos)
),
})
- ################### END CNEWS ###########################
+ # ################## END CNEWS ###########################
- ################### BEGIN C8 and CStar ##################
+ # ################## 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),
+ 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)
@@ -467,13 +491,15 @@ def list_videos(params):
id = video['ID'].encode('utf-8')
try:
duration = int(video['DURATION'].encode('utf-8'))
- except:
+ except Exception:
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 = video['INFOS'] # 31/12/2017
+ date_video = date_video['DIFFUSION']['DATE']
+ date_video = date_video.encode('utf-8')
+ except Exception:
date_video = "00/00/0000"
day = date_video.split('/')[0]
mounth = date_video.split('/')[1]
@@ -523,14 +549,17 @@ def list_videos(params):
'info': info,
'context_menu': context_menu
})
- ################### END C8 and CStar ##################
+ # ################## END C8 and CStar ##################
- ################### BEGIN Canal + ##################
+ # ################## 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))
+ '%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')
@@ -544,7 +573,10 @@ def list_videos(params):
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")
+ 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:
@@ -553,7 +585,8 @@ def list_videos(params):
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')
+ 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]
@@ -562,18 +595,18 @@ def list_videos(params):
'video': {
'title': title,
'plot': description,
- #'aired': aired,
- #'date': date,
+ # 'aired': aired,
+ # 'date': date,
'duration': duration,
- #'year': year,
- #'genre': category,
+ # 'year': year,
+ # 'genre': category,
'mediatype': 'tvshow'
}
}
context_menu = []
download_video = (
- _('Download'),
+ _('Download'),
'XBMC.RunPlugin(' + common.PLUGIN.get_url(
action='download_video',
id=id) + ')'
@@ -594,7 +627,7 @@ def list_videos(params):
'context_menu': context_menu
})
- ################### END Canal + ##################
+ # ################## END Canal + ##################
return common.PLUGIN.create_listing(
videos,
@@ -610,7 +643,8 @@ def list_videos(params):
update_listing='update_listing' in params,
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_live(params):
"""Build live listing"""
lives = []
@@ -641,12 +675,15 @@ def list_live(params):
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)
+ 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])
+ 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)
@@ -668,7 +705,7 @@ def list_live(params):
'label': title,
'fanart': img,
'thumb': img,
- 'url' : common.PLUGIN.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
next='play_l',
url=url_live,
@@ -685,12 +722,14 @@ def list_live(params):
)
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_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)
+ 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')
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/fr/gulli.py b/plugin.video.catchuptvandmore/resources/lib/channels/fr/gulli.py
index 79dedad..ac14879 100755..100644
--- a/plugin.video.catchuptvandmore/resources/lib/channels/fr/gulli.py
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/fr/gulli.py
@@ -40,11 +40,11 @@ SECRET_KEY = '19nBVBxv791Xs'
CATEGORIES = {}
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'
+ 'call=%%7B%%22api_key%%22:%%22%s%%22,%%22' \
+ 'method%%22:%%22programme.getLatest' \
+ 'Episodes%%22,%%22params%%22:%%7B%%22' \
+ 'program_image_thumb%%22:%%5B310,230%%5D,%%22' \
+ 'category_id%%22:%%22dessins-animes%%22%%7D%%7D'
CATEGORIES['Émissions'] = 'https://sslreplay.gulli.fr/replay/api?' \
'call=%%7B%%22api_key%%22:%%22%s%%22,%%22method' \
@@ -54,11 +54,11 @@ CATEGORIES['Émissions'] = 'https://sslreplay.gulli.fr/replay/api?' \
'emissions%%22%%7D%%7D'
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'
+ 'call=%%7B%%22api_key%%22:%%22%s%%22,%%2' \
+ '2method%%22:%%22programme.getLatest' \
+ 'Episodes%%22,%%22params%%22:%%7B%%22program_' \
+ 'image_thumb%%22:%%5B310,230%%5D,%%22category' \
+ '_id%%22:%%22series%%22%%7D%%7D'
URL_LIST_SHOW = 'https://sslreplay.gulli.fr/replay/api?call=%%7B%%22api_key' \
'%%22:%%22%s%%22,%%22' \
@@ -70,6 +70,7 @@ URL_LIVE_TV = 'http://replay.gulli.fr/Direct'
# program_id
+
def channel_entry(params):
"""Entry function of the module"""
if 'root' in params.next:
@@ -85,7 +86,7 @@ def channel_entry(params):
return None
-@common.PLUGIN.cached(common.CACHE_TIME)
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def get_api_key():
"""Compute the API key"""
date = time.strftime("%Y%m%d")
@@ -94,14 +95,14 @@ def get_api_key():
return 'iphoner_' + key
-@common.PLUGIN.cached(common.CACHE_TIME)
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def root(params):
"""Add Replay and Live in the listing"""
modes = []
# Add Replay
modes.append({
- 'label' : 'Replay',
+ 'label': 'Replay',
'url': common.PLUGIN.get_url(
action='channel_entry',
next='list_shows_1',
@@ -112,7 +113,7 @@ def root(params):
# Add Live
modes.append({
- 'label' : 'Live TV',
+ 'label': 'Live TV',
'url': common.PLUGIN.get_url(
action='channel_entry',
next='live_cat',
@@ -129,7 +130,8 @@ def root(params):
),
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_shows(params):
"""Build categories listing"""
shows = []
@@ -190,7 +192,7 @@ def list_shows(params):
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_videos(params):
"""Build videos listing"""
videos = []
@@ -272,7 +274,7 @@ def list_videos(params):
content='tvshows')
-@common.PLUGIN.cached(common.CACHE_TIME)
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_live(params):
"""Build live listing"""
lives = []
@@ -303,7 +305,8 @@ def list_live(params):
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)
+ 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:
@@ -323,7 +326,7 @@ def list_live(params):
'label': title,
'fanart': img,
'thumb': img,
- 'url' : common.PLUGIN.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
next='play_l',
url_live=url_live,
@@ -340,7 +343,8 @@ def list_live(params):
)
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_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':
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/fr/lcp.py b/plugin.video.catchuptvandmore/resources/lib/channels/fr/lcp.py
index e1065d9..60de692 100755..100644
--- a/plugin.video.catchuptvandmore/resources/lib/channels/fr/lcp.py
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/fr/lcp.py
@@ -47,8 +47,10 @@ 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
+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"""
@@ -63,35 +65,37 @@ def channel_entry(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'
+ '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'
+ '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)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def root(params):
"""Add Replay and Live in the listing"""
modes = []
# Add Replay Desactiver
modes.append({
- 'label' : 'Replay',
+ 'label': 'Replay',
'url': common.PLUGIN.get_url(
action='channel_entry',
next='list_shows_1',
@@ -102,7 +106,7 @@ def root(params):
# Add Live
modes.append({
- 'label' : 'Live TV',
+ 'label': 'Live TV',
'url': common.PLUGIN.get_url(
action='channel_entry',
next='live_cat',
@@ -119,7 +123,8 @@ def root(params):
),
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_shows(params):
"""Build shows listing"""
shows = []
@@ -174,26 +179,27 @@ def list_shows(params):
root_html = open(file_path).read()
root_soup = bs(root_html, 'html.parser')
- emissions_soup = root_soup.find_all('div',class_='content')
+ 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')
+ 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
- )
- })
+ '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,
@@ -203,7 +209,8 @@ def list_shows(params):
)
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_videos(params):
"""Build videos listing"""
videos = []
@@ -227,28 +234,34 @@ def list_videos(params):
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")
+ 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')
+ 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:
+ except Exception:
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
+ 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,
@@ -282,7 +295,7 @@ def list_videos(params):
),
'is_playable': True,
'info': info,
- 'context_menu': context_menu # A ne pas oublier pour ajouter le bouton "Download" à chaque vidéo
+ 'context_menu': context_menu
})
# More videos...
@@ -315,20 +328,24 @@ def list_videos(params):
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")
+ 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()
+ aired = video.find(
+ 'div', class_="content").find(
+ 'div', class_="field field_submitted").get_text()
date = ''
duration = 0
- year = int(aired.split('/',-1)[2])
+ 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,
@@ -362,7 +379,7 @@ def list_videos(params):
),
'is_playable': True,
'info': info,
- 'context_menu': context_menu # A ne pas oublier pour ajouter le bouton "Download" à chaque vidéo
+ 'context_menu': context_menu
})
# More videos...
@@ -382,11 +399,14 @@ def list_videos(params):
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
+ # (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
+ # 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:
@@ -396,7 +416,8 @@ def list_videos(params):
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)
+ url = params.emission_url[:-2] + \
+ '/replay-0?page=' + str(params.page)
file_path = utils.download_catalog(
url,
@@ -407,29 +428,36 @@ def list_videos(params):
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")
+ 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')
+ 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:
+ except Exception:
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
+ 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,
@@ -463,7 +491,7 @@ def list_videos(params):
),
'is_playable': True,
'info': info,
- 'context_menu': context_menu # A ne pas oublier pour ajouter le bouton "Download" à chaque vidéo
+ 'context_menu': context_menu
})
# More videos...
@@ -494,7 +522,7 @@ def list_videos(params):
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_live(params):
"""Build live listing"""
lives = []
@@ -512,7 +540,7 @@ def list_live(params):
class_='embed-responsive-item')
url_live_embeded = live_soup.get('src')
- url_live = 'http:%s' % url_live_embeded
+ url_live = 'http:%s' % url_live_embeded
title = '%s Live' % params.channel_name.upper()
@@ -528,7 +556,7 @@ def list_live(params):
'label': title,
'fanart': img,
'thumb': img,
- 'url' : common.PLUGIN.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
next='play_l',
url=url_live,
@@ -545,7 +573,8 @@ def list_live(params):
)
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_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':
@@ -553,24 +582,28 @@ def get_video_url(params):
url = ''
html_video = utils.get_webcontent(params.url_video)
- url_video_embed = re.compile(r'<iframe src="(.*?)"').findall(html_video)[0]
+ 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
+ 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)
+ 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]
+ videoId, accountId = re.compile(
+ r'embed/(.*?)/(.*?)/').findall(url_video_embed)[0]
- html_json = utils.get_webcontent(URL_VIDEO_REPLAY % (videoId, accountId))
+ 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)
@@ -587,8 +620,9 @@ def get_video_url(params):
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)
+ 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 3201586..b40af4a 100755..100644
--- a/plugin.video.catchuptvandmore/resources/lib/channels/fr/lequipe.py
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/fr/lequipe.py
@@ -40,12 +40,14 @@ URL_ROOT = 'https://www.lequipe.fr'
URL_ROOT_VIDEO_LEQUIPE = 'https://www.lequipe.fr/lachainelequipe/'
-URL_REPLAY_VIDEO_LEQUIPE = 'https://www.lequipe.fr/lachainelequipe/morevideos/%s'
+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):
"""Entry function of the module"""
if 'root' in params.next:
@@ -61,14 +63,15 @@ def channel_entry(params):
else:
return None
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def root(params):
"""Add Replay and Live in the listing"""
modes = []
# Add Replay
modes.append({
- 'label' : 'Replay',
+ 'label': 'Replay',
'url': common.PLUGIN.get_url(
action='channel_entry',
next='list_shows_1',
@@ -79,7 +82,7 @@ def root(params):
# Add Live
modes.append({
- 'label' : 'Live TV',
+ 'label': 'Live TV',
'url': common.PLUGIN.get_url(
action='channel_entry',
next='live_cat',
@@ -96,7 +99,8 @@ def root(params):
),
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_shows(params):
"""Build shows listing"""
shows = []
@@ -109,12 +113,14 @@ def list_shows(params):
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")
+ 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')
+ category_url = URL_REPLAY_VIDEO_LEQUIPE % \
+ category.get('data-program-id')
shows.append({
'label': category_name,
@@ -135,14 +141,13 @@ def list_shows(params):
common.sp.xbmcplugin.SORT_METHOD_LABEL))
-@common.PLUGIN.cached(common.CACHE_TIME)
+@common.PLUGIN.mem_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
file_path = utils.download_catalog(
url,
@@ -163,7 +168,8 @@ def list_videos(params):
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]
+ r'<iframe src="//www.dailymotion.com/embed/video/(.*?)\?',
+ re.DOTALL).findall(html_video_equipe)[0]
title = program.find(
'h2').get_text().encode('utf-8')
@@ -253,7 +259,8 @@ def list_videos(params):
update_listing='update_listing' in params,
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_live(params):
"""Build live listing"""
lives = []
@@ -262,13 +269,12 @@ def list_live(params):
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]
+ r'<iframe src="//www.dailymotion.com/embed/video/(.*?)\?',
+ re.DOTALL).findall(html_live_equipe)[0]
title = '%s Live' % params.channel_name.upper()
@@ -284,7 +290,7 @@ def list_live(params):
'label': title,
'fanart': img,
'thumb': img,
- 'url' : common.PLUGIN.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
next='play_l',
video_id=video_id,
@@ -302,8 +308,7 @@ def list_live(params):
)
-
-@common.PLUGIN.cached(common.CACHE_TIME)
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def get_video_url(params):
"""Get video URL and start video player"""
url_video = URL_DAILYMOTION_EMBED % params.video_id
@@ -317,11 +322,14 @@ def get_video_url(params):
html_video = html_video.replace('\\', '')
if params.next == 'play_l':
- all_url_video = re.compile(r'{"type":"application/x-mpegURL","url":"(.*?)"').findall(html_video)
+ 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)
+ 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:
@@ -331,7 +339,8 @@ def get_video_url(params):
new_list_item.setPath(datas)
all_datas_videos.append(new_list_item)
- seleted_item = common.sp.xbmcgui.Dialog().select("Choose Stream", all_datas_videos)
+ 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':
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/fr/nrj.py b/plugin.video.catchuptvandmore/resources/lib/channels/fr/nrj.py
index a313210..9e325d3 100755..100644
--- a/plugin.video.catchuptvandmore/resources/lib/channels/fr/nrj.py
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/fr/nrj.py
@@ -58,7 +58,9 @@ 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)
+# channel (nrj12, ...) -
+# call this url after get session (url live with token inside this page)
+
def channel_entry(params):
"""Entry function of the module"""
@@ -76,14 +78,14 @@ def channel_entry(params):
return None
-@common.PLUGIN.cached(common.CACHE_TIME)
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def root(params):
"""Add Replay and Live in the listing"""
modes = []
# Add Replay with Categories
modes.append({
- 'label' : 'Replay',
+ 'label': 'Replay',
'url': common.PLUGIN.get_url(
action='channel_entry',
next='list_shows_1',
@@ -94,7 +96,7 @@ def root(params):
# Add Replay
modes.append({
- 'label' : 'Replay sans categorie',
+ 'label': 'Replay sans categorie',
'url': common.PLUGIN.get_url(
action='channel_entry',
next='list_shows_without_categories',
@@ -105,7 +107,7 @@ def root(params):
# Add Live
modes.append({
- 'label' : 'Live TV',
+ 'label': 'Live TV',
'url': common.PLUGIN.get_url(
action='channel_entry',
next='live_cat',
@@ -122,7 +124,8 @@ def root(params):
),
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_shows(params):
"""Build shows listing"""
shows = []
@@ -138,7 +141,7 @@ def list_shows(params):
action='channel_entry',
state_video=state_video,
next='list_videos_1',
- #title_category=category_name,
+ # title_category=category_name,
window_title=state_video
)
})
@@ -168,7 +171,7 @@ def list_shows(params):
action='channel_entry',
state_video=state_video,
next='list_videos_1',
- #title_category=category_name,
+ # title_category=category_name,
window_title=state_video
)
})
@@ -186,7 +189,7 @@ def list_shows(params):
action='channel_entry',
category_name=category_name,
next='list_shows_programs',
- #title_category=category_name,
+ # title_category=category_name,
window_title=category_name
)
})
@@ -198,9 +201,10 @@ def list_shows(params):
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') == ''):
+ 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")
@@ -213,7 +217,7 @@ def list_shows(params):
next='list_videos_1',
state_video=state_video,
id_program=id_program,
- #title_program=name_program,
+ # title_program=name_program,
window_title=name_program
)
})
@@ -226,7 +230,8 @@ def list_shows(params):
),
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_videos(params):
"""Build videos listing"""
videos = []
@@ -241,12 +246,14 @@ def list_videos(params):
xml_elements = ET.XML(replay_xml)
- programs = xml_elements.findall("{http://www.sitemaps.org/schemas/sitemap/0.9}url")
+ 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')
+ "{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:
@@ -355,7 +362,8 @@ def list_videos(params):
img = program.find("photos").findtext("photo")
# Url Video
- url = '' #program.find("offres").find("offre").find("videos").findtext("video)
+ url = ''
+ # program.find("offres").find("offre").find("videos").findtext("video)
for i in program.find("offres").findall("offre"):
date_value = i.get("startdate")
@@ -429,7 +437,8 @@ def list_videos(params):
img = program.find("photos").findtext("photo")
# Url Video
- url = '' #program.find("offres").find("offre").find("videos").findtext("video)
+ url = ''
+ # program.find("offres").find("offre").find("videos").findtext("video)
for i in program.find("offres").findall("offre"):
date_value = i.get("startdate")
@@ -497,7 +506,8 @@ def list_videos(params):
),
content='tvshows')
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_live(params):
"""Build live listing"""
lives = []
@@ -512,7 +522,8 @@ def list_live(params):
result = session_requests.get(URL_COMPTE_LOGIN)
token_form_login = re.compile(
- r'name=\"login_form\[_token\]\" value=\"(.*?)\"').findall(result.text)[0]
+ r'name=\"login_form\[_token\]\" value=\"(.*?)\"'
+ ).findall(result.text)[0]
# Build PAYLOAD
payload = {
@@ -525,7 +536,7 @@ def list_live(params):
# LOGIN
result_2 = session_requests.post(
- URL_COMPTE_LOGIN, data = payload, headers = dict(referer = URL_COMPTE_LOGIN))
+ 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(
@@ -555,7 +566,7 @@ def list_live(params):
'label': title,
'fanart': img,
'thumb': img,
- 'url' : common.PLUGIN.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
next='play_l',
url_live=url_live,
@@ -572,7 +583,8 @@ def list_live(params):
)
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_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':
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/fr/numero23.py b/plugin.video.catchuptvandmore/resources/lib/channels/fr/numero23.py
index 1beab9d..85996d4 100755..100644
--- a/plugin.video.catchuptvandmore/resources/lib/channels/fr/numero23.py
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/fr/numero23.py
@@ -43,6 +43,7 @@ URL_INFO_LIVE_JSON = 'http://www.numero23.fr/wp-content/cache/n23-direct.json'
URL_DAILYMOTION_EMBED = 'http://www.dailymotion.com/embed/video/%s'
# Video_id
+
def channel_entry(params):
"""Entry function of the module"""
if 'root' in params.next:
@@ -58,29 +59,31 @@ def channel_entry(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'
+ '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)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def root(params):
"""Add Replay and Live in the listing"""
modes = []
# Add Replay
modes.append({
- 'label' : 'Replay',
+ 'label': 'Replay',
'url': common.PLUGIN.get_url(
action='channel_entry',
next='list_shows_1',
@@ -91,7 +94,7 @@ def root(params):
# Add Live
modes.append({
- 'label' : 'Live TV',
+ 'label': 'Live TV',
'url': common.PLUGIN.get_url(
action='channel_entry',
next='live_cat',
@@ -108,7 +111,8 @@ def root(params):
),
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_shows(params):
"""Build shows listing"""
shows = []
@@ -125,7 +129,8 @@ def list_shows(params):
)
for category in categories_soup.find_all('a'):
- category_name = category.find('span').get_text().encode('utf-8').replace(
+ 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()
@@ -152,7 +157,7 @@ def list_shows(params):
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_videos(params):
"""Build videos listing"""
videos = []
@@ -162,7 +167,8 @@ def list_videos(params):
file_path = utils.download_catalog(
url_replay_paged,
- '%s_%s_%s.html' % (params.channel_name, params.category_name, str(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')
@@ -174,30 +180,40 @@ def list_videos(params):
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_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])
+ 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])
+ 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 ?
+ date_list = str(info_video[2]).replace(
+ "<p>", '').replace("</p>", '').split(' ')
+ day = '00'
+ mounth = '00'
year = '2017'
+ if len(date_list) > 3:
+ day = date_list[2]
+ try:
+ mounth = CORRECT_MONTH[date_list[3]]
+ except Exception:
+ mounth = '00'
+ # get year ?
date = '.'.join((day, mounth, year))
aired = '-'.join((year, mounth, day))
@@ -241,12 +257,14 @@ def list_videos(params):
file_path = utils.download_catalog(
url_replay_paged,
- '%s_%s_%s.html' % (params.channel_name, params.category_name, str(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_='program sticky video')
+ videos_soup = program_soup.find_all(
+ 'div', class_='program sticky video')
return common.PLUGIN.create_listing(
videos,
@@ -256,7 +274,8 @@ def list_videos(params):
),
content='tvshows')
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_live(params):
"""Build live listing"""
lives = []
@@ -265,7 +284,6 @@ def list_live(params):
plot = ''
duration = 0
img = ''
- url_live = ''
file_path = utils.download_catalog(
URL_INFO_LIVE_JSON,
@@ -278,7 +296,7 @@ def list_live(params):
video_id = json_parser["video"].encode('utf-8')
- #url_live = url_dailymotion_embed % video_id
+ # url_live = url_dailymotion_embed % video_id
info = {
'video': {
@@ -292,7 +310,7 @@ def list_live(params):
'label': title,
'fanart': img,
'thumb': img,
- 'url' : common.PLUGIN.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
next='play_l',
video_id=video_id,
@@ -309,7 +327,8 @@ def list_live(params):
)
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def get_video_url(params):
"""Get video URL and start video player"""
url_video = URL_DAILYMOTION_EMBED % params.video_id
@@ -324,11 +343,13 @@ def get_video_url(params):
if params.next == 'play_l':
all_url_video = re.compile(
- r'{"type":"application/x-mpegURL","url":"(.*?)"').findall(html_video)
+ 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)
+ 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:
@@ -338,11 +359,12 @@ def get_video_url(params):
new_list_item.setPath(datas)
all_datas_videos.append(new_list_item)
- seleted_item = common.sp.xbmcgui.Dialog().select("Choose Stream", all_datas_videos)
+ 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
+ # Last video in the Best
for datas in all_url_video:
url = datas
return url
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/fr/pluzz.py b/plugin.video.catchuptvandmore/resources/lib/channels/fr/pluzz.py
index 156edd2..7a83e3e 100755..100644
--- a/plugin.video.catchuptvandmore/resources/lib/channels/fr/pluzz.py
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/fr/pluzz.py
@@ -97,9 +97,11 @@ CATEGORIES = {
'Info': 'https://pluzz.webservices.francetelevisions.fr/'
'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',
'Culture': 'https://pluzz.webservices.francetelevisions.fr/'
@@ -107,19 +109,25 @@ CATEGORIES = {
'Jeunesse': 'https://pluzz.webservices.francetelevisions.fr/'
'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',
'Jeu': 'https://pluzz.webservices.francetelevisions.fr/'
'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',
+ 'Version multilingue (VM)': 'https://pluzz.webservices.'
+ 'francetelevisions.fr/'
+ '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'
}
@@ -140,7 +148,7 @@ def channel_entry(params):
return None
-@common.PLUGIN.cached(common.CACHE_TIME)
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def change_to_nicer_name(original_name):
"""Convert id name to label name"""
if original_name in CATEGORIES_DISPLAY:
@@ -148,7 +156,7 @@ def change_to_nicer_name(original_name):
return original_name
-@common.PLUGIN.cached(common.CACHE_TIME)
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def root(params):
"""Add Replay and Live in the listing"""
modes = []
@@ -156,7 +164,7 @@ def root(params):
# Add Replay
if params.channel_name != 'franceinfo':
modes.append({
- 'label' : 'Replay',
+ 'label': 'Replay',
'url': common.PLUGIN.get_url(
action='channel_entry',
next='list_shows_1',
@@ -168,7 +176,7 @@ def root(params):
# Add Live
if params.channel_name != 'la_1ere':
modes.append({
- 'label' : _('Live TV'),
+ 'label': _('Live TV'),
'url': common.PLUGIN.get_url(
action='channel_entry',
next='live_cat',
@@ -185,7 +193,8 @@ def root(params):
),
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_shows(params):
"""Build categories listing"""
shows = []
@@ -394,7 +403,7 @@ def list_shows(params):
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_videos(params):
"""Build videos listing"""
videos = []
@@ -556,7 +565,7 @@ def list_videos(params):
),
'is_playable': True,
'info': info,
- 'context_menu': context_menu # A ne pas oublier pour ajouter le bouton "Download" à chaque vidéo
+ 'context_menu': context_menu
})
if 'search' in params.next:
@@ -606,7 +615,8 @@ def list_videos(params):
update_listing='update_listing' in params,
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_live(params):
"""Build live listing"""
lives = []
@@ -634,14 +644,17 @@ def list_live(params):
if id_programme == '':
id_programme = emission['id_emission'].encode('utf-8')
id_diffusion = emission['id_diffusion']
- chaine_id = emission['chaine_id'].encode('utf-8')
+ # chaine_id = emission['chaine_id'].encode('utf-8')
- start_time_emission = 'Début : ' + emission['date_diffusion'].split('T')[1].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')
+ 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')
+ plot = start_time_emission + '\n ' + \
+ emission['accroche_programme'].encode('utf-8')
if emission['date_diffusion']:
date = emission['date_diffusion']
date = date.encode('utf-8')
@@ -674,7 +687,6 @@ def list_live(params):
day = int(date[8:10])
aired = '-'.join((str(year), str(month), str(day)))
-
image = URL_IMG % (emission['image_large'])
info = {
@@ -684,7 +696,7 @@ def list_live(params):
'aired': aired,
'date': date,
'duration': duration,
- #year': year,
+ # year': year,
'genre': genre,
'mediatype': 'tvshow',
'season': season,
@@ -729,7 +741,6 @@ def list_live(params):
'info': info
})
-
return common.PLUGIN.create_listing(
lives,
sort_methods=(
@@ -738,7 +749,8 @@ def list_live(params):
)
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def get_video_url(params):
"""Get video URL and start video player"""
@@ -754,7 +766,8 @@ def get_video_url(params):
all_datas_videos = []
for video in json_parser['videos']:
- if video['format'] == 'hls_v5_os' or video['format'] == 'm3u8-download':
+ 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")
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/fr/publicsenat.py b/plugin.video.catchuptvandmore/resources/lib/channels/fr/publicsenat.py
index 33d18d6..8f8cf6a 100755..100644
--- a/plugin.video.catchuptvandmore/resources/lib/channels/fr/publicsenat.py
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/fr/publicsenat.py
@@ -41,6 +41,7 @@ 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:
@@ -54,38 +55,41 @@ def channel_entry(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'
+ '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'
+ '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)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def root(params):
"""Add Replay and Live in the listing"""
modes = []
# Add Replay
modes.append({
- 'label' : 'Replay',
+ 'label': 'Replay',
'url': common.PLUGIN.get_url(
action='channel_entry',
next='list_shows_1',
@@ -96,7 +100,7 @@ def root(params):
# Add Live
modes.append({
- 'label' : 'Live TV',
+ 'label': 'Live TV',
'url': common.PLUGIN.get_url(
action='channel_entry',
next='live_cat',
@@ -113,7 +117,8 @@ def root(params):
),
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_shows(params):
"""Build shows listing"""
shows = []
@@ -142,7 +147,8 @@ def list_shows(params):
)
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_videos(params):
"""Build videos listing"""
videos = []
@@ -164,32 +170,38 @@ def list_videos(params):
if params.category_name == 'Politique':
video_soup = root_soup.find_all(
'article',
- class_="node node-episode node-episode-pse-search-result theme-4127 clearfix")
+ 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")
+ 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")
+ 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( \
+ if video.find('div', class_="content").find(
'div', class_="right").find('div', class_="wrapper-duree"):
title = ''
- if video.find('div', class_="content").find( \
+ if video.find('div', class_="content").find(
'div',
- class_="field field-name-title-field field-type-text field-label-hidden"):
+ 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"
+ class_="field field-name-field-ref-emission"
+ " field-type-entityreference "
+ "field-label-hidden"
).find(
'div',
class_="field-items"
@@ -199,25 +211,22 @@ def list_videos(params):
).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(
+ class_="content").find(
+ 'div',
+ class_="field field-name-title-field "
+ "field-type-text field-label-hidden").find(
'div',
- class_="field-items"
- ).find(
+ class_="field-items").find(
'div',
- class_="field-item even"
- ).get_text().encode('utf-8')
+ class_="field-item even").get_text().encode('utf-8')
else:
title = video.find(
'div',
- class_="content"
- ).find(
+ class_="content").find(
'div',
- class_="field field-name-field-ref-emission field-type-entityreference field-label-hidden"
- ).find(
+ class_="field field-name-field-ref-emission"
+ " field-type-entityreference "
+ "field-label-hidden").find(
'div',
class_="field-items"
).find(
@@ -226,9 +235,12 @@ def list_videos(params):
).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"):
+ 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"
@@ -240,7 +252,8 @@ def list_videos(params):
class_="scald-atom video"
).find(
'div',
- class_="field field-name-scald-thumbnail field-type-image field-label-hidden"
+ class_="field field-name-scald-thumbnail"
+ " field-type-image field-label-hidden"
).find(
'div',
class_="field-items"
@@ -250,14 +263,17 @@ def list_videos(params):
).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"):
+ 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"
+ class_="field field-name-field-contenu "
+ "field-type-text-long field-label-hidden"
).find(
'div',
class_="field-items"
@@ -266,7 +282,6 @@ def list_videos(params):
class_="field-item even"
).get_text().encode('utf-8')
-
value_date = video.find(
'div',
class_="content"
@@ -275,7 +290,7 @@ def list_videos(params):
day = date[2]
try:
mounth = CORRECT_MONTH[date[3]]
- except:
+ except Exception:
mounth = '00'
year = date[4]
@@ -286,8 +301,8 @@ def list_videos(params):
duration = int(video.find('div', class_="content").find(
'div', class_="right").find(
'div',
- class_="wrapper-duree").get_text().encode('utf-8')[:-3]) * 60
-
+ 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')
@@ -299,7 +314,7 @@ def list_videos(params):
'date': date,
'duration': duration,
'year': year,
- 'plot' : plot,
+ 'plot': plot,
'mediatype': 'tvshow'
}
}
@@ -354,7 +369,8 @@ def list_videos(params):
update_listing='update_listing' in params,
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_live(params):
"""Build live listing"""
lives = []
@@ -387,7 +403,7 @@ def list_live(params):
'label': title,
'fanart': img,
'thumb': img,
- 'url' : common.PLUGIN.get_url(
+ 'url': common.PLUGIN.get_url(
action='channel_entry',
next='play_l',
url=url_live,
@@ -404,7 +420,8 @@ def list_live(params):
)
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_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':
@@ -417,8 +434,7 @@ def get_video_url(params):
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
-
+ break # get first video hard to find by another method
url_video_embed_http = url_video_embed
if params.next == 'download_video':
@@ -426,7 +442,8 @@ def get_video_url(params):
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)
+ all_url_video = re.compile(
+ r'"type":"video/mp4","url":"(.*?)"').findall(html_video)
for datas in all_url_video:
url = datas
@@ -438,7 +455,8 @@ def get_video_url(params):
html_live = html_live.replace('\\', '')
url_live = re.compile(
- r'{"type":"application/x-mpegURL","url":"(.*?)"}]}').findall(html_live)
+ 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 79c524c..2bc277b 100755..100644
--- a/plugin.video.catchuptvandmore/resources/lib/channels/fr/tf1.py
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/fr/tf1.py
@@ -21,7 +21,9 @@
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""
+import ast
import json
+import re
from bs4 import BeautifulSoup as bs
from resources.lib import utils
from resources.lib import common
@@ -70,14 +72,15 @@ def channel_entry(params):
return get_video_url(params)
return None
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def root(params):
"""Add Replay and Live in the listing"""
modes = []
# Add Replay
modes.append({
- 'label' : 'Replay',
+ 'label': 'Replay',
'url': common.PLUGIN.get_url(
action='channel_entry',
next='list_shows_1',
@@ -89,7 +92,7 @@ def root(params):
# Add Live
if params.channel_name != 'tfou' and params.channel_name != 'xtra':
modes.append({
- 'label' : _('Live TV'),
+ 'label': _('Live TV'),
'url': common.PLUGIN.get_url(
action='channel_entry',
next='live_cat',
@@ -106,7 +109,8 @@ def root(params):
),
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_shows(params):
"""Build categories listing"""
shows = []
@@ -124,14 +128,15 @@ def list_shows(params):
'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_url = URL_LCI_ROOT + program.find(
+ 'a')['href'].encode('utf-8')
program_name = program.find(
'h2',
class_='text-block').get_text().encode('utf-8')
img = program.find_all('source')[0]
try:
img = img['data-srcset'].encode('utf-8')
- except:
+ except Exception:
img = img['srcset'].encode('utf-8')
img = img.split(',')[0].split(' ')[0]
@@ -192,21 +197,33 @@ def list_shows(params):
img = program.find('img')
try:
img = img['data-srcset'].encode('utf-8')
- except:
+ except Exception:
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
- )
- })
+ if 'meteo.tf1.fr/meteo-france' in program_url:
+ shows.append({
+ 'label': program_name,
+ 'thumb': img,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ program_url=program_url,
+ next='list_videos',
+ window_title=program_name
+ )
+ })
+ else:
+ 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,
@@ -217,7 +234,7 @@ def list_shows(params):
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_videos_categories(params):
"""Build videos categories listing"""
videos_categories = []
@@ -230,19 +247,38 @@ def list_videos_categories(params):
filters_1_soup = program_soup.find(
'ul',
class_='filters_1')
- for li in filters_1_soup.find_all('li'):
- 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
- )
- })
+ if filters_1_soup is not None:
+ for li in filters_1_soup.find_all('li'):
+ category_title = li.get_text().encode('utf-8')
+ category_id = li.find('a')['data-filter'].encode('utf-8')
+
+ # Get Last Page of each categorie
+ # Get First page :
+ url_first_page = ''.join((
+ params.program_url,
+ '/videos',
+ '?filter=',
+ category_id))
+ program_first_page_html = utils.get_webcontent(url_first_page)
+ program_first_page_soup = bs(
+ program_first_page_html, 'html.parser')
+ # Get Last page :
+ last_page = '0'
+ if program_first_page_soup.find('a', class_='icon i-chevron-right-double trackXiti') is not None:
+ last_page = program_first_page_soup.find('a', class_='icon i-chevron-right-double trackXiti').get('href').rsplit('/')[-1].split('?')[0]
+
+ videos_categories.append({
+ 'label': category_title,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ program_url=params.program_url,
+ page='1',
+ last_page=last_page,
+ next='list_videos',
+ window_title=category_title,
+ category_id=category_id
+ )
+ })
return common.PLUGIN.create_listing(
videos_categories,
sort_methods=(
@@ -252,10 +288,12 @@ def list_videos_categories(params):
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+@common.PLUGIN.mem_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.channel_name == 'lci':
program_html = utils.get_webcontent(params.program_url)
@@ -263,7 +301,7 @@ def list_videos(params):
list_replay = program_soup.find_all(
'a',
- class_='topic-emission-extract-block-image trackXiti')
+ class_='medium-3col-article-block-article-link')
for replay in list_replay:
@@ -312,12 +350,64 @@ def list_videos(params):
'context_menu': context_menu
})
+ elif 'meteo.tf1.fr/meteo-france' in params.program_url:
+ program_html = utils.get_webcontent(params.program_url)
+ program_soup = bs(program_html, 'html.parser')
+
+ wat_info = program_soup.find(
+ 'td',
+ class_='textbase')
+
+ title = wat_info.find('h3').get_text()
+
+ program_id = re.compile('; src = \'(.*?)\?').findall(program_html)[0]
+
+ 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
+ })
else:
- url = ''.join((
- params.program_url,
- '/videos/',
- '?filter=',
- params.category_id))
+ if params.page == '1':
+ url = ''.join((
+ params.program_url,
+ '/videos',
+ '?filter=',
+ params.category_id))
+ else:
+ url = ''.join((
+ params.program_url,
+ '/videos/%s' % params.page,
+ '?filter=',
+ params.category_id))
program_html = utils.get_webcontent(url)
program_soup = bs(program_html, 'html.parser')
@@ -325,96 +415,113 @@ def list_videos(params):
'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 = ''
+ if grid is not None:
+ 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]
- try:
- duration_soup = li.find(
+ if 'Playlist' not in video_type_string:
+ title = 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')
+ class_='title').get_text().encode('utf-8')
- img = 'http:' + img.split(',')[-1].split(' ')[0]
+ try:
+ stitle = li.find(
+ 'p',
+ class_='stitle').get_text().encode('utf-8')
+ except:
+ stitle = ''
- try:
- date_soup = li.find(
- 'div',
- class_='text').find(
+ try:
+ duration_soup = li.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'
+ 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)
+ 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
- })
+ 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
+ })
+
+ if int(params.page) < int(params.last_page):
+ # More videos...
+ videos.append({
+ 'label': common.ADDON.get_localized_string(30100),
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ program_url=params.program_url,
+ category_id=params.category_id,
+ last_page=params.last_page,
+ next='list_videos',
+ page=str(int(params.page) + 1),
+ update_listing=True,
+ previous_listing=str(videos)
+ ),
+ })
return common.PLUGIN.create_listing(
videos,
@@ -424,9 +531,11 @@ def list_videos(params):
common.sp.xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE,
common.sp.xbmcplugin.SORT_METHOD_UNSORTED
),
- content='tvshows')
+ content='tvshows',
+ update_listing='update_listing' in params,
+ )
-@common.PLUGIN.cached(common.CACHE_TIME)
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
def list_live(params):
"""Build live listing"""
lives = []
@@ -491,29 +600,34 @@ def list_live(params):
)
)
-@common.PLUGIN.cached(common.CACHE_TIME)
+@common.PLUGIN.mem_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 'www.wat.tv/embedframe' in params.program_id:
+ url = 'http:' + params.program_id
+ elif "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')
+ if 'www.wat.tv/embedframe' in params.program_id:
+ video_id = re.compile('UVID=(.*?)&').findall(video_html)[0]
else:
- data_src = iframe_player_soup['data-src'].encode('utf-8')
- video_id = data_src[-8:]
+ 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))
@@ -553,6 +667,14 @@ def get_video_url(params):
except:
pass
+ # Check DRM in the m3u8 file
+ manifest = utils.get_webcontent(
+ url_video,
+ random_ua=True)
+ if 'drm' in manifest:
+ utils.send_notification(common.ADDON.get_localized_string(30102))
+ return ''
+
return url_video
elif params.next == 'play_l':
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/uk/__init__.py b/plugin.video.catchuptvandmore/resources/lib/channels/uk/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/uk/__init__.py
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/uk/blaze.py b/plugin.video.catchuptvandmore/resources/lib/channels/uk/blaze.py
new file mode 100644
index 0000000..1aab65b
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/uk/blaze.py
@@ -0,0 +1,339 @@
+# -*- 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 ast
+import re
+from bs4 import BeautifulSoup as bs
+from resources.lib import utils
+from resources.lib import common
+
+# TO DO
+# Fix Download 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()
+
+# Live
+URL_LIVE_JSON = 'http://dbxm993i42r09.cloudfront.net/' \
+ 'configs/blaze.json?callback=blaze'
+
+URL_NOW_PLAYING = 'http://www.blaze.tv/home/index/now-playing'
+
+# Replay
+URL_SHOWS = 'http://www.blaze.tv/series?page=%s'
+# pageId
+
+URL_API_KEY = 'https://dbxm993i42r09.cloudfront.net/configs/config.blaze.js'
+
+URL_STREAM = 'https://d2q1b32gh59m9o.cloudfront.net/player/config?' \
+ 'callback=ssmp&client=blaze&type=vod&apiKey=%s&videoId=%s&' \
+ 'format=jsonp&callback=ssmp'
+# apiKey, videoId
+
+URL_ROOT = 'http://www.blaze.tv'
+
+
+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)
+
+
+@common.PLUGIN.mem_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',
+ page='0',
+ 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.mem_cached(common.CACHE_TIME)
+def list_shows(params):
+ """Build categories listing"""
+ shows = []
+ if 'previous_listing' in params:
+ shows = ast.literal_eval(params['previous_listing'])
+
+ if params.next == 'list_shows_1':
+ file_path = utils.download_catalog(
+ URL_SHOWS % params.page,
+ '%s_shows_%s.html' % (params.channel_name, params.page)
+ )
+ replay_shows_html = open(file_path).read()
+
+ replay_shows_soup = bs(replay_shows_html, 'html.parser')
+ replay_shows = replay_shows_soup.find_all('div', class_='item')
+
+ for show in replay_shows:
+
+ show_title = show.find('a').find('img').get('alt')
+ show_img = show.find('a').find('img').get('src').encode('utf-8')
+ show_url = URL_ROOT + show.find('a').get('href').encode('utf-8')
+
+ shows.append({
+ 'label': show_title,
+ 'thumb': show_img,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_shows_2',
+ title=show_title,
+ show_url=show_url,
+ window_title=show_title
+ )
+ })
+
+ # More programs...
+ shows.append({
+ 'label': common.ADDON.get_localized_string(30108),
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_shows_1',
+ page=str(int(params.page) + 1),
+ update_listing=True,
+ previous_listing=str(shows)
+ ),
+ })
+
+ elif params.next == 'list_shows_2':
+
+ file_path = utils.download_catalog(
+ params.show_url,
+ '%s_show_%s.html' % (params.channel_name, params.title)
+ )
+ replay_show_html = open(file_path).read()
+
+ replay_show_seasons_soup = bs(replay_show_html, 'html.parser')
+ replay_show_seasons = replay_show_seasons_soup.find(
+ 'div', class_='pagination')
+
+ get_show_seasons = replay_show_seasons.find_all('a')
+
+ for season in get_show_seasons:
+
+ season_title = 'Series %s' % season.get_text().strip()
+ show_season_url = URL_ROOT + season.get('href').encode('utf-8')
+
+ shows.append({
+ 'label': season_title,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_videos_1',
+ title=params.title + '_' + season_title,
+ show_url=show_season_url,
+ window_title=season_title
+ )
+ })
+
+ 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.mem_cached(common.CACHE_TIME)
+def list_videos(params):
+ """Build videos listing"""
+ videos = []
+
+ file_path = utils.download_catalog(
+ params.show_url,
+ '%s_show_%s.html' % (params.channel_name, params.title)
+ )
+ replay_show_html = open(file_path).read()
+ episodes_soup = bs(replay_show_html, 'html.parser')
+
+ root_episodes = episodes_soup.find_all('div', class_='carousel-inner')[0]
+ episodes = root_episodes.find_all(
+ 'div', class_='col-md-4 wrapper-item season')
+
+ for episode in episodes:
+
+ value_episode = episode.find(
+ 'span', class_='caption-description'
+ ).get_text().split(' | ')[1].split(' ')[1]
+ value_season = episode.find(
+ 'span', class_='caption-description'
+ ).get_text().split(' | ')[0].split(' ')[1]
+ video_title = episode.find(
+ 'span', class_='caption-title'
+ ).get_text() + ' S%sE%s' % (value_season, value_episode)
+
+ video_duration = 0
+ video_plot = episode.find(
+ 'span', class_='caption-title').get_text().encode('utf-8') + ' '
+ video_plot = video_plot + episode.find(
+ 'span', class_='caption-description').get_text().encode('utf-8')
+ video_img = episode.find('a').find('img').get('src')
+ video_url = URL_ROOT + episode.find('a').get('href').encode('utf-8')
+
+ 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_url=video_url) + ')'
+ )
+ 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
+ })
+
+ 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.mem_cached(common.CACHE_TIME)
+def list_live(params):
+ """Build live listing"""
+ lives = []
+
+ title = ''
+ # subtitle = ' - '
+ plot = ''
+ duration = 0
+ img = ''
+ url_live = ''
+
+ video_html = utils.get_webcontent(URL_NOW_PLAYING)
+ title_live = bs(video_html, 'html.parser')
+ title = title_live.get_text()
+ url_live_html = utils.get_webcontent(URL_LIVE_JSON)
+ url_live = re.compile('"url": "(.*?)"').findall(url_live_html)[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.mem_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':
+ video_html = utils.get_webcontent(params.video_url)
+ videoId = re.compile('data-uvid="(.*?)"').findall(video_html)[0]
+ apikey_html = utils.get_webcontent(URL_API_KEY)
+ apikey = re.compile('"apiKey": "(.*?)"').findall(apikey_html)[0]
+ stream_html = utils.get_webcontent(URL_STREAM % (apikey, videoId))
+ return re.compile('"hls":"(.*?)"').findall(stream_html)[0]
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/uk/uktvplay.py b/plugin.video.catchuptvandmore/resources/lib/channels/uk/uktvplay.py
new file mode 100644
index 0000000..ba3b89f
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/uk/uktvplay.py
@@ -0,0 +1,473 @@
+# -*- 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 re
+import requests
+from bs4 import BeautifulSoup as bs
+from resources.lib import utils
+from resources.lib import common
+
+# TO DO
+# Live TV ?
+# Get IMG from each SHOW (How ? Working on the browser not by wget)
+
+# 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://uktvplay.uktv.co.uk'
+
+URL_SHOWS = 'https://uktvplay.uktv.co.uk/shows/channel/%s/'
+# channel_name
+
+URL_AUTHENTICATE = 'https://live.mppglobal.com/api/accounts/authenticate'
+# POST Payload {email: "********@*******", password: "*********"}
+
+URL_BRIGHTCOVE_API = 'https://edge.api.brightcove.com/playback/v1/' \
+ 'accounts/%s/videos/%s'
+# data-account, data-vidid
+
+URL_JS_POLICY_KEY = 'https://players.brightcove.net/%s/%s_default/index.min.js'
+# data-account, data-player
+
+
+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)
+
+
+CORRECT_MOUNTH = {
+ 'Jan': '01',
+ 'Feb': '02',
+ 'Mar': '03',
+ 'Apr': '04',
+ 'May': '05',
+ 'Jun': '06',
+ 'Jul': '07',
+ 'Aug': '08',
+ 'Sep': '09',
+ 'Oct': '10',
+ 'Nov': '11',
+ 'Dec': '12'
+}
+
+
+@common.PLUGIN.mem_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]
+
+
+@common.PLUGIN.mem_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.mem_cached(common.CACHE_TIME)
+def list_shows(params):
+ """Build categories listing"""
+ shows = []
+
+ if params.next == 'list_shows_1':
+
+ file_path = utils.download_catalog(
+ URL_SHOWS % (params.channel_name),
+ '%s_show.html' % (params.channel_name)
+ )
+ replay_shows_html = open(file_path).read()
+
+ replay_shows_soup = bs(replay_shows_html, 'html.parser')
+ replay_shows = replay_shows_soup.find_all('div', class_='span2')
+
+ for show in replay_shows:
+
+ show_title = show.find('a').find('img').get('alt').encode('utf-8')
+ show_img = show.find('a').find('img').get('src')
+ show_url = URL_ROOT + show.find('a').get('href')
+
+ if 'episodes' in show.find('p', class_='series-ep').get_text():
+ shows.append({
+ 'label': show_title,
+ 'thumb': show_img,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_shows_2',
+ title=show_title,
+ show_url=show_url,
+ window_title=show_title
+ )
+ })
+ else:
+ shows.append({
+ 'label': show_title,
+ 'thumb': show_img,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_videos_1',
+ title=show_title,
+ show_url=show_url,
+ window_title=show_title
+ )
+ })
+
+ elif params.next == 'list_shows_2':
+
+ file_path = utils.download_catalog(
+ params.show_url,
+ '%s_show_%s.html' % (params.channel_name, params.title)
+ )
+ replay_show_html = open(file_path).read()
+
+ replay_show_seasons_soup = bs(replay_show_html, 'html.parser')
+ replay_show_seasons = replay_show_seasons_soup.find(
+ 'ul', class_='clearfix tag-nav')
+
+ get_show_seasons = replay_show_seasons.find_all('li')
+
+ for season in get_show_seasons:
+
+ season_title = 'Series %s' % season.get(
+ 'id').encode('utf-8').split('nav-series-')[1]
+
+ shows.append({
+ 'label': season_title,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_videos_1',
+ title=params.title + '_' + season_title,
+ show_url=params.show_url,
+ window_title=season_title
+ )
+ })
+
+ return common.PLUGIN.create_listing(
+ shows,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL
+ )
+ )
+
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
+def list_videos(params):
+ """Build videos listing"""
+ videos = []
+
+ file_path = utils.download_catalog(
+ params.show_url,
+ '%s_show_%s.html' % (
+ params.channel_name, params.title)
+ )
+ replay_show_season_html = open(file_path).read()
+ seasons_episodes_soup = bs(replay_show_season_html, 'html.parser')
+
+ # Get data-account
+ data_account = re.compile(
+ r'data-account="(.*?)"').findall(replay_show_season_html)[0]
+ data_player = re.compile(
+ r'data-player="(.*?)"').findall(replay_show_season_html)[0]
+
+ if "Series" in params.title:
+ # GET VideoId for each episode of season selected
+ seasons_episodes = seasons_episodes_soup.find_all(
+ 'div', class_='spanOneThird vod-episode clearfix ')
+ for episode in seasons_episodes:
+ if episode.get('data-series') == \
+ params.title.split('Series')[1].strip():
+
+ data_vidid = episode.get('data-vidid')
+
+ video_title = episode.get('data-title')
+ video_title = video_title + ' S%sE%s' % (
+ episode.get('data-series'), episode.get('data-episode'))
+ video_duration = 0
+
+ video_plot = 'Expire '
+ video_plot = video_plot + episode.get(
+ 'data-publishend').split('T')[0]
+ video_plot = video_plot + '\n' + episode.get(
+ 'data-teaser').encode('utf-8')
+
+ video_img = episode.find('img').get('src')
+
+ date_value = episode.get("data-publishstart")
+ date_value_list = date_value.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',
+ data_vidid=data_vidid,
+ data_account=data_account,
+ data_player=data_player) + ')'
+ )
+ 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',
+ data_vidid=data_vidid,
+ data_account=data_account,
+ data_player=data_player
+ ),
+ 'is_playable': True,
+ 'info': info,
+ 'context_menu': context_menu
+ })
+
+ play_episode = seasons_episodes_soup.find(
+ 'div', class_='spanOneThird vod-episode clearfix playing in')
+ if play_episode.get('data-series') == \
+ params.title.split('Series')[1].strip():
+
+ data_vidid = play_episode.get('data-vidid')
+
+ video_title = play_episode.get('data-title')
+ video_title = video_title + ' S%sE%s' % (
+ play_episode.get('data-series'),
+ play_episode.get('data-episode')
+ )
+ video_duration = 0
+ video_plot = 'Expire '
+ video_plot = video_plot + play_episode.get(
+ 'data-publishend').split('T')[0] + '\n '
+ video_plot = video_plot + play_episode.get(
+ 'data-teaser').encode('utf-8')
+ video_img = play_episode.find('img').get('src')
+
+ date_value = play_episode.get("data-publishstart")
+ date_value_list = date_value.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',
+ data_vidid=data_vidid,
+ data_account=data_account,
+ data_player=data_player) + ')'
+ )
+ 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',
+ data_vidid=data_vidid,
+ data_account=data_account,
+ data_player=data_player
+ ),
+ 'is_playable': True,
+ 'info': info,
+ 'context_menu': context_menu
+ })
+
+ else:
+ play_episode = seasons_episodes_soup.find(
+ 'div', class_='vod-video-container')
+
+ data_vidid = play_episode.find('a').get('data-vidid')
+
+ video_title = play_episode.find('img').get('alt')
+ video_duration = 0
+ video_plot = seasons_episodes_soup.find(
+ 'p', class_='teaser').get_text().encode('utf-8')
+ video_img = re.compile(
+ 'itemprop="image" content="(.*?)"'
+ ).findall(replay_show_season_html)[0]
+
+ date_value = re.compile(
+ 'itemprop="uploadDate" content="(.*?)"'
+ ).findall(replay_show_season_html)[0]
+ date_value_list = date_value.split(',')[0].split(' ')
+ if len(date_value_list[0]) == 1:
+ day = '0' + date_value_list[0]
+ else:
+ day = date_value_list[0]
+ try:
+ mounth = CORRECT_MOUNTH[date_value_list[1]]
+ except Exception:
+ mounth = '00'
+ year = date_value_list[2]
+
+ 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',
+ data_vidid=data_vidid,
+ data_account=data_account,
+ data_player=data_player) + ')'
+ )
+ 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',
+ data_vidid=data_vidid,
+ data_account=data_account,
+ data_player=data_player
+ ),
+ '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_DURATION,
+ common.sp.xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE,
+ common.sp.xbmcplugin.SORT_METHOD_GENRE,
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED
+ ),
+ content='tvshows',
+ )
+
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
+def list_live(params):
+ """Build live listing"""
+ return None
+
+
+@common.PLUGIN.mem_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':
+
+ session_requests = requests.session()
+
+ # Build PAYLOAD
+ """
+ payload = {
+ 'email': common.PLUGIN.get_setting(
+ params.channel_id.rsplit('.', 1)[0] + '.login'),
+ 'password': common.PLUGIN.get_setting(
+ params.channel_id.rsplit('.', 1)[0] + '.password')
+ }
+ result = session_requests.post(URL_AUTHENTICATE,payload)
+ """
+ result_2 = session_requests.get(
+ URL_BRIGHTCOVE_API % (params.data_account, params.data_vidid),
+ headers={'Accept': 'application/json;pk=%s' % get_policy_key(
+ params.data_account, params.data_player)}
+ )
+ return re.compile(
+ '"application/x-mpegURL","src":"(.+?)"').findall(result_2.text)[0]
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/ws/__init__.py b/plugin.video.catchuptvandmore/resources/lib/channels/ws/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/ws/__init__.py
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/ws/allocine.py b/plugin.video.catchuptvandmore/resources/lib/channels/ws/allocine.py
new file mode 100644
index 0000000..f3d7bfa
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/ws/allocine.py
@@ -0,0 +1,661 @@
+# -*- 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 ast
+import json
+import re
+import requests
+from bs4 import BeautifulSoup as bs
+from youtube_dl import YoutubeDL
+from resources.lib import utils
+from resources.lib import common
+
+# TO DO
+# Vimeo HTTP 503
+# Get Last_Page (for Programs, Videos)
+# Get Partner Id ?
+# Todo get Aired, Year, Date of the Video
+
+URL_ROOT = 'http://www.allocine.fr'
+
+URL_API_MEDIA = 'http://api.allocine.fr/rest/v3/' \
+ 'media?code=%s&partner=%s&format=json'
+# videoId, PARTENER
+
+PARTNER = 'YW5kcm9pZC12Mg'
+
+# 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)
+ 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)
+ return None
+
+
+CATEGORIES = {
+ 'Les émissions': URL_ROOT + '/video/',
+ 'Videos Films (Bandes-Annonces, Extraits, ...)':
+ URL_ROOT + '/video/films/',
+ 'Videos Séries TV (Bandes-Annonces, Extraits, ...)':
+ URL_ROOT + '/series/video/'
+}
+
+CATEGORIES_LANGUAGE = {
+ 'VF': 'version-0/',
+ 'VO': 'version-1/'
+}
+
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
+def root(params):
+ """Add modes in the listing"""
+ modes = []
+
+ for category_name, category_url in CATEGORIES.iteritems():
+
+ if 'series' in category_url or 'films' in category_url:
+ next_value = 'list_shows_films_series_1'
+ else:
+ next_value = 'list_shows_emissions_1'
+
+ modes.append({
+ 'label': category_name,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ category_url=category_url,
+ category_name=category_name,
+ next=next_value,
+ window_title=category_name
+ )
+ })
+
+ return common.PLUGIN.create_listing(
+ modes,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_LABEL,
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED
+ ),
+ )
+
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
+def list_shows(params):
+ """Build categories listing"""
+ shows = []
+ if 'previous_listing' in params:
+ shows = ast.literal_eval(params['previous_listing'])
+
+ if params.next == 'list_shows_emissions_1':
+
+ # Build Categories Emissions
+ replay_categories_programs_html = utils.get_webcontent(
+ params.category_url)
+ replay_categories_programs_soup = bs(
+ replay_categories_programs_html, 'html.parser')
+ root_categories_programs = replay_categories_programs_soup.find(
+ 'li', class_='item_4 is_active ')
+ replay_categories_programs = root_categories_programs.find_all('a')
+
+ for category_programs in replay_categories_programs:
+ categorie_programs_title = category_programs.get_text()
+ categorie_programs_title = categorie_programs_title.strip()
+ categorie_programs_title = categorie_programs_title.encode('utf-8')
+
+ categorie_programs_url = URL_ROOT + category_programs.get('href')
+ shows.append({
+ 'label': categorie_programs_title,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_shows_emissions_2',
+ title=categorie_programs_title,
+ categorie_programs_url=categorie_programs_url,
+ window_title=categorie_programs_title
+ )
+ })
+
+ elif params.next == 'list_shows_emissions_2':
+
+ # Build sub categories if exists / add 'Les Programmes', 'Les Vidéos'
+ replay_subcategories_programs_html = utils.get_webcontent(
+ params.categorie_programs_url)
+ replay_subcategories_programs_soup = bs(
+ replay_subcategories_programs_html, 'html.parser')
+
+ # Les vidéos
+ show_title = '# Les videos'
+ next_value = 'list_videos_emissions_1'
+ show_url = params.categorie_programs_url
+ shows.append({
+ 'label': show_title,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next=next_value,
+ title=show_title,
+ page='1',
+ show_url=show_url,
+ window_title=show_title
+ )
+ })
+
+ # Les programmes
+ programs_title = '# Les programmes'
+ next_value = 'list_shows_emissions_4'
+ programs_url = params.categorie_programs_url.replace(
+ '/cat-', '/prgcat-')
+
+ shows.append({
+ 'label': programs_title,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next=next_value,
+ title=programs_title,
+ page='1',
+ programs_url=programs_url,
+ window_title=programs_title
+ )
+ })
+
+ # Subcategories
+ subcategories = replay_subcategories_programs_soup.find(
+ 'div', class_='nav-button-filter').find_all('a')
+
+ for subcategory in subcategories:
+ subcategorie_programs_title = subcategory.find(
+ 'span', class_='label').get_text().encode('utf-8')
+ subcategorie_programs_url = URL_ROOT + subcategory.get('href')
+
+ shows.append({
+ 'label': subcategorie_programs_title,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_shows_emissions_3',
+ title=subcategorie_programs_title,
+ subcategorie_programs_url=subcategorie_programs_url,
+ window_title=subcategorie_programs_title
+ )
+ })
+
+ elif params.next == 'list_shows_emissions_3':
+
+ # Les vidéos
+ show_title = '# Les videos'
+ next_value = 'list_videos_emissions_1'
+ show_url = params.subcategorie_programs_url
+ shows.append({
+ 'label': show_title,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next=next_value,
+ title=show_title,
+ page='1',
+ show_url=show_url,
+ window_title=show_title
+ )
+ })
+
+ # Les programmes
+ programs_title = '# Les programmes'
+ next_value = 'list_shows_emissions_4'
+ programs_url = params.subcategorie_programs_url.replace(
+ '/cat-', '/prgcat-')
+
+ shows.append({
+ 'label': programs_title,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next=next_value,
+ title=programs_title,
+ page='1',
+ programs_url=programs_url,
+ window_title=programs_title
+ )
+ })
+
+ elif params.next == 'list_shows_emissions_4':
+
+ replay_programs_html = utils.get_webcontent(
+ params.programs_url + '?page=%s' % params.page)
+ replay_programs_soup = bs(replay_programs_html, 'html.parser')
+ replay_programs = replay_programs_soup.find_all(
+ 'figure', class_='media-meta-fig')
+
+ for program in replay_programs:
+
+ program_title = program.find(
+ 'h2', class_='title '
+ ).find('span').find('a').get_text().strip().encode('utf-8')
+ program_img = program.find('img').get('src')
+ program_url = URL_ROOT + program.find(
+ 'h2', class_='title '
+ ).find('span').find('a').get('href').encode('utf-8')
+
+ shows.append({
+ 'label': program_title,
+ 'thumb': program_img,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_shows_emissions_5',
+ program_title=program_title,
+ program_url=program_url,
+ window_title=program_title
+ )
+ })
+
+ if replay_programs_soup.find('div', class_='pager pager margin_40t') \
+ is not None:
+ # More programs...
+ shows.append({
+ 'label': '# ' + common.ADDON.get_localized_string(30108),
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_shows_emissions_4',
+ programs_url=params.programs_url,
+ page=str(int(params.page) + 1),
+ update_listing=True,
+ previous_listing=str(shows)
+ ),
+ })
+
+ elif params.next == 'list_shows_emissions_5':
+
+ replay_seasons_html = utils.get_webcontent(
+ params.program_url + 'saisons/')
+ replay_seasons_soup = bs(replay_seasons_html, 'html.parser')
+ replay_seasons = replay_seasons_soup.find_all(
+ 'h2', class_='fs18 d_inline_block margin_10r')
+
+ if len(replay_seasons) > 0:
+
+ for season in replay_seasons:
+ season_title = season.find('a').find('span').get_text().strip()
+ show_season_url = URL_ROOT + season.find(
+ 'a', class_='no_underline').get('href').encode('utf-8')
+
+ # Get Last Page
+ last_page = '0'
+ info_show_season = utils.get_webcontent(show_season_url)
+ info_show_season_pages = re.compile(
+ '<a href="(.*?)"').findall(info_show_season)
+ for info_show_season_page in info_show_season_pages:
+ if '?page=' in info_show_season_page:
+ last_page = info_show_season_page.split('=')[1]
+
+ shows.append({
+ 'label': season_title,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_videos_emissions_1',
+ title=season_title,
+ page='1',
+ last_page=last_page,
+ show_url=show_season_url,
+ window_title=season_title
+ )
+ })
+
+ else:
+ season_title = replay_seasons_soup.find(
+ 'div', class_='margin_20t margin_40b'
+ ).find('a').get_text().strip().encode('utf-8')
+ show_season_url = URL_ROOT + replay_seasons_soup.find(
+ 'div', class_='margin_20t margin_40b'
+ ).find('a').get('href').encode('utf-8')
+
+ # Get Last Page
+ last_page = '0'
+ info_show_season = utils.get_webcontent(show_season_url)
+ info_show_season_pages = re.compile(
+ '<a href="(.*?)"').findall(info_show_season)
+ for info_show_season_page in info_show_season_pages:
+ if '?page=' in info_show_season_page:
+ last_page = info_show_season_page.split('=')[1]
+
+ shows.append({
+ 'label': season_title,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_videos_emissions_1',
+ title=season_title,
+ page='1',
+ last_page=last_page,
+ show_url=show_season_url,
+ window_title=season_title
+ )
+ })
+
+ elif params.next == 'list_shows_films_series_1':
+
+ # Build All Types
+ replay_types_films_series_html = utils.get_webcontent(
+ params.category_url)
+ replay_types_films_series_soup = bs(
+ replay_types_films_series_html, 'html.parser')
+ replay_types_films_series = replay_types_films_series_soup.find_all(
+ 'div', class_='left_col_menu_item')[0]
+
+ show_title = '# Toutes les videos'
+ next_value = 'list_videos_films_series_1'
+ show_url = params.category_url
+ shows.append({
+ 'label': show_title,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next=next_value,
+ title=show_title,
+ page='1',
+ show_url=show_url,
+ window_title=show_title
+ )
+ })
+
+ for all_types in replay_types_films_series.find_all('a'):
+
+ show_title = all_types.get_text()
+ next_value = 'list_shows_films_series_2'
+ show_url = URL_ROOT + all_types.get('href')
+
+ shows.append({
+ 'label': show_title,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next=next_value,
+ title=show_title,
+ show_url=show_url,
+ window_title=show_title
+ )
+ })
+
+ elif params.next == 'list_shows_films_series_2':
+
+ # Build All Languages
+ show_title = '# Toutes les videos'
+ next_value = 'list_videos_films_series_1'
+ show_url = params.show_url
+ shows.append({
+ 'label': show_title,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next=next_value,
+ title=show_title,
+ show_url=show_url,
+ page='1',
+ window_title=show_title
+ )
+ })
+
+ for language, language_url in CATEGORIES_LANGUAGE.iteritems():
+
+ show_title = language
+ next_value = 'list_videos_films_series_1'
+ show_url = params.show_url + language_url
+
+ shows.append({
+ 'label': show_title,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next=next_value,
+ title=show_title,
+ show_url=show_url,
+ page='1',
+ window_title=show_title
+ )
+ })
+
+ return common.PLUGIN.create_listing(
+ shows,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_LABEL,
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED
+ ),
+ update_listing='update_listing' in params,
+ )
+
+
+@common.PLUGIN.mem_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_films_series_1':
+
+ replay_episodes_html = utils.get_webcontent(
+ params.show_url + '?page=%s' % params.page)
+ replay_episodes_soup = bs(replay_episodes_html, 'html.parser')
+ episodes = replay_episodes_soup.find_all(
+ 'article', class_="media-meta sidecontent small")
+
+ for episode in episodes:
+ video_title = episode.find('h2').find(
+ 'span').find('a').get_text().strip().encode('utf-8')
+ video_id = re.compile(
+ 'cmedia=(.*?)&').findall(episode.find('a').get('href'))[0]
+ video_img = episode.find('img').get('src').encode('utf-8')
+ video_duration = 0
+
+ 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=video_id) + ')'
+ )
+ context_menu.append(download_video)
+
+ videos.append({
+ 'label': video_title,
+ 'thumb': 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
+ })
+
+ # More videos...
+ videos.append({
+ 'label': '# ' + common.ADDON.get_localized_string(30100),
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ show_url=params.show_url,
+ next='list_videos_films_series_1',
+ page=str(int(params.page) + 1),
+ update_listing=True,
+ previous_listing=str(videos)
+ ),
+ })
+
+ elif params.next == 'list_videos_emissions_1':
+ replay_episodes_html = utils.get_webcontent(
+ params.show_url + '?page=%s' % params.page)
+ replay_episodes_soup = bs(replay_episodes_html, 'html.parser')
+
+ if replay_episodes_soup.find(
+ 'section', class_='media-meta-list by2 j_w') is not None:
+ root_episodes_soup = replay_episodes_soup.find(
+ 'section', class_='media-meta-list by2 j_w')
+ episodes = root_episodes_soup.find_all(
+ 'figure', class_='media-meta-fig')
+ else:
+ episodes = replay_episodes_soup.find_all(
+ 'figure', class_='media-meta-fig')
+
+ for episode in episodes:
+ if episode.find('h3') is not None:
+ video_title = episode.find(
+ 'h3').find('span').find('a').get_text().strip()
+ else:
+ video_title = episode.find(
+ 'h2').find('span').find('a').get_text().strip()
+ if '?cmedia=' in episode.find('a').get('href'):
+ video_id = episode.find('a').get('href').split('?cmedia=')[1]
+ elif 'cfilm=' in episode.find('a').get('href') or \
+ 'cserie=' in episode.find('a').get('href'):
+ video_id = episode.find(
+ 'h2').find('span').find(
+ 'a').get('href').split('_cmedia=')[1].split('&')[0]
+ else:
+ video_id = episode.find(
+ 'a').get('href').split('-')[1].replace('/', '')
+ video_plot = ''
+ for plot_value in episode.find(
+ 'div', class_='media-meta-figcaption-inner').find_all('p'):
+ video_plot = plot_value.get_text().strip()
+ if episode.find('meta') is not None:
+ video_img = episode.find('meta').get('content').encode('utf-8')
+ else:
+ video_img = episode.find('img').get('src').encode('utf-8')
+ video_duration = 0
+
+ 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=video_id) + ')'
+ )
+ context_menu.append(download_video)
+
+ videos.append({
+ 'label': video_title,
+ 'thumb': 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
+ })
+
+ # More videos...
+ videos.append({
+ 'label': '# ' + common.ADDON.get_localized_string(30100),
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ show_url=params.show_url,
+ # last_page=params.last_page,
+ 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_LABEL_IGNORE_THE,
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED
+ ),
+ content='tvshows',
+ update_listing='update_listing' in params,
+ )
+
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
+def get_video_url(params):
+ """Get video URL and start video player"""
+ video_json = utils.get_webcontent(
+ URL_API_MEDIA % (params.video_id, PARTNER))
+ video_json_parser = json.loads(video_json)
+
+ url = ''
+ if 'rendition' in video_json_parser["media"]:
+ # (Video Hosted By Allocine)
+ for media in video_json_parser["media"]["rendition"]:
+ url = media["href"]
+ if requests.get(url, stream=True).status_code == 404:
+ utils.send_notification(common.ADDON.get_localized_string(30111))
+ return ''
+ return url
+ else:
+ # (Video Not Hosted By Allocine)
+ url_video_embeded = re.compile(
+ 'src=\'(.*?)\''
+ ).findall(video_json_parser["media"]["trailerEmbed"])[0]
+ url_video_embeded_html = utils.get_webcontent(url_video_embeded)
+ url_video_json = re.compile(
+ 'data-model="(.*?)"'
+ ).findall(url_video_embeded_html)[0].replace('&quot;', '"')
+ url_video_json_parser = json.loads(url_video_json)
+ # Case Facebook, Youtube and Vimeo (Not Working HTTP 503)
+ if 'facebook' in url_video_json or \
+ 'youtube' in url_video_json or 'vimeo' in url_video_json:
+ url_ytdl = url_video_json_parser["videos"][0]["sources"]["code"]
+ url_ytdl = re.compile('src=(.*?) ').findall(
+ url_ytdl
+ )[0].replace('\\', '').replace('&amp;', '&').replace('"', '')
+ # Case DailyMotion
+ else:
+ url_ytdl = url_video_json_parser["videos"]
+ url_ytdl = url_ytdl[0]["sources"]["url_provider"]
+ url_ytdl = 'https:' + url_ytdl.split(
+ ':')[1].replace(
+ '\\', '').replace('&amp;', '&').replace('"', '')
+ ydl = YoutubeDL()
+ ydl.add_default_info_extractors()
+ with ydl:
+ result = ydl.extract_info(url_ytdl, download=False)
+ for format_video in result['formats']:
+ url = format_video['url']
+ return url
diff --git a/plugin.video.catchuptvandmore/resources/lib/channels/ws/tetesaclaques.py b/plugin.video.catchuptvandmore/resources/lib/channels/ws/tetesaclaques.py
new file mode 100644
index 0000000..195d19f
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/lib/channels/ws/tetesaclaques.py
@@ -0,0 +1,326 @@
+# -*- 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 ast
+import re
+from bs4 import BeautifulSoup as bs
+from youtube_dl import YoutubeDL
+from resources.lib import utils
+from resources.lib import common
+
+# TO DO
+# Play Spanish Videos
+
+URL_ROOT = 'https://www.tetesaclaques.tv'
+
+URL_YOUTUBE = 'https://www.youtube.com/embed/%s?&autoplay=0'
+# YTid
+
+# 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)
+ 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)
+ return None
+
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
+def root(params):
+ """Add modes in the listing"""
+ modes = []
+
+ list_categories_html = utils.get_webcontent(URL_ROOT)
+ list_categories_soup = bs(list_categories_html, 'html.parser')
+ list_categories = list_categories_soup.find(
+ 'div', class_='jqueryslidemenu').find('ul').find('ul').find_all('li')
+
+ for category in list_categories:
+
+ if 'personnages' in category.find('a').get('href'):
+ value_next = 'list_shows_1'
+ else:
+ value_next = 'list_videos_1'
+ category_title = category.find('a').get_text()
+ category_url = URL_ROOT + '/' + category.find('a').get('href')
+
+ modes.append({
+ 'label': category_title,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next=value_next,
+ title=category_title,
+ page='1',
+ category_url=category_url,
+ window_title=category_title
+ )
+ })
+
+ return common.PLUGIN.create_listing(
+ modes,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_LABEL,
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED
+ ),
+ )
+
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
+def list_shows(params):
+ """Build categories listing"""
+ shows = []
+
+ list_shows_html = utils.get_webcontent(params.category_url)
+ list_shows_soup = bs(list_shows_html, 'html.parser')
+ list_shows = list_shows_soup.find(
+ 'div', class_='personnages').find_all('a')
+
+ for personnage in list_shows:
+
+ show_title = personnage.get('title')
+ show_img = URL_ROOT + personnage.find('img').get('src')
+ show_url = URL_ROOT + personnage.get('href').encode('utf-8')
+
+ shows.append({
+ 'label': show_title,
+ 'thumb': show_img,
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ next='list_videos_2',
+ title=show_title,
+ category_url=show_url,
+ window_title=show_title
+ )
+ })
+
+ return common.PLUGIN.create_listing(
+ shows,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_LABEL,
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED
+ ),
+ )
+
+
+@common.PLUGIN.mem_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':
+
+ replay_episodes_html = utils.get_webcontent(
+ params.category_url + '/par_date/%s' % params.page)
+ replay_episodes_soup = bs(replay_episodes_html, 'html.parser')
+
+ if 'serietele' in params.category_url:
+ episodes = replay_episodes_soup.find(
+ 'div', class_='serieTele').find_all('div')
+
+ for episode in episodes:
+ if episode.find('a') is not None and \
+ episode.find('img', class_='thumb') is not None:
+ video_title = episode.find('a').find(
+ 'span', class_='saison-episode'
+ ).get_text().strip() + ' ' + episode.find('img').get('alt')
+ video_url = URL_ROOT + episode.find('a').get('href')
+ video_img = URL_ROOT + '/' + episode.find('img').get('src')
+ video_duration = 0
+
+ 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_url=video_url) + ')'
+ )
+ context_menu.append(download_video)
+
+ videos.append({
+ 'label': video_title,
+ 'thumb': 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:
+ episodes = replay_episodes_soup.find_all(
+ 'a', class_='lienThumbCollection')
+
+ for episode in episodes:
+ video_title = episode.find('img').get('alt')
+ video_url = URL_ROOT + episode.get('href')
+ video_img = URL_ROOT + '/' + episode.find('img').get('src')
+ video_duration = 0
+
+ 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_url=video_url) + ')'
+ )
+ context_menu.append(download_video)
+
+ videos.append({
+ 'label': video_title,
+ 'thumb': 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
+ })
+
+ # More videos...
+ videos.append({
+ 'label': '# ' + common.ADDON.get_localized_string(30100),
+ 'url': common.PLUGIN.get_url(
+ action='channel_entry',
+ category_url=params.category_url,
+ next='list_videos_1',
+ page=str(int(params.page) + 1),
+ update_listing=True,
+ previous_listing=str(videos)
+ ),
+ })
+
+ elif 'list_videos_2':
+
+ replay_episodes_html = utils.get_webcontent(params.category_url)
+ replay_episodes_soup = bs(replay_episodes_html, 'html.parser')
+ episodes = replay_episodes_soup.find_all(
+ 'a', class_='lienThumbCollection')
+
+ for episode in episodes:
+ video_title = episode.find('img').get('alt')
+ video_url = URL_ROOT + episode.get('href')
+ video_img = URL_ROOT + '/' + episode.find('img').get('src')
+ video_duration = 0
+
+ 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_url=video_url) + ')'
+ )
+ context_menu.append(download_video)
+
+ videos.append({
+ 'label': video_title,
+ 'thumb': 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
+ })
+
+ return common.PLUGIN.create_listing(
+ videos,
+ sort_methods=(
+ common.sp.xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE,
+ common.sp.xbmcplugin.SORT_METHOD_UNSORTED
+ ),
+ content='tvshows',
+ update_listing='update_listing' in params,
+ )
+
+
+@common.PLUGIN.mem_cached(common.CACHE_TIME)
+def get_video_url(params):
+ """Get video URL and start video player"""
+ video_html = utils.get_webcontent(params.video_url)
+ if re.compile('AtedraVideo.video_id = "(.*?)"').findall(video_html):
+ url_ytdl = URL_YOUTUBE % re.compile(
+ 'AtedraVideo.video_id = "(.*?)"').findall(video_html)[0]
+ else:
+ # TO DO Espagnol Video
+ return ''
+
+ ydl = YoutubeDL()
+ ydl.add_default_info_extractors()
+ with ydl:
+ result = ydl.extract_info(url_ytdl, download=False)
+ for format_video in result['formats']:
+ url = format_video['url']
+ return url
diff --git a/plugin.video.catchuptvandmore/resources/lib/common.py b/plugin.video.catchuptvandmore/resources/lib/common.py
index f403d7f..5ef8879 100755..100644
--- a/plugin.video.catchuptvandmore/resources/lib/common.py
+++ b/plugin.video.catchuptvandmore/resources/lib/common.py
@@ -30,6 +30,7 @@ CACHE_TIME = 10
PLUGIN_NAME = 'Catch-up TV & More'
+
def get_window_title():
query = sp.sys.argv[2][1:]
params = PLUGIN.get_params(query)
diff --git a/plugin.video.catchuptvandmore/resources/lib/simpleplugin.py b/plugin.video.catchuptvandmore/resources/lib/simpleplugin.py
index f3b6f9d..6b1e90d 100755..100644
--- a/plugin.video.catchuptvandmore/resources/lib/simpleplugin.py
+++ b/plugin.video.catchuptvandmore/resources/lib/simpleplugin.py
@@ -11,6 +11,7 @@ SimplePlugin micro-framework for Kodi content plugins
import os
import sys
import re
+import inspect
from datetime import datetime, timedelta
import cPickle as pickle
from urlparse import parse_qs
@@ -21,15 +22,20 @@ from copy import deepcopy
from types import GeneratorType
from hashlib import md5
from shutil import move
+from contextlib import contextmanager
+from pprint import pformat
import xbmcaddon
import xbmc
import xbmcplugin
import xbmcgui
-__all__ = ['SimplePluginError', 'Storage', 'Addon', 'Plugin', 'Params']
+__all__ = ['SimplePluginError', 'Storage', 'MemStorage',
+ 'Addon', 'Plugin', 'Params', 'debug_exception']
-ListContext = namedtuple('ListContext', ['listing', 'succeeded', 'update_listing', 'cache_to_disk',
- 'sort_methods', 'view_mode', 'content'])
+ListContext = namedtuple('ListContext', ['listing', 'succeeded',
+ 'update_listing', 'cache_to_disk',
+ 'sort_methods', 'view_mode',
+ 'content', 'category'])
PlayContext = namedtuple('PlayContext', ['path', 'play_item', 'succeeded'])
@@ -38,6 +44,71 @@ class SimplePluginError(Exception):
pass
+def _format_vars(variables):
+ """
+ Format variables dictionary
+
+ :param variables: variables dict
+ :type variables: dict
+ :return: formatted string with sorted ``var = val`` pairs
+ :rtype: str
+ """
+ var_list = [(var, val) for var, val in variables.iteritems()]
+ lines = []
+ for var, val in sorted(var_list, key=lambda i: i[0]):
+ if not (var.startswith('__') or var.endswith('__')):
+ lines.append('{0} = {1}'.format(var, pformat(val)))
+ return '\n'.join(lines)
+
+
+@contextmanager
+def debug_exception(logger=None):
+ """
+ Diagnostic helper context manager
+
+ It controls execution within its context and writes extended
+ diagnostic info to the Kodi log if an unhandled exception
+ happens within the context. The info includes the following items:
+
+ - Module path.
+ - Code fragment where the exception has happened.
+ - Global variables.
+ - Local variables.
+
+ After logging the diagnostic info the exception is re-raised.
+
+ Example::
+
+ with debug_exception():
+ # Some risky code
+ raise RuntimeError('Fatal error!')
+
+ :param logger: logger function which must accept a single argument
+ which is a log message. By default it is :func:`xbmc.log`
+ with ``ERROR`` level.
+ """
+ try:
+ yield
+ except:
+ if logger is None:
+ logger = lambda msg: xbmc.log(msg, xbmc.LOGERROR)
+ logger('Unhandled exception detected!')
+ logger('*** Start diagnostic info ***')
+ frame_info = inspect.trace(5)[-1]
+ logger('File: {0}'.format(frame_info[1]))
+ context = ''
+ for i, line in enumerate(frame_info[4], frame_info[2] - frame_info[5]):
+ if i == frame_info[2]:
+ context += '{0}:>{1}'.format(str(i).rjust(5), line)
+ else:
+ context += '{0}: {1}'.format(str(i).rjust(5), line)
+ logger('Code context:\n' + context)
+ logger('Global variables:\n' + _format_vars(frame_info[0].f_globals))
+ logger('Local variables:\n' + _format_vars(frame_info[0].f_locals))
+ logger('**** End diagnostic info ****')
+ raise
+
+
class Params(dict):
"""
Params(**kwargs)
@@ -47,6 +118,8 @@ class Params(dict):
Parameters can be accessed both through :class:`dict` keys and
instance properties.
+ .. note:: For a missing parameter an instance property returns ``None``.
+
Example:
.. code-block:: python
@@ -56,10 +129,8 @@ class Params(dict):
foo = params['foo'] # Access by key
bar = params.bar # Access through property. Both variants are equal
"""
- def __getattr__(self, item):
- if item not in self:
- raise AttributeError('Invalid parameter: "{0}"!'.format(item))
- return self[item]
+ def __getattr__(self, key):
+ return self.get(key)
def __str__(self):
return '<Params {0}>'.format(super(Params, self).__repr__())
@@ -70,6 +141,8 @@ class Params(dict):
class Storage(MutableMapping):
"""
+ Storage(storage_dir, filename='storage.pcl')
+
Persistent storage for arbitrary data with a dictionary-like interface
It is designed as a context manager and better be used
@@ -107,7 +180,7 @@ class Storage(MutableMapping):
def __enter__(self):
return self
- def __exit__(self, exc_type, exc_val, exc_tb):
+ def __exit__(self, t, v, tb):
self.flush()
def __getitem__(self, key):
@@ -120,7 +193,7 @@ class Storage(MutableMapping):
del self._storage[key]
def __iter__(self):
- return self._storage.__iter__()
+ return iter(self._storage)
def __len__(self):
return len(self._storage)
@@ -163,6 +236,106 @@ class Storage(MutableMapping):
return deepcopy(self._storage)
+class MemStorage(MutableMapping):
+ """
+ MemStorage(storage_id)
+
+ In-memory storage with dict-like interface
+
+ The data is stored in the Kodi core so contents of a MemStorage instance
+ with the same ID can be shared between different Python processes.
+
+ .. note:: Keys are case-insensitive
+
+ .. warning:: :class:`MemStorage` does not allow to modify mutable objects
+ in place! You need to assign them to variables first, modify and
+ store them back to a MemStorage instance.
+
+ Example:
+
+ .. code-block:: python
+
+ storage = MemStorage('foo')
+ some_list = storage['bar']
+ some_list.append('spam')
+ storage['bar'] = some_list
+
+ :param storage_id: ID of this storage instance
+ :type storage_id: str
+ :param window_id: the ID of a Kodi Window object where storage contents
+ will be stored.
+ :type window_id: int
+ """
+ def __init__(self, storage_id, window_id=10000):
+ self._id = storage_id
+ self._window = xbmcgui.Window(window_id)
+ try:
+ self['__keys__']
+ except KeyError:
+ self['__keys__'] = []
+
+ def _check_key(self, key):
+ if not isinstance(key, str):
+ raise TypeError('Storage key must be of str type!')
+
+ def _format_contents(self):
+ lines = []
+ for key, val in self.iteritems():
+ lines.append('{0}: {1}'.format(repr(key), repr(val)))
+ return ', '.join(lines)
+
+ def __str__(self):
+ return '<MemStorage {{{0}}}>'.format(self._format_contents())
+
+ def __repr__(self):
+ return '<simpleplugin.MemStorage object {{{0}}}'.format(self._format_contents())
+
+ def __getitem__(self, key):
+ self._check_key(key)
+ full_key = '{0}__{1}'.format(self._id, key)
+ raw_item = self._window.getProperty(full_key)
+ if raw_item:
+ return pickle.loads(raw_item)
+ else:
+ raise KeyError(key)
+
+ def __setitem__(self, key, value):
+ self._check_key(key)
+ full_key = '{0}__{1}'.format(self._id, key)
+ self._window.setProperty(full_key, pickle.dumps(value))
+ if key != '__keys__':
+ keys = self['__keys__']
+ keys.append(key)
+ self['__keys__'] = keys
+
+ def __delitem__(self, key):
+ self._check_key(key)
+ full_key = '{0}__{1}'.format(self._id, key)
+ item = self._window.getProperty(full_key)
+ if item:
+ self._window.clearProperty(full_key)
+ if key != '__keys__':
+ keys = self['__keys__']
+ keys.remove(key)
+ self['__keys__'] = keys
+ else:
+ raise KeyError(key)
+
+ def __contains__(self, key):
+ self._check_key(key)
+ full_key = '{0}__{1}'.format(self._id, key)
+ item = self._window.getProperty(full_key)
+ if item:
+ return True
+ return False
+
+ def __iter__(self):
+ return iter(self['__keys__'])
+
+ def __len__(self):
+ return len(self['__keys__'])
+
+
class Addon(object):
"""
Base addon class
@@ -358,7 +531,7 @@ class Addon(object):
:param message: message to write to the Kodi log
:type message: str
"""
- self.log(message, xbmc.LOGINFO)
+ self.log(message, xbmc.LOGNOTICE)
def log_warning(self, message):
"""
@@ -408,6 +581,62 @@ class Addon(object):
"""
return Storage(self.config_dir, filename)
+ def get_mem_storage(self, storage_id='', window_id=10000):
+ """
+ Creates an in-memory storage for this addon with :class:`dict`-like
+ interface
+
+ The storage can store picklable Python objects as long as
+ Kodi is running and storage contents can be shared between
+ Python processes. Different addons have separate storages,
+ so storages with the same names created with this method
+ do not conflict.
+
+ Example::
+
+ addon = Addon()
+ storage = addon.get_mem_storage()
+ foo = storage['foo']
+ storage['bar'] = bar
+
+ :param storage_id: optional storage ID (case-insensitive).
+ :type storage_id: str
+ :param window_id: the ID of a Kodi Window object where storage contents
+ will be stored.
+ :type window_id: int
+ :return: in-memory storage for this addon
+ :rtype: MemStorage
+ """
+ if storage_id:
+ storage_id = '{0}_{1}'.format(self.id, storage_id)
+ return MemStorage(storage_id, window_id)
+
+ def _get_cached_data(self, cache, func, duration, *args, **kwargs):
+ """
+ Get data from a cache object
+
+ :param cache: cache object
+ :param func: function to cache
+ :param duration: cache duration
+ :param args: function args
+ :param kwargs: function kwargs
+ :return: function return data
+ """
+ if duration <= 0:
+ raise ValueError('Caching duration cannot be zero or negative!')
+ current_time = datetime.now()
+ key = func.__name__ + str(args) + str(kwargs)
+ try:
+ data, timestamp = cache[key]
+ if current_time - timestamp > timedelta(minutes=duration):
+ raise KeyError
+ self.log_debug('Cache hit: {0}'.format(key))
+ except KeyError:
+ self.log_debug('Cache miss: {0}'.format(key))
+ data = func(*args, **kwargs)
+ cache[key] = (data, current_time)
+ return data
+
def cached(self, duration=10):
"""
Cached decorator
@@ -429,20 +658,30 @@ class Addon(object):
@wraps(func)
def inner_wrapper(*args, **kwargs):
with self.get_storage('__cache__.pcl') as cache:
- current_time = datetime.now()
- key = func.__name__ + str(args) + str(kwargs)
- try:
- data, timestamp = cache[key]
- if duration > 0 and current_time - timestamp > timedelta(minutes=duration):
- raise KeyError
- elif duration <= 0:
- raise ValueError('Caching duration cannot be zero or negative!')
- self.log_debug('Cache hit: {0}'.format(key))
- except KeyError:
- self.log_debug('Cache miss: {0}'.format(key))
- data = func(*args, **kwargs)
- cache[key] = (data, current_time)
- return data
+ return self._get_cached_data(cache, func, duration, *args, **kwargs)
+ return inner_wrapper
+ return outer_wrapper
+
+ def mem_cached(self, duration=10):
+ """
+ In-memory cache decorator
+
+ Usage::
+
+ @plugin.mem_cached(30)
+ def my_func(*args, **kwargs):
+ # Do some stuff
+ return value
+
+ :param duration: caching duration in min (positive values only)
+ :type duration: int
+ :raises ValueError: if duration is zero or negative
+ """
+ def outer_wrapper(func):
+ @wraps(func)
+ def inner_wrapper(*args, **kwargs):
+ cache = self.get_mem_storage('***cache***')
+ return self._get_cached_data(cache, func, duration, *args, **kwargs)
return inner_wrapper
return outer_wrapper
@@ -462,7 +701,7 @@ class Addon(object):
:type ui_string: str
:return: a UI string from translated :file:`strings.po`.
:rtype: unicode
- :raises simpleplugin.SimplePluginError: if :meth:`Addon.initialize_gettext` wasn't called first
+ :raises SimplePluginError: if :meth:`Addon.initialize_gettext` wasn't called first
or if a string is not found in English :file:`strings.po`.
"""
if self._ui_strings_map is not None:
@@ -502,9 +741,11 @@ class Addon(object):
with localized versions if these strings are translated.
:return: :meth:`Addon.gettext` method object
- :raises simpleplugin.SimplePluginError: if the addon's English :file:`strings.po` file is missing
+ :raises SimplePluginError: if the addon's English :file:`strings.po` file is missing
"""
strings_po = os.path.join(self.path, 'resources', 'language', 'resource.language.en_gb', 'strings.po')
+ if not os.path.exists(strings_po):
+ strings_po = os.path.join(self.path, 'resources', 'language', 'English', 'strings.po')
if os.path.exists(strings_po):
with open(strings_po, 'rb') as fo:
raw_strings = fo.read()
@@ -563,20 +804,20 @@ class Plugin(Addon):
plugin = Plugin()
@plugin.action()
- def root(params): # Mandatory item!
+ def root(): # Mandatory item!
return [{'label': 'Foo',
- 'url': plugin.get_url(action='some_action', param='Foo')},
+ 'url': plugin.get_url(action='some_action', label='Foo')},
{'label': 'Bar',
- 'url': plugin.get_url(action='some_action', param='Bar')}]
+ 'url': plugin.get_url(action='some_action', label='Bar')}]
@plugin.action()
def some_action(params):
- return [{'label': params['param']}]
+ return [{'label': params.label]}]
plugin.run()
- An action callable receives 1 parameter -- params.
- params is a dict-like object containing plugin call parameters (including action string)
+ An action callable may receive 1 optional parameter which is
+ a dict-like object containing plugin call parameters (including action string)
The action callable can return
either a list/generator of dictionaries representing Kodi virtual directory items
or a resolved playable path (:class:`str` or :obj:`unicode`) for Kodi to play.
@@ -626,6 +867,21 @@ class Plugin(Addon):
except for ``'url'`` and ``'is_folder'``, are ignored.
- properties -- a dictionary of list item properties
(see :meth:`xbmcgui.ListItem.setProperty`) -- optional.
+ - cast -- a list of cast info (actors, roles, thumbnails) for the list item
+ (see :meth:`xbmcgui.ListItem.setCast`) -- optional.
+ - offscreen -- if ``True`` do not lock GUI (used for Python scrapers and subtitle plugins) --
+ optional.
+ - content_lookup -- if ``False``, do not HEAD requests to get mime type. Optional.
+ - online_db_ids -- a :class:`dict` of ``{'label': 'value'}`` pairs representing
+ the item's IDs in popular online databases. Possible labels: 'imdb', 'tvdb',
+ 'tmdb', 'anidb', see :meth:`xbmcgui.ListItem.setUniqueIDs`. Optional.
+ - ratings -- a :class:`list` of :class:`dict`s with the following keys:
+ 'type' (:class:`str`), 'rating' (:class:`float`),
+ 'votes' (:class:`int`, optional), 'defaultt' (:class:`bool`, optional).
+ This list sets item's ratings in popular online databases.
+ Possible types: 'imdb', 'tvdb', tmdb', 'anidb'.
+ See :meth:`xbmcgui.ListItem.setRating`. Optional.
+
Example 3::
@@ -743,7 +999,7 @@ class Plugin(Addon):
:param name: action's name (optional).
:type name: str
- :raises simpleplugin.SimplePluginError: if the action with such name is already defined.
+ :raises SimplePluginError: if the action with such name is already defined.
"""
def wrap(func, name=name):
if name is None:
@@ -754,49 +1010,55 @@ class Plugin(Addon):
return func
return wrap
- def run(self, category=''):
+ def run(self, category=None):
"""
Run plugin
- :param category: str - plugin sub-category, e.g. 'Comedy'.
- See :func:`xbmcplugin.setPluginCategory` for more info.
- :type category: str
- :raises simpleplugin.SimplePluginError: if unknown action string is provided.
+ :raises SimplePluginError: if unknown action string is provided.
"""
- self._handle = int(sys.argv[1])
if category:
- xbmcplugin.setPluginCategory(self._handle, category)
+ self.log_warning(
+ 'Deprecation warning: Plugin category is no longer set via Plugin.run(). '
+ 'Use "category" parameter of Plugin.create_listing() instead.'
+ )
+ self._handle = int(sys.argv[1])
params = self.get_params(sys.argv[2][1:])
action = params.get('action', 'root')
self.log_debug(str(self))
self.log_debug('Actions: {0}'.format(str(self.actions.keys())))
- self.log_debug('Called action "{0}" with params "{1}"'.format(action, str(params)))
+ self.log_debug('Called action "{0}" with params "{1}"'.format(
+ action, str(params))
+ )
try:
action_callable = self.actions[action]
except KeyError:
raise SimplePluginError('Invalid action: "{0}"!'.format(action))
else:
- result = action_callable(params)
+ # inspect.isfunction is needed for tests
+ if inspect.isfunction(action_callable) and not inspect.getargspec(action_callable).args:
+ result = action_callable()
+ else:
+ result = action_callable(params)
self.log_debug('Action return value: {0}'.format(str(result)))
if isinstance(result, (list, GeneratorType)):
self._add_directory_items(self.create_listing(result))
elif isinstance(result, basestring):
self._set_resolved_url(self.resolve_url(result))
- elif isinstance(result, tuple) and hasattr(result, 'listing'):
+ elif isinstance(result, ListContext):
self._add_directory_items(result)
- elif isinstance(result, tuple) and hasattr(result, 'path'):
+ elif isinstance(result, PlayContext):
self._set_resolved_url(result)
else:
self.log_debug('The action "{0}" has not returned any valid data to process.'.format(action))
@staticmethod
def create_listing(listing, succeeded=True, update_listing=False, cache_to_disk=False, sort_methods=None,
- view_mode=None, content=None):
+ view_mode=None, content=None, category=None):
"""
Create and return a context dict for a virtual folder listing
:param listing: the list of the plugin virtual folder items
- :type listing: :class:`list` or :class:`types.GeneratorType`
+ :type listing: list or types.GeneratorType
:param succeeded: if ``False`` Kodi won't open a new listing and stays on the current level.
:type succeeded: bool
:param update_listing: if ``True``, Kodi won't open a sub-listing but refresh the current one.
@@ -811,11 +1073,15 @@ class Plugin(Addon):
:param content: string - current plugin content, e.g. 'movies' or 'episodes'.
See :func:`xbmcplugin.setContent` for more info.
:type content: str
+ :param category: str - plugin sub-category, e.g. 'Comedy'.
+ See :func:`xbmcplugin.setPluginCategory` for more info.
+ :type category: str
:return: context object containing necessary parameters
to create virtual folder listing in Kodi UI.
:rtype: ListContext
"""
- return ListContext(listing, succeeded, update_listing, cache_to_disk, sort_methods, view_mode, content)
+ return ListContext(listing, succeeded, update_listing, cache_to_disk,
+ sort_methods, view_mode, content, category)
@staticmethod
def resolve_url(path='', play_item=None, succeeded=True):
@@ -847,15 +1113,25 @@ class Plugin(Addon):
:return: ListItem instance
:rtype: xbmcgui.ListItem
"""
- list_item = xbmcgui.ListItem(label=item.get('label', ''),
- label2=item.get('label2', ''),
- path=item.get('path', ''))
- if int(xbmc.getInfoLabel('System.BuildVersion')[:2]) >= 16:
+ major_version = xbmc.getInfoLabel('System.BuildVersion')[:2]
+ if major_version >= '18':
+ list_item = xbmcgui.ListItem(label=item.get('label', ''),
+ label2=item.get('label2', ''),
+ path=item.get('path', ''),
+ offscreen=item.get('offscreen', False))
+ else:
+ list_item = xbmcgui.ListItem(label=item.get('label', ''),
+ label2=item.get('label2', ''),
+ path=item.get('path', ''))
+ if major_version >= '16':
art = item.get('art', {})
art['thumb'] = item.get('thumb', '')
art['icon'] = item.get('icon', '')
art['fanart'] = item.get('fanart', '')
item['art'] = art
+ cont_look = item.get('content_lookup')
+ if cont_look is not None:
+ list_item.setContentLookup(cont_look)
else:
list_item.setThumbnailImage(item.get('thumb', ''))
list_item.setIconImage(item.get('icon', ''))
@@ -877,6 +1153,17 @@ class Plugin(Addon):
if item.get('properties'):
for key, value in item['properties'].iteritems():
list_item.setProperty(key, value)
+ if major_version >= '17':
+ cast = item.get('cast')
+ if cast is not None:
+ list_item.setCast(cast)
+ db_ids = item.get('online_db_ids')
+ if db_ids is not None:
+ list_item.setUniqueIDs(db_ids)
+ ratings = item.get('ratings')
+ if ratings is not None:
+ for rating in ratings:
+ list_item.setRating(**rating)
return list_item
def _add_directory_items(self, context):
@@ -885,8 +1172,11 @@ class Plugin(Addon):
:param context: context object
:type context: ListContext
+ :raises SimplePluginError: if sort_methods parameter is not int, tuple or list
"""
self.log_debug('Creating listing from {0}'.format(str(context)))
+ if context.category is not None:
+ xbmcplugin.setPluginCategory(self._handle, context.category)
if context.content is not None:
xbmcplugin.setContent(self._handle, context.content) # This must be at the beginning
for item in context.listing:
@@ -900,7 +1190,14 @@ class Plugin(Addon):
is_folder = False
xbmcplugin.addDirectoryItem(self._handle, item['url'], list_item, is_folder)
if context.sort_methods is not None:
- [xbmcplugin.addSortMethod(self._handle, method) for method in context.sort_methods]
+ if isinstance(context.sort_methods, int):
+ xbmcplugin.addSortMethod(self._handle, context.sort_methods)
+ elif isinstance(context.sort_methods, (tuple, list)):
+ for method in context.sort_methods:
+ xbmcplugin.addSortMethod(self._handle, method)
+ else:
+ raise TypeError(
+ 'sort_methods parameter must be of int, tuple or list type!')
xbmcplugin.endOfDirectory(self._handle,
context.succeeded,
context.update_listing,
@@ -920,4 +1217,4 @@ class Plugin(Addon):
list_item = xbmcgui.ListItem(path=context.path)
else:
list_item = self.create_list_item(context.play_item)
- xbmcplugin.setResolvedUrl(self._handle, context.succeeded, list_item) \ No newline at end of file
+ xbmcplugin.setResolvedUrl(self._handle, context.succeeded, list_item)
diff --git a/plugin.video.catchuptvandmore/resources/lib/skeleton.py b/plugin.video.catchuptvandmore/resources/lib/skeleton.py
index 7d2f9a2..b6f63cd 100755..100644
--- a/plugin.video.catchuptvandmore/resources/lib/skeleton.py
+++ b/plugin.video.catchuptvandmore/resources/lib/skeleton.py
@@ -22,11 +22,24 @@
CATEGORIES = {
+ 'main_menu.be': 'Belgian channels',
+ 'main_menu.eu': 'European channels',
'main_menu.fr': 'French channels',
- 'main_menu.eu': 'European channels'
+ 'main_menu.uk': 'United Kingdom channels',
+ 'main_menu.ws': 'Websites'
}
CHANNELS = {
+
+ 'main_menu.be': {
+ 'channels.be.rtbf.auvio': 'RTBF Auvio (La Une, La deux, La Trois, ...)'
+ },
+
+ 'main_menu.eu': {
+ 'channels.eu.arte.arte': 'Arte',
+ 'channels.eu.euronews.euronews': 'Euronews'
+ },
+
'main_menu.fr': {
'channels.fr.tf1.tf1': 'TF1',
'channels.fr.pluzz.france2': 'France 2',
@@ -70,8 +83,16 @@ CHANNELS = {
'channels.fr.publicsenat.publicsenat': 'Public Sénat'
},
- 'main_menu.eu': {
- 'channels.eu.arte.arte': 'Arte',
- 'channels.eu.euronews.euronews': 'Euronews'
+ 'main_menu.uk': {
+ 'channels.uk.blaze.blaze': 'Blaze',
+ 'channels.uk.uktvplay.dave': 'Dave',
+ 'channels.uk.uktvplay.really': 'Really',
+ 'channels.uk.uktvplay.yesterday': 'Yesterday',
+ 'channels.uk.uktvplay.drama': 'Drama'
+ },
+
+ 'main_menu.ws': {
+ 'channels.ws.allocine.allocine': 'Allociné',
+ 'channels.ws.tetesaclaques.tetesaclaques': 'Au pays des Têtes à claques'
}
}
diff --git a/plugin.video.catchuptvandmore/resources/lib/utils.py b/plugin.video.catchuptvandmore/resources/lib/utils.py
index e9206df..e9206df 100755..100644
--- a/plugin.video.catchuptvandmore/resources/lib/utils.py
+++ b/plugin.video.catchuptvandmore/resources/lib/utils.py
diff --git a/plugin.video.catchuptvandmore/resources/media/categories/be.png b/plugin.video.catchuptvandmore/resources/media/categories/be.png
new file mode 100644
index 0000000..80b8037
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/categories/be.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/categories/eu.png b/plugin.video.catchuptvandmore/resources/media/categories/eu.png
index e534746..e534746 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/categories/eu.png
+++ 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
index cb017dc..cb017dc 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/categories/fr.png
+++ b/plugin.video.catchuptvandmore/resources/media/categories/fr.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/categories/uk.png b/plugin.video.catchuptvandmore/resources/media/categories/uk.png
new file mode 100644
index 0000000..548cf45
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/categories/uk.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/categories/ws.png b/plugin.video.catchuptvandmore/resources/media/categories/ws.png
new file mode 100644
index 0000000..608b328
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/categories/ws.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/be/auvio.png b/plugin.video.catchuptvandmore/resources/media/channels/be/auvio.png
new file mode 100644
index 0000000..fd50c18
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/be/auvio.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/be/auvio_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/be/auvio_fanart.png
new file mode 100644
index 0000000..05c443e
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/be/auvio_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/eu/arte.png b/plugin.video.catchuptvandmore/resources/media/channels/eu/arte.png
index 3c003a2..3c003a2 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/eu/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
index dd5491b..dd5491b 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/eu/arte_fanart.png
+++ 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
index 0b40147..0b40147 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/eu/euronews.png
+++ 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
index a05737f..a05737f 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/eu/euronews_fanart.png
+++ 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
index 10e36e0..10e36e0 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/01net.png
+++ 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
index c793db8..c793db8 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/01net_fanart.png
+++ 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 100755..100644
--- 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 100755..100644
--- 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
index 8286439..8286439 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/bfmbusiness.png
+++ 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
index a849cda..a849cda 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/bfmbusiness_fanart.png
+++ 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 100755..100644
--- 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 100755..100644
--- 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
index 4d043f5..4d043f5 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/bruce.png
+++ 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
index fd37443..fd37443 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/bruce_fanart.png
+++ 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 100755..100644
--- 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 100755..100644
--- 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 100755..100644
--- 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
index 6ecbd9e..6ecbd9e 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/cherie25_fanart.png
+++ 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
index a3f5127..a3f5127 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/cnews.png
+++ 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
index a759d39..a759d39 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/cnews_fanart.png
+++ 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
index 279348c..279348c 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/comedy.png
+++ 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
index f2a41c1..f2a41c1 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/comedy_fanart.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/comedy_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/cplus.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/cplus.png
index 6829f23..6829f23 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/cplus.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/cplus.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/fr/cplus_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/fr/cplus_fanart.png
index 2a2e3b4..2a2e3b4 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/cplus_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
index 6d8c2d2..6d8c2d2 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/crazy_kitchen.png
+++ 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
index 1e03344..1e03344 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/crazy_kitchen_fanart.png
+++ 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 100755..100644
--- 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 100755..100644
--- 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 100755..100644
--- 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
index 9a9db7c..9a9db7c 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/france24.png
+++ 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
index dadb2fb..dadb2fb 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/france24_fanart.png
+++ 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 100755..100644
--- 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 100755..100644
--- 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 100755..100644
--- 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 100755..100644
--- 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
index d83de13..d83de13 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/france4_fanart.png
+++ 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 100755..100644
--- 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
index 96ce7ae..96ce7ae 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/france5_fanart.png
+++ 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
index bdc12e4..bdc12e4 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/franceinfo.png
+++ 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
index edb1cb8..edb1cb8 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/franceinfo_fanart.png
+++ 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 100755..100644
--- 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
index e05df4c..e05df4c 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/franceo_fanart.png
+++ 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 100755..100644
--- 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 100755..100644
--- 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 100755..100644
--- 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 100755..100644
--- 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
index 3c3f68f..3c3f68f 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/home.png
+++ 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
index 1c22df9..1c22df9 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/home_fanart.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/home_fanart.png
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
index 29de8d2..29de8d2 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/la_1ere.png
+++ 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
index 1dcc660..1dcc660 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/la_1ere_fanart.png
+++ 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
index c979af1..c979af1 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/lci.png
+++ 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
index 565bdee..565bdee 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/lci_fanart.png
+++ 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
index d33817d..d33817d 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/lcp.png
+++ 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
index d697fdf..d697fdf 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/lcp_fanart.png
+++ 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 100755..100644
--- 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 100755..100644
--- 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 100755..100644
--- 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 100755..100644
--- 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 100755..100644
--- 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 100755..100644
--- 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 100755..100644
--- 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 100755..100644
--- 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 cd302c4..cd302c4 100755..100644
--- 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
index 35045dd..35045dd 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/numero23_fanart.png
+++ 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
index 83ad901..83ad901 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/parispremiere.png
+++ 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
index 823bd90..823bd90 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/parispremiere_fanart.png
+++ 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
index 8a756d9..8a756d9 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/publicsenat.png
+++ 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
index 38fc4bb..38fc4bb 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/publicsenat_fanart.png
+++ 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
index 21bbe7e..21bbe7e 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/rmc.png
+++ 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
index d471802..d471802 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/rmc_fanart.png
+++ 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
index 5908627..5908627 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/rmcdecouverte.png
+++ 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
index 716f06a..716f06a 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/stories.png
+++ 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
index 4083644..4083644 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/stories_fanart.png
+++ 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
index 84bb4b5..84bb4b5 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/styles.png
+++ 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
index 120a167..120a167 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/styles_fanart.png
+++ 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
index e376edf..e376edf 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/teva.png
+++ 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
index b45bff7..b45bff7 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/teva_fanart.png
+++ 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 100755..100644
--- 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 100755..100644
--- 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
index 1b69f8d..1b69f8d 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/tfou.png
+++ 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
index f47d92d..f47d92d 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/tfou_fanart.png
+++ 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 100755..100644
--- 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 100755..100644
--- 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 100755..100644
--- 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
index 0fe0102..0fe0102 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/w9_fanart.png
+++ 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
index dc311d1..dc311d1 100755..100644
--- a/plugin.video.catchuptvandmore/resources/media/channels/fr/xtra.png
+++ b/plugin.video.catchuptvandmore/resources/media/channels/fr/xtra.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/uk/blaze.png b/plugin.video.catchuptvandmore/resources/media/channels/uk/blaze.png
new file mode 100644
index 0000000..53f0a08
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/uk/blaze.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/uk/dave.png b/plugin.video.catchuptvandmore/resources/media/channels/uk/dave.png
new file mode 100644
index 0000000..6a150e4
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/uk/dave.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/uk/drama.png b/plugin.video.catchuptvandmore/resources/media/channels/uk/drama.png
new file mode 100644
index 0000000..d29241c
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/uk/drama.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/uk/drama_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/uk/drama_fanart.png
new file mode 100644
index 0000000..f42b2eb
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/uk/drama_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/uk/really.png b/plugin.video.catchuptvandmore/resources/media/channels/uk/really.png
new file mode 100644
index 0000000..92905e0
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/uk/really.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/uk/yesterday.png b/plugin.video.catchuptvandmore/resources/media/channels/uk/yesterday.png
new file mode 100644
index 0000000..941535d
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/uk/yesterday.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/ws/allocine.png b/plugin.video.catchuptvandmore/resources/media/channels/ws/allocine.png
new file mode 100644
index 0000000..77aa0dc
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/ws/allocine.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/ws/allocine_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/ws/allocine_fanart.png
new file mode 100644
index 0000000..222fec4
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/ws/allocine_fanart.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/ws/tetesaclaques.png b/plugin.video.catchuptvandmore/resources/media/channels/ws/tetesaclaques.png
new file mode 100644
index 0000000..0fdfa19
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/ws/tetesaclaques.png
Binary files differ
diff --git a/plugin.video.catchuptvandmore/resources/media/channels/ws/tetesaclaques_fanart.png b/plugin.video.catchuptvandmore/resources/media/channels/ws/tetesaclaques_fanart.png
new file mode 100644
index 0000000..f255005
--- /dev/null
+++ b/plugin.video.catchuptvandmore/resources/media/channels/ws/tetesaclaques_fanart.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 100755..100644
--- 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 100755..100644
--- 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 100755..100644
--- 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 100755..100644
--- 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 100755..100644
--- 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 5037cbb..0cd040f 100755..100644
--- a/plugin.video.catchuptvandmore/resources/settings.xml
+++ b/plugin.video.catchuptvandmore/resources/settings.xml
@@ -6,7 +6,10 @@
<!-- 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="30023" type="bool" id="main_menu.eu" default="true"/>
+ <setting label="30024" type="bool" id="main_menu.uk" default="true"/>
+ <setting label="30026" type="bool" id="main_menu.ws" default="true"/>
</category>
@@ -144,6 +147,12 @@
<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="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 Auvio (La Une, La deux, La Trois, ...)" type="bool" id="channels.be.rtbf.auvio" default="true" visible="eq(-1,true)"/>
+ <setting label="" type="number" visible="false" id="channels.be.rtbf.auvio.order" default="1"/>
+
<setting label="30023" type="lsep" subsetting="true" visible="eq(1,true)"/>
<setting label="30023" type="bool" id="main_menu.eu" default="true" visible="false"/>
@@ -153,8 +162,34 @@
<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>
+ <setting label="30024" type="lsep" subsetting="true" visible="eq(1,true)"/>
+ <setting label="30024" type="bool" id="main_menu.uk" default="true" visible="false"/>
+
+ <setting label="Blaze" type="bool" id="channels.uk.blaze.blaze" default="true" visible="eq(-1,true)"/>
+ <setting label="" type="number" visible="false" id="channels.uk.blaze.blaze.order" default="1"/>
+
+ <setting label="Dave" type="bool" id="channels.uk.uktvplay.dave" default="true" visible="eq(-3,true)"/>
+ <setting label="" type="number" visible="false" id="channels.uk.uktvplay.dave.order" default="2"/>
+
+ <setting label="Really" type="bool" id="channels.uk.uktvplay.really" default="true" visible="eq(-5,true)"/>
+ <setting label="" type="number" visible="false" id="channels.uk.uktvplay.really.order" default="3"/>
+
+ <setting label="Yesterday" type="bool" id="channels.uk.uktvplay.yesterday" default="true" visible="eq(-7,true)"/>
+ <setting label="" type="number" visible="false" id="channels.uk.uktvplay.yesterday.order" default="4"/>
+
+ <setting label="Drama" type="bool" id="channels.uk.uktvplay.drama" default="true" visible="eq(-9,true)"/>
+ <setting label="" type="number" visible="false" id="channels.uk.uktvplay.drama.order" default="5"/>
+
+ <setting label="30026" type="lsep" subsetting="true" visible="eq(1,true)"/>
+ <setting label="30026" type="bool" id="main_menu.ws" default="true" visible="false"/>
+ <setting label="Allociné" type="bool" id="channels.ws.allocine.allocine" default="true" visible="eq(-1,true)"/>
+ <setting label="" type="number" visible="false" id="channels.ws.allocine.allocine.order" default="1"/>
+
+ <setting label="Au pays des Têtes à claques" type="bool" id="channels.ws.tetesaclaques.tetesaclaques" default="true" visible="eq(-3,true)"/>
+ <setting label="" type="number" visible="false" id="channels.ws.tetesaclaques.tetesaclaques.order" default="2"/>
+
+ </category>
<!-- Quality and Content (and also hidden settings) -->
<category label="30002">
@@ -163,10 +198,11 @@
<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="30081" type="labelenum" id="channels.fr.france24.france24.language" visible="eq(-1,true)" values="FR|EN|AR|ES"/>
<setting label="30023" type="lsep" subsetting="true" visible="eq(1,true)"/>
<setting label="30023" type="bool" id="main_menu.eu" default="true" visible="false"/>
@@ -177,14 +213,12 @@
<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">
@@ -193,6 +227,13 @@
<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=""/>
+
+ <setting label="30024" type="lsep" subsetting="true" visible="eq(1,true)"/>
+ <setting label="30024" type="bool" id="main_menu.uk" default="true" visible="false"/>
+
+ <setting label="UKTVPlay Login" type="text" id="channels.uk.uktvplay.login" visible="eq(-1,true)" defaut=""/>
+ <setting label="UKTVPlay Password" type="text" id="channels.uk.uktvplay.password" option="hidden" visible="eq(-2,true)" defaut=""/>
+
</category>
</settings>
diff --git a/plugin.video.disclosetv/LICENSE b/plugin.video.disclosetv/LICENSE
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/plugin.video.disclosetv/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.disclosetv/README.md b/plugin.video.disclosetv/README.md
new file mode 100644
index 0000000..72372e7
--- /dev/null
+++ b/plugin.video.disclosetv/README.md
@@ -0,0 +1 @@
+# plugin.video.disclosetv \ No newline at end of file
diff --git a/plugin.video.disclosetv/addon.xml b/plugin.video.disclosetv/addon.xml
new file mode 100644
index 0000000..9d11590
--- /dev/null
+++ b/plugin.video.disclosetv/addon.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<addon id="plugin.video.disclosetv" version="1.0.0" name="Disclose.tv" 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">New voices, different perspectives, first-hand accounts, alternative breaking news.</summary>
+ <description lang="en_GB">Disclose.tv is a fast-growing open publishing online community of like-minded users, who submit, share and discuss contents and topics ignored, denied, censored, suppressed, marginalized or inadequately covered by the mainstream media, governmental institutions, and other information gatekeepers.</description>
+ <platform>all</platform>
+ <license>GNU GENERAL PUBLIC LICENSE. Version 3, June 2007</license>
+ <source>https://github.com/Lunatixz/KODI_Addons/tree/master/plugin.video.disclosetv</source>
+ <website>http://disclose.tv</website>
+ <news></news>
+ <forum>https://forum.kodi.tv/showthread.php?tid=325746</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.disclosetv/default.py b/plugin.video.disclosetv/default.py
new file mode 100644
index 0000000..053bbb6
--- /dev/null
+++ b/plugin.video.disclosetv/default.py
@@ -0,0 +1,23 @@
+# Copyright (C) 2017 Lunatixz
+#
+#
+# This file is part of disclosetv.
+#
+# disclosetv 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.
+#
+# disclosetv 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 disclosetv. If not, see <http://www.gnu.org/licenses/>.
+
+# -*- coding: utf-8 -*-
+
+#entrypoint
+if __name__ == '__main__':
+ from resources.lib import disclosetv \ No newline at end of file
diff --git a/plugin.video.disclosetv/resources/__init__.py b/plugin.video.disclosetv/resources/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.disclosetv/resources/__init__.py
diff --git a/plugin.video.disclosetv/resources/images/fanart.jpg b/plugin.video.disclosetv/resources/images/fanart.jpg
new file mode 100644
index 0000000..1747ad6
--- /dev/null
+++ b/plugin.video.disclosetv/resources/images/fanart.jpg
Binary files differ
diff --git a/plugin.video.disclosetv/resources/images/icon.png b/plugin.video.disclosetv/resources/images/icon.png
new file mode 100644
index 0000000..7ef2db3
--- /dev/null
+++ b/plugin.video.disclosetv/resources/images/icon.png
Binary files differ
diff --git a/plugin.video.disclosetv/resources/images/screenshot01.png b/plugin.video.disclosetv/resources/images/screenshot01.png
new file mode 100644
index 0000000..9e526f4
--- /dev/null
+++ b/plugin.video.disclosetv/resources/images/screenshot01.png
Binary files differ
diff --git a/plugin.video.disclosetv/resources/images/screenshot02.png b/plugin.video.disclosetv/resources/images/screenshot02.png
new file mode 100644
index 0000000..4ad6ab8
--- /dev/null
+++ b/plugin.video.disclosetv/resources/images/screenshot02.png
Binary files differ
diff --git a/plugin.video.disclosetv/resources/images/screenshot03.png b/plugin.video.disclosetv/resources/images/screenshot03.png
new file mode 100644
index 0000000..97deeb0
--- /dev/null
+++ b/plugin.video.disclosetv/resources/images/screenshot03.png
Binary files differ
diff --git a/plugin.video.disclosetv/resources/language/resource.language.en_gb/strings.po b/plugin.video.disclosetv/resources/language/resource.language.en_gb/strings.po
new file mode 100644
index 0000000..89eabc0
--- /dev/null
+++ b/plugin.video.disclosetv/resources/language/resource.language.en_gb/strings.po
@@ -0,0 +1,29 @@
+# Kodi Media Center language file
+# Addon Name: "Disclose.tv
+# Addon id: plugin.video.disclosetv
+# Addon Provider: Lunatixz
+msgid ""
+msgstr ""
+"Project-Id-Version: plugin.video.disclosetv\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.disclosetv/resources/lib/__init__.py b/plugin.video.disclosetv/resources/lib/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.disclosetv/resources/lib/__init__.py
diff --git a/plugin.video.disclosetv/resources/lib/disclosetv.py b/plugin.video.disclosetv/resources/lib/disclosetv.py
new file mode 100644
index 0000000..72e26b5
--- /dev/null
+++ b/plugin.video.disclosetv/resources/lib/disclosetv.py
@@ -0,0 +1,189 @@
+# Copyright (C) 2017 Lunatixz
+#
+#
+# This file is part of disclosetv.
+#
+# disclosetv 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.
+#
+# disclosetv 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 disclosetv. 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.disclosetv'
+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.disclose.tv/'
+BASE_VID = BASE_URL + 'videos'
+
+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 Disclose(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=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):
+ self.addDir('Browse', BASE_VID, 1)
+ self.addYoutube("Browse Youtube" , 'plugin://plugin.video.youtube/channel/UCA-Ls4dkRBXHMjRjeTDTdjg/')
+
+
+ def browse(self, url):
+ log('browse')
+ soup = BeautifulSoup(self.openURL(url), "html.parser")
+ videos = soup('div', {'class': 'teaser teaser--third'})
+ for video in videos:
+ try: thumb = 'http:%s'%(video('div', {'class': 'ratio-container ratio16_9'})[0].find('img').attrs['data-src'])
+ except: thumb = FANART
+ items = video('div', {'class': 'teaser__caption'})
+ vid_url = BASE_URL + (items[0]('a', {'class': 'article-link'})[0].attrs['href'])
+ label = items[0]('a', {'class': 'article-link'})[0].get_text()
+ timeago = items[0]('span', {'class': 'meta-timeago'})[0].get_text()
+ plot = '%s - %s'%(timeago, label)
+ try: genre = video('span', {'class': 'teaser-figure__cat'})[0].get_text()
+ except: genre = 'Unknown'
+ runtime = (video('span', {'class': 'teaser-figure__len'})[0].get_text()).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)
+ 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))
+ next = soup('li', {'class': 'more-container__button m-auto'})
+ if len(next) == 0: return
+ next_url = BASE_URL + next[0].find('a').attrs['href']
+ next_label = (next[0].find('a').attrs['title'] or next[0].get_text())
+ self.addDir(next_label, next_url, 1)
+
+
+ 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: Disclose().buildMenu()
+elif mode == 1: Disclose().browse(url)
+elif mode == 9: Disclose().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.disclosetv/resources/settings.xml b/plugin.video.disclosetv/resources/settings.xml
new file mode 100644
index 0000000..fbc5978
--- /dev/null
+++ b/plugin.video.disclosetv/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.iplayerwww/addon.xml b/plugin.video.iplayerwww/addon.xml
index 49292f4..8b4a6ff 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.19" provider-name="CaptainT, Cas, ihurst, primaeval">
+<addon id="plugin.video.iplayerwww" name="iPlayer WWW" version="3.0.20" 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,9 @@
<fanart>resources/fanart.jpg</fanart>
</assets>
<news>
+v3.0.20
+Fixed Most Popular and Highlights.
+
v3.0.19
Fixed Channel Highlights.
diff --git a/plugin.video.iplayerwww/resources/icon.png b/plugin.video.iplayerwww/resources/icon.png
index 7b111e8..5a87a0b 100644
--- a/plugin.video.iplayerwww/resources/icon.png
+++ b/plugin.video.iplayerwww/resources/icon.png
Binary files differ
diff --git a/plugin.video.iplayerwww/resources/lib/ipwww_video.py b/plugin.video.iplayerwww/resources/lib/ipwww_video.py
index 1a4d0fa..3f9fe77 100644
--- a/plugin.video.iplayerwww/resources/lib/ipwww_video.py
+++ b/plugin.video.iplayerwww/resources/lib/ipwww_video.py
@@ -1188,24 +1188,15 @@ def ListMainHighlights(highlights_url):
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))
+ 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))
+ subtitle_match = re.search(
+ r'primary">.*?item__description.+?>(.*?)</div>',
+ programme, flags=(re.DOTALL | re.MULTILINE))
if subtitle_match:
name = name + ' - ' + subtitle_match.group(1)
@@ -1235,6 +1226,9 @@ def ListMainHighlights(highlights_url):
if category_match:
group_data.append(('[B]%s: %s[/B]' % (translation(30314), name),
category_match.group(1), 125))
+ elif group_type == "popular":
+ group_data.append(('[B]%s: %s[/B]' % (translation(30314), name),
+ url, 105))
else:
group_data.append(('[B]%s: %s[/B]' % (translation(30314), name),
url, 128))
@@ -1254,7 +1248,85 @@ def ListMainHighlights(highlights_url):
def ListMostPopular():
"""Scrapes all episodes of the most popular page."""
- ScrapeEpisodes("http://www.bbc.co.uk/iplayer/group/most-popular")
+ html = OpenURL("http://www.bbc.co.uk/iplayer/group/most-popular")
+
+ # <li class="most-popular__item gel-layout__item gel-1/2 gel-1/3@m">
+ list_items = re.findall(r'<li class="most-popular.*?</li>', html, flags=(re.DOTALL | re.MULTILINE))
+
+ list_item_num = 1
+
+ for li in list_items:
+ # NOTE remove useless hrefs
+
+ # href="#gel-icon-iplayer"
+ li = re.compile(r'href="#.*?"',
+ flags=(re.DOTALL | re.MULTILINE)).sub('', li)
+
+ main_url = None
+ # <a class="content-item__link gel-layout gel-layout--flush"
+ # href="/iplayer/episode/b09k9n93/eastenders-21122017"
+ url_match = re.search(
+ r'href="(.*?)"',
+ li, flags=(re.DOTALL | re.MULTILINE))
+ if url_match:
+ url = url_match.group(1)
+ # Some strings already contain the full URL, need to work around this.
+ url = url.replace('http://www.bbc.co.uk','')
+ if url:
+ main_url = 'http://www.bbc.co.uk' + url
+
+ name = ''
+ title = ''
+ # <div class="content-item__title typo typo--skylark typo--bold">EastEnders</div>
+ title_match = re.search(
+ r'<div class="content-item__title.*?>\s*(.*?)\s*</div>',
+ li, flags=(re.DOTALL | re.MULTILINE))
+ if title_match:
+ title = title_match.group(1)
+ name = title
+
+ subtitle = None
+ # <div class="content-item__info__primary"><div class="content-item__description
+ # typo typo--bullfinch">21/21 Crowning the champion</div>
+ subtitle_match = re.search(
+ r'<div class="content-item__info__primary">.*?>\s*(.*?)\s*</div>',
+ li, flags=(re.DOTALL | re.MULTILINE))
+ if subtitle_match:
+ subtitle = subtitle_match.group(1)
+ if subtitle:
+ name = name + " - " + subtitle
+
+ icon = ''
+ # <source srcset="http://ichef.bbci.co.uk/images/ic/336x189/p04cd999.jpg"
+ icon_match = re.search(
+ r'https://ichef.bbci.co.uk/images/ic/.*?/(.*?)\.jpg',
+ li, flags=(re.DOTALL | re.MULTILINE))
+ if icon_match:
+ image = icon_match.group(1)
+ if image:
+ icon = "https://ichef.bbci.co.uk/images/ic/832x468/" + image + ".jpg"
+
+ type = None
+ synopsis = ''
+ # <div class="content-item__info__secondary"><div class="content-item__description typo
+ # typo--bullfinch">Linda gets more than she bargained for when looking for her Christmas
+ # present.</div>
+ synopsis_match = re.search(
+ r'<div class="content-item__info__secondary">.*?>\s*(.*?)\s*</div>',
+ li, flags=(re.DOTALL | re.MULTILINE))
+ if synopsis_match:
+ synopsis = synopsis_match.group(1)
+
+ aired = ''
+ episodes = None
+ more = None
+
+ CheckAutoplay(name , main_url, icon, synopsis, aired)
+
+ 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 AddAvailableStreamItem(name, url, iconimage, description):
diff --git a/plugin.video.kla.tv/addon.py b/plugin.video.kla.tv/addon.py
index d861008..5fa5dcb 100644
--- a/plugin.video.kla.tv/addon.py
+++ b/plugin.video.kla.tv/addon.py
@@ -20,12 +20,14 @@ 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']
+exp_lang_codes = ['de', 'en', 'fr', 'nl', 'it', 'pl']
payload_index = {
- "en": 2,
"de": 1,
- "pl": 6,
- "fr": 3
+ "en": 2,
+ "fr": 3,
+ "nl": 4,
+ "it": 5,
+ "pl": 6
}
if lang_setting == 0:
@@ -69,7 +71,7 @@ def INDEX(url):
"data":
{"type": "loadingNextVideos",
"offset": 0,
- "count": 48,
+ "count": 60,
"category": "",
"sendtyp": "",
"langid": str(payload_id)
@@ -102,7 +104,7 @@ def VIDEOLINKS(url, name):
link = link.replace(' ', ' ')
response.close()
- compiled_regex = re.compile('file: "(.+?)", label: "(.+?)"')
+ compiled_regex = re.compile('"src": "(.+?)", "label": "(.+?)"')
value_tuples = compiled_regex.findall(link)
for entry in value_tuples:
diff --git a/plugin.video.kla.tv/addon.xml b/plugin.video.kla.tv/addon.xml
index ab2a350..8f2f434 100644
--- a/plugin.video.kla.tv/addon.xml
+++ b/plugin.video.kla.tv/addon.xml
@@ -3,7 +3,7 @@
id="plugin.video.kla.tv"
name="Klagemauer TV"
provider-name="celadoor"
- version="0.0.5">
+ version="0.0.7">
<requires>
<import addon="xbmc.python" version="2.25.0" />
</requires>
@@ -15,19 +15,27 @@
<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>
+ <summary lang="nl_nl">www.kla.tv video plugin</summary>
+ <summary lang="it_it">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="en_gb">Klagemauer TV has been working as a volunteer for you since 2012! 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>
+ <description lang="nl_nl">Klagemauer TV daarentegen werkt sinds 2012 vrijwillig en kosteloos voor u! En dit in 90 studio's met meer dan 170 moderators, in 38 talen en een uitzendgebied van 212 landen. Help ons deze belangrijke stemmen over de hele wereld te laten horen. Al in de eerste 2 jaar produceerde Kla.TV meer dan 5.000 verhelderende programma's, 30 documentaire films en nog veel meer..</description>
+ <description lang="it_it">Klagemauer TV, d'altra parte, ha lavorato per te volontariamente e gratuitamente dal 2012! E questo in 90 studi con oltre 170 moderatori, in 38 lingue e un'area di trasmissione di 212 paesi. Aiutaci a rendere queste voci importanti ascoltate in tutto il mondo. Già nei primi 2 anni Kla.TV ha prodotto oltre 5.000 programmi di chiarimento, 30 film documentari e molto altro ancora.</description>
+<news>Version 0.0.7 - Updated/fixed due to site changes added nl and it audio languages.
+
+Version 0.0.5 -Initial Release. Klagemauer TV video plugin supports 4 audio languages de,en,pl,fr.
+
+Klagemauer TV has been working as a volunteer for you since 2012! 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.</news>
<platform>all</platform>
- <language>en de pl fr</language>
+ <language>en de pl fr nl it</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>
+ <source>http://celadoor.github.io/plugin.video.kla.tv.zip</source>
<assets>
<icon>resources/icon.png</icon>
<fanart>resources/fanart.jpg</fanart>
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
index e0e6ad3..6f444ed 100644
--- 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
@@ -35,5 +35,13 @@ msgid "fr"
msgstr "fr"
msgctxt "#30955"
+msgid "nl"
+msgstr "nl"
+
+msgctxt "#30956"
+msgid "it"
+msgstr "it"
+
+msgctxt "#30957"
msgid "pl"
-msgstr "pl" \ No newline at end of file
+msgstr "pl"
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
index 0c0a1b7..df71871 100644
--- 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
@@ -35,5 +35,13 @@ msgid "fr"
msgstr ""
msgctxt "#30955"
+msgid "nl"
+msgstr ""
+
+msgctxt "#30956"
+msgid "it"
+msgstr ""
+
+msgctxt "#30957"
msgid "pl"
-msgstr "" \ No newline at end of file
+msgstr ""
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
index 91fa92a..46a4893 100644
--- 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
@@ -35,5 +35,13 @@ msgid "fr"
msgstr "fr"
msgctxt "#30955"
+msgid "nl"
+msgstr "nl"
+
+msgctxt "#30956"
+msgid "it"
+msgstr "it"
+
+msgctxt "#30957"
msgid "pl"
-msgstr "pl" \ No newline at end of file
+msgstr "pl"
diff --git a/plugin.video.kla.tv/resources/language/resource.language.it_it/strings.po b/plugin.video.kla.tv/resources/language/resource.language.it_it/strings.po
new file mode 100644
index 0000000..e2878d5
--- /dev/null
+++ b/plugin.video.kla.tv/resources/language/resource.language.it_it/strings.po
@@ -0,0 +1,47 @@
+# 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 "Lingua del flusso originale"
+
+msgctxt "#30950"
+msgid "en"
+msgstr "it"
+
+msgctxt "#30951"
+msgid "Auto detect"
+msgstr "Trovato automaticamente"
+
+msgctxt "#30952"
+msgid "en"
+msgstr "en"
+
+msgctxt "#30953"
+msgid "de"
+msgstr "de"
+
+msgctxt "#30954"
+msgid "fr"
+msgstr "fr"
+
+msgctxt "#30955"
+msgid "nl"
+msgstr "nl"
+
+msgctxt "#30956"
+msgid "it"
+msgstr "it"
+
+msgctxt "#30957"
+msgid "pl"
+msgstr "pl"
diff --git a/plugin.video.kla.tv/resources/language/resource.language.nl_nl/strings.po b/plugin.video.kla.tv/resources/language/resource.language.nl_nl/strings.po
new file mode 100644
index 0000000..25ee3e3
--- /dev/null
+++ b/plugin.video.kla.tv/resources/language/resource.language.nl_nl/strings.po
@@ -0,0 +1,47 @@
+# 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 "De taal van de originele stream"
+
+msgctxt "#30950"
+msgid "en"
+msgstr "nl"
+
+msgctxt "#30951"
+msgid "Auto detect"
+msgstr "Automatische detectie"
+
+msgctxt "#30952"
+msgid "en"
+msgstr "en"
+
+msgctxt "#30953"
+msgid "de"
+msgstr "de"
+
+msgctxt "#30954"
+msgid "fr"
+msgstr "fr"
+
+msgctxt "#30955"
+msgid "nl"
+msgstr "nl"
+
+msgctxt "#30956"
+msgid "it"
+msgstr "it"
+
+msgctxt "#30957"
+msgid "pl"
+msgstr "pl"
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
index b8ddec8..c153005 100644
--- 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
@@ -35,5 +35,13 @@ msgid "fr"
msgstr "fr"
msgctxt "#30955"
+msgid "nl"
+msgstr "nl"
+
+msgctxt "#30956"
+msgid "it"
+msgstr "it"
+
+msgctxt "#30957"
msgid "pl"
-msgstr "pl" \ No newline at end of file
+msgstr "pl"
diff --git a/plugin.video.kla.tv/resources/settings.xml b/plugin.video.kla.tv/resources/settings.xml
index 4dcadf6..9d88943 100644
--- a/plugin.video.kla.tv/resources/settings.xml
+++ b/plugin.video.kla.tv/resources/settings.xml
@@ -1,6 +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"/>
+ <setting label="30001" type="select" lvalues="30951|30952|30953|30954|30955|30956|30957" id="LanguageID" default="30951"/>
</category>
-</settings> \ No newline at end of file
+</settings>
diff --git a/plugin.video.mediacorp/README.txt b/plugin.video.mediacorp/README.txt
index 4403aaf..de2b689 100644
--- a/plugin.video.mediacorp/README.txt
+++ b/plugin.video.mediacorp/README.txt
@@ -2,8 +2,9 @@ plugin.video.mediacorp
================
Kodi Addon for mediacorp
-For Kodi Isgengard and later releases
+For Kodi Krypton and later releases
+V3.0.7 fix minor website change
V3.0.6 website change; Krypton version uses inputstream.adaptive
V3.0.4 Added new formats
V3.0.1 Isengard version
diff --git a/plugin.video.mediacorp/addon.xml b/plugin.video.mediacorp/addon.xml
index 23d9419..8e35730 100644
--- a/plugin.video.mediacorp/addon.xml
+++ b/plugin.video.mediacorp/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.mediacorp"
name="Mediacorp Singapore"
- version="3.0.6"
+ version="3.0.7"
provider-name="t1m">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
diff --git a/plugin.video.mediacorp/changelog.txt b/plugin.video.mediacorp/changelog.txt
index 0681f0d..9870806 100644
--- a/plugin.video.mediacorp/changelog.txt
+++ b/plugin.video.mediacorp/changelog.txt
@@ -1,3 +1,4 @@
+V3.0.7 fix minor website change
V3.0.6 Fix website change; Krypton version requires inputstream.adaptive
V3.0.4 Added new formats
V3.0.1 Isengard version
diff --git a/plugin.video.mediacorp/resources/lib/scraper.py b/plugin.video.mediacorp/resources/lib/scraper.py
index 1e1fa6b..2dcefa4 100644
--- a/plugin.video.mediacorp/resources/lib/scraper.py
+++ b/plugin.video.mediacorp/resources/lib/scraper.py
@@ -82,7 +82,7 @@ class myAddon(t1mAddon):
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 = 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)
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.psvue/addon.xml b/plugin.video.psvue/addon.xml
index e467072..507335f 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.10.10" provider-name="eracknaphobia">
+<addon id="plugin.video.psvue" name="PS Vue" version="2017.11.21" provider-name="eracknaphobia">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
<import addon="script.module.requests" version="2.9.1"/>
@@ -13,7 +13,12 @@
<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>
-- Fix Login Errors
+- Thanks to snoopyjoe for the following updates / fixes!
+- Timeline section now available with episode availability detail
+- Fix add/remove show and channel ability
+- Watched live or on demand shows available in Recently Watched
+- VideoPlayer display info updated
+- LiveTV menu updated with live show info
</news>
<language>en</language>
<platform>all</platform>
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 a39fc08..e4cca51 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
@@ -138,7 +138,7 @@ msgid "Always Ask Profile"
msgstr ""
msgctxt "#30214"
-msgid "Timeline"
+msgid "Choose Date"
msgstr ""
msgctxt "#30215"
diff --git a/plugin.video.psvue/resources/language/resource.language.he_il/strings.po b/plugin.video.psvue/resources/language/resource.language.he_il/strings.po
new file mode 100644
index 0000000..87624d5
--- /dev/null
+++ b/plugin.video.psvue/resources/language/resource.language.he_il/strings.po
@@ -0,0 +1,181 @@
+# Kodi Media Center language file
+# Addon Name: PS Vue
+# Addon id: plugin.video.psvue
+# Addon Provider: eracknaphobia
+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-11-02 09:03+0200\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 "#30000"
+msgid "Account Info"
+msgstr "פרטי חשבון"
+
+msgctxt "#30001"
+msgid "Username"
+msgstr "שם משתמש"
+
+msgctxt "#30002"
+msgid "Password"
+msgstr "סיסמה"
+
+msgctxt "#30003"
+msgid "Logout"
+msgstr "ניתוק חשבון"
+
+msgctxt "#30004"
+msgid "Set Default Profile"
+msgstr "הגדר פרופיל ברירת מחדל"
+
+msgctxt "#30005"
+msgid "Reset Device ID"
+msgstr "איפוס מזהה התקן"
+
+msgctxt "#30006"
+msgid "Logout Succesful"
+msgstr "התנתקות בהצלחה"
+
+msgctxt "#30007"
+msgid "You have been successfully logged out."
+msgstr "אתה התנתקת בהצלחה."
+
+msgctxt "#30100"
+msgid "Timeline"
+msgstr "ציר זמן"
+
+msgctxt "#30101"
+msgid "My Shows"
+msgstr "הסדרות שלי"
+
+msgctxt "#30102"
+msgid "Favorite Channels"
+msgstr "ערוצים מועדפים"
+
+msgctxt "#30103"
+msgid "Live TV"
+msgstr "‎טלוויזיה"
+
+msgctxt "#30104"
+msgid "Sports"
+msgstr "ספורט"
+
+msgctxt "#30105"
+msgid "Kids"
+msgstr "ילדים"
+
+msgctxt "#30106"
+msgid "Recently Watched"
+msgstr "נצפה לאחרונה"
+
+msgctxt "#30107"
+msgid "Featured"
+msgstr "מוצגים"
+
+msgctxt "#30200"
+msgid "Login Failed"
+msgstr "הכניסה נכשלה"
+
+msgctxt "#30201"
+msgid "Something went wrong during login"
+msgstr "משהו השתבש בתהליך ההתחברות"
+
+msgctxt "#30202"
+msgid "Please enter your username"
+msgstr "נא להזין את שם המשתמש שלך"
+
+msgctxt "#30203"
+msgid "Please enter your password"
+msgstr "אנא הזן את הסיסמה שלך"
+
+msgctxt "#30204"
+msgid "Please enter your verification code"
+msgstr "אנא הזן את קוד האימות שלך"
+
+msgctxt "#30205"
+msgid "Profile Not Found"
+msgstr "הפרופיל לא נמצא"
+
+msgctxt "#30206"
+msgid "Your profile list could not be retrieved"
+msgstr "לא היתה אפשרות לאחזר את רשימת הפרופיל שלך"
+
+msgctxt "#30207"
+msgid "Authorization Failed"
+msgstr "האימות נכשל"
+
+msgctxt "#30208"
+msgid "Could not retrieve grant code"
+msgstr "לא הייתה אפשרות לאחזר את קוד grant"
+
+msgctxt "#30209"
+msgid "Could not retrieve the reqpayload"
+msgstr "לא היתה אפשרות לאחזר את reqpayload"
+
+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 280406b..d384473 100644
--- a/plugin.video.psvue/resources/lib/ps_vue.py
+++ b/plugin.video.psvue/resources/lib/ps_vue.py
@@ -21,7 +21,6 @@ def main_menu():
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'])
@@ -43,7 +42,7 @@ def favorite_channels():
def live_tv():
json_source = get_json(EPG_URL + '/browse/items/now_playing/filter/all/sort/channel/offset/0/size/500')
- list_channels(json_source['body']['items'])
+ list_shows(json_source['body']['items'])
def on_demand(channel_id):
json_source = get_json(EPG_URL + '/details/channel/'+channel_id+'/popular/offset/0/size/500')
@@ -79,27 +78,36 @@ def search():
def list_timeline():
- url = 'https://sentv-user-ext.totsuko.tv/sentv_user_ext/ws/v2/profile/ids'
- json_source = get_json(url)
- try:
- airing_id = json_source['body']['launch_program']['airing_id']
- except:
+ url = 'https://sentv-user-ext.totsuko.tv/sentv_user_ext/ws/v2/profile/'
+
+ json_source = get_json(url + PROF_ID)
+
+ if 'body' in json_source and 'watch_history' in json_source['body']:
+ watch_history = json_source['body']['watch_history']
+ air_dict = {}
+ air_list = []
+ for airing in watch_history:
+ xbmc.log(str(airing['airing_id']) + ' ' + str(airing['last_watch_date']))
+ air_dict[str(airing['last_watch_date'])] = str(airing['airing_id'])
+ air_list.append(str(airing['last_watch_date']))
+
+ else:
+ dialog.notification('No airing ID found', msg, xbmcgui.NOTIFICATION_INFO, 9000)
sys.exit()
- json_source = get_json(EPG_URL + '/timeline/' + str(airing_id))
+ json_source = get_json(EPG_URL + '/timeline/' + air_dict[air_list[0]])
for strand in json_source['body']['strands']:
if strand['id'] == 'now_playing':
addDir('[B][I][COLOR=FFFFFF66]Now Playing[/COLOR][/B][/I]', 998, ICON)
for program in strand['programs']:
- #list_channel(program)
list_episode(program)
elif strand['id'] == 'watched_episodes':
addDir('[B][I][COLOR=FFFFFF66]Watched Episodes[/COLOR][/B][/I]', 998, ICON)
for program in reversed(strand['programs']):
list_episode(program)
elif strand['id'] == 'coming_up':
- addDir('[B][I][COLOR=FFFFFF66]Coming Up[/COLOR][/B][/I]', 998, ICON)
+ addDir('[B][I][COLOR=FFFFFF66]Coming Up On Channel:[/COLOR][/B][/I]'+' '+strand['programs'][0]['channel']['name_short'], 998, ICON)
for program in strand['programs']:
list_episode(program)
@@ -120,9 +128,9 @@ def list_show(show):
title = show['title']
airing_id = 'null'
- if 'airing_id' in show: airing_id = str(show['airing_id'])
+ if 'airing_id' in show: airing_id = str(show['airings']['airing_id'])
channel_id = 'null'
- if 'channel_id' in show: channel_id = str(show['channel_id'])
+ if 'channel_id' in show: channel_id = str(show['airings']['channel_id'])
program_id = str(show['id'])
series_id = 'null'
if 'series_id' in show: series_id = str(show['series_id'])
@@ -181,14 +189,16 @@ def list_episode(show):
show_title = show['title']
title = show['display_episode_title']
airing_id = str(show['airings'][0]['airing_id'])
+ channel_name = str(show['channel']['name'])
- #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']
@@ -214,8 +224,20 @@ def list_episode(show):
plot = get_dict_item('synopsis', show)
if str(show['playable']).upper() == 'FALSE':
- # Add airing date/time to title
- title = title + ' ' + airing_date.strftime('%m/%d/%y') + ' ' + airing_date.strftime('%I:%M %p').lstrip('0')
+ # Add airing date/time to title for upcoming shows
+ title = title + ' ' + '[B][I][COLOR=FFFFFF66]Available On[/COLOR][/I][/B]' + ' ' + airing_date.strftime('%m/%d/%y') + ' @' + airing_date.strftime('%I:%M %p').lstrip('0')
+
+ # Sort Live shows and episodes no longer available to watch
+ if str(show['airings'][0]['badge']) == 'live':
+ title = title + ' ' + '[B][I][COLOR=FFFFFF66]Live Episode[/COLOR][/I][/B]'
+ channel_name = channel_name + ' ' + '[B][I][COLOR=FFFFFF66]Live[/COLOR][/I][/B]'
+
+ elif str(show['airings'][0]['badge']) == 'no_longer_available':
+ title = title + ' ' + '[B][I][COLOR=FFde0000]Episode Not Available[/COLOR][/I][/B]'
+
+ else:
+ channel_name = show['title'] + ' ' + '[B][I][COLOR=FFFFFF66]On Demand[/COLOR][/I][/B]'
+ show_title = show['display_episode_title']
# Add resumetime if applicable
resumetime=''
@@ -233,7 +255,7 @@ def list_episode(show):
info = {
'plot': plot,
'tvshowtitle': show_title,
- 'title': title,
+ 'title': channel_name,
'originaltitle': title,
'mediatype': 'episode',
'genre': genre,
@@ -273,6 +295,24 @@ def list_channel(channel):
if image['width'] == 600 or image['width'] == 440: icon = image['src']
if image['width'] == 1920: fanart = image['src']
if icon != ICON and fanart != FANART: break
+
+ airing_id = ''
+ if 'id' in channel and 'airings' in channel['sub_item']:
+ AID = channel['sub_item']['airings']
+ air_dict = {}
+ air_list = []
+ for airing in AID:
+ xbmc.log(str(airing['airing_id']) + ' ' + str(airing['type']))
+ air_dict[str(airing['type'])] = str(airing['airing_id'])
+ air_list.append(str(airing['type']))
+ airing_id = air_dict[air_list[0]]
+
+ program_id = ''
+ if 'id' in channel['sub_item']: program_id = str(channel['sub_item']['id'])
+ series_id = ''
+ if 'series_id' in channel['sub_item']: series_id = str(channel['sub_item']['series_id'])
+ tms_id = str(channel['sub_item']['tms_id'])
+ tvshowtitle = str(channel['sub_item']['title'])
if 'channel' in channel:
title = channel['channel']['name']
@@ -281,15 +321,14 @@ def list_channel(channel):
title = channel['title']
channel_id = str(channel['id'])
-
genre = ''
for item in channel['genres']:
if genre != '': genre += ', '
genre += item['genre']
- plot = get_dict_item('synopsis', channel)
- season = get_dict_item('season_num', channel)
- episode = get_dict_item('episode_num', channel)
+ plot = get_dict_item('synopsis', channel['sub_item'])
+ season = get_dict_item('season_num', channel['sub_item'])
+ episode = get_dict_item('episode_num', channel['sub_item'])
channel_url = CHANNEL_URL + '/' + channel_id
@@ -297,8 +336,8 @@ def list_channel(channel):
'season':season,
'episode':episode,
'plot': plot,
- 'tvshowtitle': title,
- 'title': title,
+ 'tvshowtitle': tvshowtitle, #Does not display for some reason(normally would be blue dialog on VideoPlayer
+ 'title': title + ' ' + '[B][I][COLOR=FFFFFF66]Live[/COLOR][/I][/B]',
'originaltitle': title,
'genre': genre
}
@@ -308,7 +347,11 @@ def list_channel(channel):
}
show_info = {
- 'channel_id': channel_id
+ 'airing_id': airing_id,
+ 'channel_id': channel_id,
+ 'program_id': program_id,
+ 'series_id': series_id,
+ 'tms_id': tms_id
}
if 'channel_type' in channel:
@@ -328,16 +371,17 @@ def get_dict_item(key, dictionary):
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_TV,
- "Connection": "Keep-Alive",
- 'reqPayload': ADDON.getSetting(id='reqPayload'),
- "X-Requested-With": "com.snei.vue.atv"
+ 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': 'gzip, deflate, br',
+ 'User-Agent': UA_ANDROID_TV,
+ 'Connection': 'Keep-Alive',
+ 'Host': 'media-framework.totsuko.tv',
+ 'reqPayload': ADDON.getSetting(id='EPGreqPayload'),
+ 'X-Requested-With': 'com.snei.vue.android'
}
r = requests.get(url, headers=headers, cookies=load_cookies(), verify=VERIFY)
@@ -345,7 +389,7 @@ def get_stream(url, airing_id, channel_id, program_id, series_id, tms_id):
stream_url = json_source['body']['video']
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') + '"')
+ headers += '&Cookie=reqPayload=' + urllib.quote('"' + ADDON.getSetting(id='EPGreqPayload') + '"')
listitem = xbmcgui.ListItem()
listitem.setMimeType("application/x-mpegURL")
@@ -354,19 +398,17 @@ def get_stream(url, airing_id, channel_id, program_id, series_id, tms_id):
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)
-
xbmcplugin.setResolvedUrl(addon_handle, True, listitem)
-
# Seek to time
#Give the stream sometime to start before checking
- '''
+
monitor = xbmc.Monitor()
monitor.waitForAbort(10)
xbmc.log("Is playing video? " + str(xbmc.Player().isPlayingVideo()))
@@ -377,17 +419,16 @@ def get_stream(url, airing_id, channel_id, program_id, series_id, tms_id):
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'),
+ 'reqPayload': ADDON.getSetting(id='EPGreqPayload'),
'User-Agent': UA_ANDROID_TV,
- 'Accept-Encoding': 'gzip, deflate',
- 'Accept-Language': 'en-US',
- 'X-Requested-With': 'com.snei.vue.android'
+ 'Accept-Encoding': 'gzip, deflate, br',
+ 'Accept-Language': 'en-US,en;q=0.5',
+ 'X-Requested-With': 'com.snei.vue.android',
+ 'Connection': 'keep-alive'
}
r = requests.get(url, headers=headers, cookies=load_cookies(), verify=VERIFY)
@@ -400,7 +441,7 @@ def get_json(url):
msg = json_source['header']['error']['message']
except:
pass
- dialog.notification('Error '+str(r.status_code), msg, xbmcgui.NOTIFICATION_INFO, 5000)
+ dialog.notification('Error '+str(r.status_code), msg, xbmcgui.NOTIFICATION_INFO, 9000)
sys.exit()
return r.json()
@@ -558,4 +599,5 @@ UA_ANDROID = 'Mozilla/5.0 (Linux; Android 6.0.1; Build/MOB31H; wv) AppleWebKit/5
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'
+PROF_ID = ADDON.getSetting(id='default_profile')
VERIFY = True
diff --git a/plugin.video.psvue/resources/lib/sony.py b/plugin.video.psvue/resources/lib/sony.py
index 3088aed..845e0ba 100644
--- a/plugin.video.psvue/resources/lib/sony.py
+++ b/plugin.video.psvue/resources/lib/sony.py
@@ -152,6 +152,7 @@ class SONY():
r = requests.delete(url, headers=headers, cookies=self.load_cookies(), verify=self.verify)
self.save_cookies(r.cookies)
# Clear addon settings
+ self.addon.setSetting(id='EPGreqPayload', value='')
self.addon.setSetting(id='reqPayload', value='')
self.addon.setSetting(id='last_auth', value='')
self.addon.setSetting(id='npsso', value='')
@@ -210,12 +211,21 @@ class SONY():
'Accept-Encoding': 'gzip',
"X-Requested-With": "com.snei.vue.atv"
}
+ r = requests.get(url, headers=headers, verify=self.verify)
+ device_status = str(r.json()['body']['status'])
+
if self.addon.getSetting(id='reqPayload') != '':
headers['reauth'] = '1'
headers['reqPayload'] = self.addon.getSetting(id='reqPayload')
- r = requests.get(url, headers=headers, verify=self.verify)
- if 'reqPayload' in r.headers:
+ if device_status == "UNAUTHORIZED":
+ auth_error = str(r.json()['header']['error']['message'])
+ error_code = str(r.json()['header']['error']['code'])
+ self.notification_msg("Error Code: "+error_code, auth_error)
+ sys.exit()
+
+
+ elif 'reqPayload' in r.headers:
req_payload = str(r.headers['reqPayload'])
self.addon.setSetting(id='reqPayload', value=req_payload)
auth_time = r.json()['header']['time_stamp']
@@ -272,8 +282,8 @@ class SONY():
}
r = requests.get(url, headers=headers, verify=self.verify)
- req_payload = str(r.headers['reqPayload'])
- self.addon.setSetting(id='reqPayload', value=req_payload)
+ EPGreqPayload = str(r.headers['reqPayload'])
+ self.addon.setSetting(id='EPGreqPayload', value=EPGreqPayload)
auth_time = r.json()['header']['time_stamp']
self.addon.setSetting(id='last_auth', value=auth_time)
self.addon.setSetting(id='default_profile', value=profile_id)
@@ -289,7 +299,7 @@ class SONY():
"Accept-Encoding": "gzip, deflate, br",
"User-Agent": self.ua_android_tv,
"Connection": "Keep-Alive",
- "reqPayload": self.addon.getSetting(id='reqPayload'),
+ "reqPayload": self.addon.getSetting(id='EPGreqPayload'),
"X-Requested-With": "com.snei.vue.atv"
}
@@ -318,7 +328,7 @@ class SONY():
"Accept-Encoding": "gzip, deflate, br",
"User-Agent": self.ua_android_tv,
"Connection": "Keep-Alive",
- "reqPayload": self.addon.getSetting(id='reqPayload'),
+ "reqPayload": self.addon.getSetting(id='EPGreqPayload'),
"X-Requested-With": "com.snei.vue.atv"
}
@@ -343,15 +353,16 @@ class SONY():
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/destro/4-4-5a/",
- "Accept-Encoding": "gzip, deflate",
- "User-Agent": self.ua_android_tv,
- "Connection": "Keep-Alive",
- 'reqPayload': self.addon.getSetting(id='reqPayload'),
+ headers = {'Accept': '*/*',
+ 'Content-type': 'application/json',
+ 'Origin': 'https://vue.playstation.com',
+ 'Accept-Language': 'en-US,en;q-0.5',
+ 'Referer': 'https://vue.playstation.com/watch/my-vue',
+ 'Accept-Encoding': 'gzip, deflate, br',
+ 'User-Agent': self.ua_android_tv,
+ 'Connection': 'Keep-Alive',
+ 'Host': 'sentv-user-action.totsuko.tv',
+ 'reqPayload': self.addon.getSetting(id='EPGreqPayload'),
'X-Requested-With': 'com.snei.vue.android'
}
@@ -360,13 +371,13 @@ class SONY():
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 += '"last_watch_date":"2017-11-13T06:54:419Z",'
+ payload += '"last_timecode":"00:00:00",'
payload += '"start_timecode":"00:00:00:00",'
payload += '"fully_watched":false,'
- payload += '"stream_type":"dvr"}'
+ payload += '"stream_type":"null"}'
- #xbmc.log(payload)
+ #xbmc.log("The Payload is: " + payload)
r = requests.put(url, headers=headers, data=payload, verify=self.verify)
@@ -401,4 +412,4 @@ class SONY():
def notification_msg(self, title, msg):
dialog = xbmcgui.Dialog()
- dialog.notification(title, msg, xbmcgui.NOTIFICATION_INFO, 5000)
+ dialog.notification(title, msg, xbmcgui.NOTIFICATION_INFO, 9000)
diff --git a/plugin.video.rtpplay/LICENSE b/plugin.video.rtpplay/LICENSE
new file mode 100644
index 0000000..7c731c0
--- /dev/null
+++ b/plugin.video.rtpplay/LICENSE
@@ -0,0 +1,692 @@
+Copyright (c) 2017 enen92 <enen92@kodi.tv> (http://rtp.pt/play)
+
+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.rtpplay/README.md b/plugin.video.rtpplay/README.md
new file mode 100644
index 0000000..8df9702
--- /dev/null
+++ b/plugin.video.rtpplay/README.md
@@ -0,0 +1,5 @@
+# RTP Play Kodi video addon
+
+Work in progress. Expect it to break.
+
+Disclaimer: This plugin is not official and is not endorsed by RTP \ No newline at end of file
diff --git a/plugin.video.rtpplay/addon.xml b/plugin.video.rtpplay/addon.xml
new file mode 100644
index 0000000..58deead
--- /dev/null
+++ b/plugin.video.rtpplay/addon.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<addon id="plugin.video.rtpplay" name="RTP Play" version="3.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">Play live emissions from RTP Play</summary>
+ <description lang="en_GB">Play live emissions from the RTP Play website</description>
+ <language>pt</language>
+ <platform>all</platform>
+ <license>GPL-3.0</license>
+ <forum>https://forum.kodi.tv/showthread.php?tid=154645</forum>
+ <website>http://rtp.pt/play</website>
+ <email>enen92@kodi.tv</email>
+ <source>https://github.com/enen92/plugin.video.rtpplay</source>
+ <news>Plugin updated with only live streams</news>
+ <disclaimer>The plugin is unnoficial and not endorsed by RTP. Expect it to break. </disclaimer>
+ <assets>
+ <icon>icon.png</icon>
+ <fanart>fanart.jpg</fanart>
+ </assets>
+ </extension>
+</addon>
diff --git a/plugin.video.rtpplay/changelog.txt b/plugin.video.rtpplay/changelog.txt
new file mode 100644
index 0000000..5ad8ae4
--- /dev/null
+++ b/plugin.video.rtpplay/changelog.txt
@@ -0,0 +1,77 @@
+Version 3.0.0 (23/12/2017)
+-Moved to krypton
+-Keep only livestreams for now
+-Simplify code to make it easy to issue updates
+
+Version 2.6.1 (13/12/2017)
+-Fix stream resolver
+
+Version 2.6.0 (10/2/2017)
+-Fix streams
+
+Version 2.5.9 (24/1/2017)
+-Fix ondemand
+
+Version 2.5.8 (19/1/2017)
+-Fix live
+
+Version 2.5.7 (11/1/2017)
+-Fix live
+
+Version 2.5.6 (12/7/2016)
+-Fix Regex
+
+Version 2.5.5 (26/6/2016)
+-New icon
+-New Menus
+-Dropped rtmp based streams
+-Fixed on-demand resolvers
+-Fix Live channels
+-Fix artwork
+-New translation system
+-Other improvements
+
+Version 2.5.4
+-Fix live channels
+
+Version 2.5.3 (18/12/2015)
+-Fixed live channels
+
+Version 2.5.1 (21/11/2015)
+-Global update (tks sheik)
+
+Version 2.5.0 (14/08/2015)
+-Fix live
+
+Version 2.4.0 (30/07/2015)
+-Fix Live
+-Fix next directory
+
+Version 2.3.0 (22/03/2015)
+-Fix rtmp streams (swfVfy parameter)
+
+Version 2.2.0 (9/12/2014)
+-Fix script error on live channels listing
+
+Version 2.1.0 (3/12/2014)
+-Fixes due to changes on the website/api
+-Added 'now playing' for live channels
+-Minor fix for kodi
+-Removed XBMC words
+-Aeon nox specific window id's
+
+Version 2.0.0 (11/08/2014)
+-Addon re-coded
+-Added archive section
+-Added view system
+-Removed GA crap
+-Added plot/icon for show/episode
+-Proper episode video part grabbing
+-Quicker navigation
+-Settings and translation strings (for general content)
+
+Version 1.2.0
+* Bump gotham
+
+Version 1.0.1
+* First addon release \ No newline at end of file
diff --git a/plugin.video.rtpplay/fanart.jpg b/plugin.video.rtpplay/fanart.jpg
new file mode 100644
index 0000000..75338be
--- /dev/null
+++ b/plugin.video.rtpplay/fanart.jpg
Binary files differ
diff --git a/plugin.video.rtpplay/icon.png b/plugin.video.rtpplay/icon.png
new file mode 100644
index 0000000..e43b3bf
--- /dev/null
+++ b/plugin.video.rtpplay/icon.png
Binary files differ
diff --git a/plugin.video.rtpplay/main.py b/plugin.video.rtpplay/main.py
new file mode 100644
index 0000000..2630ed9
--- /dev/null
+++ b/plugin.video.rtpplay/main.py
@@ -0,0 +1,16 @@
+# -*- coding: utf-8 -*-
+
+from resources.lib import kodilogging
+from resources.lib import plugin
+
+import logging
+import xbmcaddon
+
+# Keep this file to a minimum, as Kodi
+# doesn't keep a compiled copy of this
+ADDON = xbmcaddon.Addon()
+kodilogging.config()
+
+plugin.run()
+
+
diff --git a/plugin.video.rtpplay/resources/__init__.py b/plugin.video.rtpplay/resources/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.rtpplay/resources/__init__.py
diff --git a/plugin.video.rtpplay/resources/language/resource.language.en_gb/strings.po b/plugin.video.rtpplay/resources/language/resource.language.en_gb/strings.po
new file mode 100644
index 0000000..b35a0ec
--- /dev/null
+++ b/plugin.video.rtpplay/resources/language/resource.language.en_gb/strings.po
@@ -0,0 +1,29 @@
+# Kodi Media Center language file
+# Addon Name: RTP Play
+# Addon id: plugin.video.rtpplay
+# 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 "RTP Play"
+msgstr ""
+
+msgctxt "#32001"
+msgid "Could not complete request. The plugin needs an update."
+msgstr ""
+
+msgctxt "#32002"
+msgid "Could not grab stream url. The plugin needs an update."
+msgstr "" \ No newline at end of file
diff --git a/plugin.video.rtpplay/resources/lib/__init__.py b/plugin.video.rtpplay/resources/lib/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugin.video.rtpplay/resources/lib/__init__.py
diff --git a/plugin.video.rtpplay/resources/lib/kodilogging.py b/plugin.video.rtpplay/resources/lib/kodilogging.py
new file mode 100644
index 0000000..5f42ab7
--- /dev/null
+++ b/plugin.video.rtpplay/resources/lib/kodilogging.py
@@ -0,0 +1,43 @@
+# -*- coding: utf-8 -*-
+
+from __future__ import unicode_literals
+from resources.lib.kodiutils import get_setting_as_bool
+
+import logging
+import xbmc
+import xbmcaddon
+
+
+class KodiLogHandler(logging.StreamHandler):
+
+ def __init__(self):
+ logging.StreamHandler.__init__(self)
+ addon_id = xbmcaddon.Addon().getAddonInfo('id')
+ prefix = b"[%s] " % addon_id
+ formatter = logging.Formatter(prefix + b'%(name)s: %(message)s')
+ self.setFormatter(formatter)
+
+ def emit(self, record):
+ levels = {
+ logging.CRITICAL: xbmc.LOGFATAL,
+ logging.ERROR: xbmc.LOGERROR,
+ logging.WARNING: xbmc.LOGWARNING,
+ logging.INFO: xbmc.LOGINFO,
+ logging.DEBUG: xbmc.LOGDEBUG,
+ logging.NOTSET: xbmc.LOGNONE,
+ }
+ if get_setting_as_bool('debug'):
+ try:
+ xbmc.log(self.format(record), levels[record.levelno])
+ except UnicodeEncodeError:
+ xbmc.log(self.format(record).encode(
+ 'utf-8', 'ignore'), levels[record.levelno])
+
+ def flush(self):
+ pass
+
+
+def config():
+ logger = logging.getLogger()
+ logger.addHandler(KodiLogHandler())
+ logger.setLevel(logging.DEBUG)
diff --git a/plugin.video.rtpplay/resources/lib/kodiutils.py b/plugin.video.rtpplay/resources/lib/kodiutils.py
new file mode 100644
index 0000000..6ab49d1
--- /dev/null
+++ b/plugin.video.rtpplay/resources/lib/kodiutils.py
@@ -0,0 +1,83 @@
+# -*- coding: utf-8 -*-
+
+import xbmc
+import xbmcaddon
+import xbmcgui
+import sys
+import os
+import logging
+import json as json
+
+
+# read settings
+ADDON = xbmcaddon.Addon()
+ICON = xbmc.translatePath(ADDON.getAddonInfo("icon"))
+FANART = xbmc.translatePath(ADDON.getAddonInfo("fanart"))
+
+logger = logging.getLogger(__name__)
+
+def smart_str(x):
+ if isinstance(x, unicode):
+ return unicode(x).encode("utf-8")
+ elif isinstance(x, int) or isinstance(x, float):
+ return str(x)
+ return x
+
+def ok(heading, line1, line2="", line3=""):
+ xbmcgui.Dialog().ok(heading, line1, line2, line3)
+
+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 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:
+ logger.warn("[%s] %s" %
+ (params['method'], response['error']['message']))
+ return None
diff --git a/plugin.video.rtpplay/resources/lib/plugin.py b/plugin.video.rtpplay/resources/lib/plugin.py
new file mode 100644
index 0000000..9ba05fe
--- /dev/null
+++ b/plugin.video.rtpplay/resources/lib/plugin.py
@@ -0,0 +1,97 @@
+# -*- coding: utf-8 -*-
+
+import routing
+import logging
+import requests
+import re
+import xbmcaddon
+from sys import exit, version_info
+from resources.lib import kodiutils
+from resources.lib import kodilogging
+from xbmcgui import ListItem
+from xbmcplugin import addDirectoryItem, endOfDirectory, setResolvedUrl
+
+
+ADDON = xbmcaddon.Addon()
+logger = logging.getLogger(ADDON.getAddonInfo('id'))
+kodilogging.config()
+plugin = routing.Plugin()
+
+__headers__ = {"User-Agent": "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"}
+__base_url__ = "http://www.rtp.pt"
+__session__ = requests.Session()
+
+if version_info >= (3, 0):
+ from html.parser import HTMLParser
+else:
+ from HTMLParser import HTMLParser
+html_parser = HTMLParser()
+
+
+@plugin.route('/')
+def index():
+ try:
+ req = __session__.get("http://www.rtp.pt/play/", headers=__headers__).text
+ except:
+ kodiutils.ok(kodiutils.get_string(32000),kodiutils.get_string(32001))
+ exit(0)
+
+ match=re.compile('<a title=".+?direto (.+?)" href="(.+?)" class="mask-live "><img alt=".+?" src="(.+?)" class="img-responsive">.+?<span class="small"><b>(.+?)</b>').findall(req)
+ if match:
+ for channel,rel_url, img, prog in match:
+ liz = ListItem("[B][COLOR blue]{}[/B][/COLOR] ({})".format(kodiutils.smart_str(channel), kodiutils.smart_str(prog)))
+ if img.startswith("/"):
+ img = "http:{}".format(img)
+
+ liz.setArt({"thumb": img, "icon": img, "fanart": kodiutils.FANART})
+ liz.setProperty('IsPlayable', 'true')
+ liz.setInfo("Video", infoLabels={"plot": html_parser.unescape(kodiutils.smart_str(prog))})
+
+ addDirectoryItem(plugin.handle, plugin.url_for(play, rel_url=kodiutils.smart_str(rel_url), channel=kodiutils.smart_str(channel), img=kodiutils.smart_str(img), prog=kodiutils.smart_str(prog) ), liz, False)
+
+ endOfDirectory(plugin.handle)
+
+
+@plugin.route('/play')
+def play():
+ rel_url = plugin.args["rel_url"][0]
+ channel = plugin.args["channel"][0]
+ prog = plugin.args["prog"][0]
+ icon = plugin.args["img"][0]
+ try:
+ req = __session__.get("{}{}".format(__base_url__, rel_url)).text
+ except:
+ kodiutils.ok(kodiutils.get_string(32000),kodiutils.get_string(32002))
+ exit(0)
+
+ is_pseudo_aes = bool(re.findall("var aes = true", req))
+
+ streams = re.compile('new RTPPlayer\(.*file\:.+?"(.+?)"', re.DOTALL).findall(req)
+
+ if streams:
+ final_stream_url = None
+ for stream in streams:
+ if ".m3u8" in stream.split('/')[-1]:
+ final_stream_url = stream
+ break
+
+ if is_pseudo_aes:
+ try:
+ req = __session__.post("http://www.rtp.pt/services/playRequest.php", headers={"RTPPlayUrl": final_stream_url})
+ final_stream_url = req.headers["RTPPlayWW"]
+ except:
+ kodiutils.ok(kodiutils.get_string(32000),kodiutils.get_string(32002))
+ exit(0)
+
+ if final_stream_url:
+ liz = ListItem("[B][COLOR blue]{}[/B][/COLOR] ({})".format(kodiutils.smart_str(channel), kodiutils.smart_str(prog)))
+ liz.setArt({"thumb": icon, "icon": icon})
+ liz.setProperty('IsPlayable', 'true')
+ liz.setPath("{}|User-Agent=Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36&Referer=http://www.rtp.pt/play/".format(final_stream_url))
+ setResolvedUrl(plugin.handle, True, liz)
+ else:
+ kodiutils.ok(kodiutils.get_string(32000),kodiutils.get_string(32002))
+ exit(0)
+
+def run():
+ plugin.run()
diff --git a/plugin.video.rtpplay/resources/settings.xml b/plugin.video.rtpplay/resources/settings.xml
new file mode 100644
index 0000000..96f7359
--- /dev/null
+++ b/plugin.video.rtpplay/resources/settings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<settings>
+ <setting id="debug" type="bool" label="32001" default="false"/>
+</settings>
+
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.thinktv/LICENSE.txt b/plugin.video.thinktv/LICENSE.txt
new file mode 100644
index 0000000..4f8e8eb
--- /dev/null
+++ b/plugin.video.thinktv/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.thinktv/README.txt b/plugin.video.thinktv/README.txt
new file mode 100644
index 0000000..b12c853
--- /dev/null
+++ b/plugin.video.thinktv/README.txt
@@ -0,0 +1,17 @@
+plugin.video.thinktv
+================
+
+Kodi Video Addon for PBS ThinkTV
+For Kodi Isengard and above releases
+
+version 3.0.11 website change, use inputstream.adaptive to speed stream selection, needs Krypton or above
+version 3.0.10 quick fix for website change
+version 3.0.9 fix for website change, add episode search
+version 3.0.8 fix for website change
+version 3.0.7 fix for episode, clip and preview counts
+version 3.0.6 fix for API bug when station is empty
+Version 3.0.5 fix for Passport / user id
+Version 3.0.4 fix for 1080, ecnt bug
+Version 3.0.3 cleanup
+Version 3.0.1 separate scraper for future functions
+
diff --git a/plugin.video.thinktv/addon.xml b/plugin.video.thinktv/addon.xml
new file mode 100644
index 0000000..bd73f5d
--- /dev/null
+++ b/plugin.video.thinktv/addon.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<addon id="plugin.video.thinktv"
+ name="PBS ThinkTV"
+ version="3.0.11"
+ 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">PBS ThinkTV</summary>
+ <description lang="en_GB">PBS ThinkTV</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.kodi.tv/showthread.php?tid=216810</forum>
+ <website>video.thinktv.org</website>
+ <email></email>
+ <source>https://github.com/learningit/repo-plugins</source>
+ </extension>
+</addon>
diff --git a/plugin.video.thinktv/changelog.txt b/plugin.video.thinktv/changelog.txt
new file mode 100644
index 0000000..ce9e3fe
--- /dev/null
+++ b/plugin.video.thinktv/changelog.txt
@@ -0,0 +1,10 @@
+version 3.0.11 website change, use inputstream.adaptive to speed stream selection, needs Krypton or above
+version 3.0.10 quick fix for website change
+version 3.0.9 fix for website change, add episode search
+version 3.0.8 fix for website change
+version 3.0.7 fix for episode, clip and preview counts
+version 3.0.6 fix for API bug when station is empty
+Version 3.0.5 fix for Passport / user id
+Version 3.0.4 fix for 1080, ecnt bug
+Version 3.0.3 cleanup
+Version 3.0.1 Separate scraper for future functions \ No newline at end of file
diff --git a/plugin.video.thinktv/default.py b/plugin.video.thinktv/default.py
new file mode 100644
index 0000000..414fdef
--- /dev/null
+++ b/plugin.video.thinktv/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.thinktv/fanart.jpg b/plugin.video.thinktv/fanart.jpg
new file mode 100644
index 0000000..610b9a2
--- /dev/null
+++ b/plugin.video.thinktv/fanart.jpg
Binary files differ
diff --git a/plugin.video.thinktv/icon.png b/plugin.video.thinktv/icon.png
new file mode 100644
index 0000000..fa8cc7a
--- /dev/null
+++ b/plugin.video.thinktv/icon.png
Binary files differ
diff --git a/plugin.video.thinktv/resources/__init__.py b/plugin.video.thinktv/resources/__init__.py
new file mode 100644
index 0000000..7986681
--- /dev/null
+++ b/plugin.video.thinktv/resources/__init__.py
@@ -0,0 +1 @@
+__author__ = 't1m'
diff --git a/plugin.video.thinktv/resources/language/resource.language.en_gb/strings.po b/plugin.video.thinktv/resources/language/resource.language.en_gb/strings.po
new file mode 100644
index 0000000..fd1964c
--- /dev/null
+++ b/plugin.video.thinktv/resources/language/resource.language.en_gb/strings.po
@@ -0,0 +1,134 @@
+# 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 "Video Resolution"
+msgstr ""
+
+msgctxt "#30001"
+msgid "SD"
+msgstr ""
+
+msgctxt "#30002"
+msgid "HD"
+msgstr ""
+
+msgctxt "#30003"
+msgid "1080"
+msgstr ""
+
+msgctxt "#30004"
+msgid "PBS Favorites"
+msgstr ""
+
+msgctxt "#30005"
+msgid "PBS Watchlist"
+msgstr ""
+
+msgctxt "#30006"
+msgid "Remove from PBS Favorites"
+msgstr ""
+
+msgctxt "#30007"
+msgid "Add to PBS Favorites"
+msgstr ""
+
+msgctxt "#30008"
+msgid "Add to PBS Watchlist"
+msgstr ""
+
+msgctxt "#30009"
+msgid "Remove from PBS Watchlist"
+msgstr ""
+
+msgctxt "#30010"
+msgid "Sub-Titles"
+msgstr ""
+
+msgctxt "#30011"
+msgid "Enable Sub-Titles"
+msgstr ""
+
+msgctxt "#30012"
+msgid "Meta Data Cache"
+msgstr ""
+
+msgctxt "#30013"
+msgid "Enable Metadata Cache"
+msgstr ""
+
+msgctxt "#30014"
+msgid "Reset Metadata Cache"
+msgstr ""
+
+msgctxt "#30015"
+msgid "PBS Login"
+msgstr ""
+
+msgctxt "#30016"
+msgid "User Email"
+msgstr ""
+
+msgctxt "#30017"
+msgid "User Password"
+msgstr ""
+
+msgctxt "#30018"
+msgid "Enable Login"
+msgstr ""
+
+msgctxt "#30019"
+msgid "PBS Station"
+msgstr ""
+
+msgctxt "#30040"
+msgid "Metadata"
+msgstr ""
+
+msgctxt "#30041"
+msgid "Initialize Metadata Next Start"
+msgstr ""
+
+msgctxt "#30042"
+msgid "Initializing ...."
+msgstr ""
+
+msgctxt "#30045"
+msgid "Episodes"
+msgstr ""
+
+msgctxt "#30046"
+msgid "Clips"
+msgstr ""
+
+msgctxt "#30047"
+msgid "Previews"
+msgstr ""
+
+msgctxt "#30048"
+msgid "Local PBS Programs"
+msgstr ""
+
+msgctxt "#30049"
+msgid "Video Expired or requires Passport Membership"
+msgstr ""
+
+msgctxt "#30050"
+msgid "Next Page"
+msgstr ""
+
+msgctxt "#30051"
+msgid "PBS Episode Search"
+msgstr ""
diff --git a/plugin.video.thinktv/resources/lib/__init__.py b/plugin.video.thinktv/resources/lib/__init__.py
new file mode 100644
index 0000000..7986681
--- /dev/null
+++ b/plugin.video.thinktv/resources/lib/__init__.py
@@ -0,0 +1 @@
+__author__ = 't1m'
diff --git a/plugin.video.thinktv/resources/lib/scraper.py b/plugin.video.thinktv/resources/lib/scraper.py
new file mode 100644
index 0000000..735f691
--- /dev/null
+++ b/plugin.video.thinktv/resources/lib/scraper.py
@@ -0,0 +1,316 @@
+# -*- coding: utf-8 -*-
+# KodiAddon PBS ThinkTV
+#
+from t1mlib import t1mAddon
+import json
+import re
+import os
+import urllib
+import urllib2
+import cookielib
+import xbmcplugin
+import datetime
+import xbmc
+import xbmcgui
+import HTMLParser
+import sys
+
+h = HTMLParser.HTMLParser()
+UTF8 = 'utf-8'
+showsPerPage = 24 # number of shows returned per page by PBS
+
+class myAddon(t1mAddon):
+
+ def doPBSLogin(self):
+ if self.addon.getSetting('enable_login') != 'true':
+ return
+
+ profile = self.addon.getAddonInfo('profile').decode(UTF8)
+ pdir = xbmc.translatePath(profile).decode(UTF8)
+ if not os.path.isdir(pdir):
+ os.makedirs(pdir)
+ cjFile = xbmc.translatePath(os.path.join(profile, 'PBSCookies.dat')).decode(UTF8)
+ cj = cookielib.LWPCookieJar()
+ badCookie = True
+ try:
+ cj.load(cjFile)
+ except:
+ cj=[]
+ for cookie in cj:
+ if cookie.name == 'sessionid':
+ badCookie = cookie.is_expired()
+ if self.addon.getSetting('first_run_done') != 'true':
+ badCookie = True
+ if badCookie:
+ cj = cookielib.LWPCookieJar(cjFile)
+ opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
+ urllib2.install_opener(opener)
+ html = self.getRequest('http://www.pbs.org/shows/')
+ clientId = re.compile('id="signInServiceList".+?client_id=(.+?)"', re.DOTALL).search(html).group(1)
+ html = self.getRequest('https://account.pbs.org/oauth2/login/')
+ lcsr, lnext = re.compile("name='csrfmiddlewaretoken'.+?value='(.+?)'.+?"+'name="next".+?value="(.+?)"', re.DOTALL).search(html).groups()
+ username = self.addon.getSetting('login_name')
+ password = self.addon.getSetting('login_pass')
+ if username !='' and password !='':
+ url1 = ('https://account.pbs.org/oauth2/login/')
+ xheaders = self.defaultHeaders.copy()
+ xheaders["Referer"] = "https://account.pbs.org/oauth2/login/"
+ xheaders["Host"] = "account.pbs.org"
+ xheaders["Origin"] = "https://account.pbs.org"
+ xheaders["Connection"] = "keep-alive"
+ xheaders["Accept"] = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
+ xheaders["Content-Type"] = "application/x-www-form-urlencoded"
+ udata = urllib.urlencode({'csrfmiddlewaretoken' : lcsr, 'next' : lnext, 'email' : username, 'password' : password})
+ html = self.getRequest(url1, udata, xheaders)
+ html = self.getRequest('https://account.pbs.org/oauth2/authorize/?scope=account&redirect_uri=http://www.pbs.org/login/&response_type=code&client_id=%s&confirmed=1' % clientId)
+ for cookie in cj:
+ if cookie.name == 'pbsol.station':
+ self.addon.setSetting('pbsol', cookie.value)
+ elif cookie.name == 'pbs_uid':
+ self.addon.setSetting('pbs_uid', cookie.value)
+ self.addon.setSetting('first_run_done', 'true')
+ cj.save()
+ else:
+ opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
+ urllib2.install_opener(opener)
+ return
+
+
+ def getAddonMenu(self,url,ilist):
+ addonLanguage = self.addon.getLocalizedString
+ self.doPBSLogin()
+ xheaders = self.defaultHeaders.copy()
+ xheaders["Referer"] = "http://www.pbs.org/shows/?genre=All&title=&station=false&alphabetically=true&layout=grid"
+ xheaders["X-Requested-With"] = "XMLHttpRequest"
+ html = self.getRequest('http://www.pbs.org/shows-page/0/?genre=&title=&callsign=&alphabetically=true', None, xheaders)
+ a = json.loads(html)
+ for b in a['genres'][1:]:
+ ilist = self.addMenuItem(b['title'],'GS', ilist, str(b['id'])+'|0', self.addonIcon, self.addonFanart, None, isFolder=True)
+ if self.addon.getSetting('enable_login') == 'true':
+ pbsol = self.addon.getSetting('pbsol')
+ if pbsol != '':
+ xheaders = self.defaultHeaders.copy()
+ xheaders['X-Requested-With'] = 'XMLHttpRequest'
+ html = self.getRequest('http://www.pbs.org/shows-page/0/?genre=&title=&callsign=%s&alphabetically=true' % pbsol, None, xheaders)
+ if len(html) > 0:
+ a = json.loads(html)
+ if len(a['results']['content']) > 0:
+ ilist = self.addMenuItem(addonLanguage(30048) ,'GS', ilist, 'localpbs' , self.addonIcon, self.addonFanart, None, isFolder=True)
+ html = self.getRequest('http://www.pbs.org/favorite-shows-page/1/')
+ if len(html) > 0:
+ a = json.loads(html)
+ if a['totalResults'] > 0:
+ ilist = self.addMenuItem(addonLanguage(30004),'GS', ilist, 'favorites' , self.addonIcon, self.addonFanart, None, isFolder=True)
+ xheaders = self.defaultHeaders.copy()
+ xheaders['X-Requested-With'] = 'XMLHttpRequest'
+ html = self.getRequest('http://www.pbs.org/watchlist/page/1/', None, xheaders)
+ if len(html) > 0:
+ a = json.loads(html)
+ if a.get('videos') is not None:
+ if len(a['videos']) > 0:
+ ilist = self.addMenuItem(addonLanguage(30005) ,'GM', ilist, 'pbswatchlist' , self.addonIcon, self.addonFanart, None, isFolder=True)
+ ilist = self.addMenuItem(addonLanguage(30051) ,'GS', ilist, 'pbssearch' , self.addonIcon, self.addonFanart, None, isFolder=True)
+ return ilist
+
+
+ def getAddonShows(self,url,ilist):
+ pgNum = ''
+ addonLanguage = self.addon.getLocalizedString
+ self.doPBSLogin()
+ gsurl = url
+ if gsurl == 'favorites':
+ html = self.getRequest('http://www.pbs.org/favorite-shows-page/1/')
+ a = json.loads(html)
+ cats = a['content']
+ elif gsurl == 'localpbs':
+ xheaders = self.defaultHeaders.copy()
+ xheaders['X-Requested-With'] = 'XMLHttpRequest'
+ pbsol = self.addon.getSetting('pbsol')
+ html = self.getRequest('http://www.pbs.org/shows-page/0/?genre=&title=&callsign=%s&alphabetically=true' % (pbsol), None, xheaders)
+ a = json.loads(html)
+ cats = a['results']['content']
+ elif gsurl == 'pbssearch':
+ keyb = xbmc.Keyboard(self.addon.getSetting('last_search'), addonLanguage(30051))
+ keyb.doModal()
+ if (keyb.isConfirmed()):
+ answer = keyb.getText()
+ if len(answer) == 0:
+ return (ilist)
+ self.addon.setSetting('last_search', answer)
+ answer = answer.replace(' ','+')
+ xheaders = self.defaultHeaders.copy()
+ xheaders['X-Requested-With'] = 'XMLHttpRequest'
+ html = self.getRequest('http://www.pbs.org/search-videos/?callsign=WNET&page=1&q=%s&rank=relevance' % (answer), None, xheaders)
+ a = json.loads(html)
+ cats = a['results']['articles']
+ else:
+ genreUrl, pgNum = url.split('|',1)
+ xheaders = self.defaultHeaders.copy()
+ xheaders['X-Requested-With'] = 'XMLHttpRequest'
+ html = self.getRequest('http://www.pbs.org/shows-page/%s/?genre=%s&title=&callsign=&alphabetically=true' % (pgNum, genreUrl), None, xheaders)
+ a = json.loads(html)
+ cats = a['results']['content']
+ for i, (b) in list(enumerate(cats, start=1)):
+ if gsurl == 'pbssearch':
+ url = b['url']
+ else:
+ url = b.get('cid')
+ if url is None:
+ url = b['id']
+ name = b['title']
+ thumb = b['image']
+ if thumb == None :
+ thumb = self.addonIcon
+ fanart = b['image']
+ if fanart == None:
+ fanart = self.addonFanart
+ infoList = {}
+ infoList['TVShowTitle'] = name
+ infoList['Title'] = name
+ infoList['Studio'] = b.get('producer')
+ genres = b.get('genre_titles')
+ if genres != [] and genres is not None:
+ infoList['Genre'] = genres[0]
+ infoList['Episode'] = b.get('video_count')
+ infoList['Plot'] = b.get('description')
+ if self.addon.getSetting('enable_login') == 'true':
+ if gsurl == 'favorites':
+ contextMenu = [(addonLanguage(30006),'XBMC.Container.Update(%s?mode=DF&url=RF%s)' % (sys.argv[0], url))]
+ else:
+ contextMenu = [(addonLanguage(30007),'XBMC.RunPlugin(%s?mode=DF&url=AF%s)' % (sys.argv[0], url))]
+ else:
+ contextMenu = None
+ if gsurl == 'pbssearch':
+ infoList['mediatype'] = 'episode'
+ ilist = self.addMenuItem(name,'GV', ilist, url, thumb, fanart, infoList, isFolder=False)
+ else:
+ infoList['mediatype'] = 'tvshow'
+ ilist = self.addMenuItem(name,'GC', ilist, url, thumb, fanart, infoList, isFolder=True, cm=contextMenu)
+ if pgNum != '':
+ ilist = self.addMenuItem('[COLOR blue]%s[/COLOR]' % addonLanguage(30050),'GS', ilist, genreUrl+'|'+str(int(pgNum)+1), self.addonIcon, self.addonFanart, None, isFolder=True)
+ return(ilist)
+
+
+ def getAddonCats(self,url,ilist):
+ addonLanguage = self.addon.getLocalizedString
+ self.doPBSLogin()
+ thumb = xbmc.getInfoLabel('ListItem.Art(thumb)')
+ fanart = xbmc.getInfoLabel('ListItem.Art(fanart)')
+ infoList = {}
+ infoList['TVShowTitle'] = xbmc.getInfoLabel('ListItem.TVShowTitle')
+ infoList['Title'] = infoList['TVShowTitle']
+ infoList['mediatype'] = 'tvshow'
+ ilist = self.addMenuItem('%s' % (addonLanguage(30045)),'GE', ilist, '%s|%s|1' %(url, 'episodes'), thumb, fanart, infoList, isFolder=True)
+ ilist = self.addMenuItem('%s' % (addonLanguage(30046)),'GE', ilist, '%s|%s|1' %(url, 'clips'), thumb, fanart, infoList, isFolder=True)
+ ilist = self.addMenuItem('%s' % (addonLanguage(30047)),'GE', ilist, '%s|%s|1' %(url, 'previews'), thumb, fanart, infoList, isFolder=True)
+ return(ilist)
+
+
+ def getAddonEpisodes(self,url,ilist):
+ self.doPBSLogin()
+ addonLanguage = self.addon.getLocalizedString
+ url, stype, pageNum = url.split('|',2)
+ sname = url
+ html = self.getRequest('http://www.pbs.org/show/%s/%s/?page=%s' % (url, stype, pageNum))
+# epis = re.compile('<article class="video-summary">.+?data-srcset="(.+?)".+?alt="(.+?)".+?class="description">(.+?)<.+?data-video-id="(.+?)"',re.DOTALL).findall(html)
+ epis = re.compile('<article class="video-summary">.+?data-srcset="(.+?)".+?alt="(.+?)".+?class="description">(.+?)<.+?data-video-slug="(.+?)"',re.DOTALL).findall(html)
+ if len(epis) == 0:
+# epis = re.compile('<div class="video-summary">.+?data-srcset="(.+?)".+?alt="(.+?)".+?class="description">(.+?)<.+?data-video-id="(.+?)"',re.DOTALL).findall(html)
+ epis = re.compile('<div class="video-summary">.+?data-srcset="(.+?)".+?alt="(.+?)".+?class="description">(.+?)<.+?data-video-slug="(.+?)"',re.DOTALL).findall(html)
+ for i, (imgs, name, plot, url) in list(enumerate(epis, start=1)):
+ name = h.unescape(name.decode(UTF8))
+ name = name.replace('Video thumbnail: ','',1)
+ plot=plot.strip()
+ infoList = {}
+ imgs = imgs.split(',')
+ thumb = '%s.jpg' % (imgs[2].split('.jpg',1)[0].strip())
+ fanart = '%s.jpg' % (imgs[len(imgs)-1].split('.jpg',1)[0].strip())
+ infoList['Title'] = name
+ infoList['Plot'] = h.unescape(plot.decode(UTF8))
+ infoList['mediatype'] = 'episode'
+ infoList['TVShowTitle'] = xbmc.getInfoLabel('ListItem.TVShowTitle')
+ if self.addon.getSetting('enable_login') == 'true':
+ contextMenu = [(addonLanguage(30008),'XBMC.RunPlugin(%s?mode=DF&url=AW%s)' % (sys.argv[0], url))]
+ else:
+ contextMenu = None
+ ilist = self.addMenuItem(name,'GV', ilist, url, thumb, fanart, infoList, isFolder=False, cm=contextMenu)
+ if i >= showsPerPage:
+ ilist = self.addMenuItem('[COLOR blue]%s[/COLOR]' % addonLanguage(30050),'GE', ilist, '%s|%s|%s' %(sname, stype, str(int(pageNum)+1)), self.addonIcon, self.addonFanart, None, isFolder=True)
+ return(ilist)
+
+
+ def getAddonMovies(self,url,ilist):
+ addonLanguage = self.addon.getLocalizedString
+ xbmcplugin.setContent(int(sys.argv[1]), 'episodes')
+ self.doPBSLogin()
+ xheaders = self.defaultHeaders.copy()
+ xheaders['X-Requested-With'] = 'XMLHttpRequest'
+ html = self.getRequest('http://www.pbs.org/watchlist/page/1/', None, xheaders)
+ a = json.loads(html)
+ epis = a['videos']
+ for i, b in list(enumerate(epis, start=1)):
+ infoList = {}
+ name = b['title']
+ plot = b['description']
+ duration = b['duration']
+ t = 0
+ for dur in duration.split(':'):
+ if dur.strip().isdigit():
+ t = t*60 + int(dur.strip())
+ if t != 0:
+ infoList['duration'] = t
+ thumb = b['image']
+ fanart = b['image']
+ infoList['TVShowTitle'] = b['show']['title']
+ infoList['Title'] = name
+ infoList['Plot'] = plot
+ infoList['mediatype'] = 'episode'
+ url = str(b['id'])
+ contextMenu = [(addonLanguage(30009),'XBMC.Container.Update(%s?mode=DF&url=RW%s)' % (sys.argv[0], url))]
+ ilist = self.addMenuItem(name,'GV', ilist, url, thumb, fanart, infoList, isFolder=False, cm=contextMenu)
+ return(ilist)
+
+ def doFunction(self, url):
+ self.doPBSLogin()
+ func = url[0:2]
+ url = url[2:]
+ if func == 'AW':
+ html = self.getRequest('http://www.pbs.org/profile/addFavoriteVideo/%s/' % url)
+ elif func == 'AF':
+ html = self.getRequest('http://www.pbs.org/profile/addFavoriteProgram/%s/' % url)
+ elif func == 'RW':
+ html = self.getRequest('http://www.pbs.org/profile/removeFavoriteVideo/%s/' % url)
+ elif func == 'RF':
+ html = self.getRequest('http://www.pbs.org/profile/removeFavoriteProgram/%s/' % url)
+ try:
+ a = json.loads(html)
+ xbmc.executebuiltin('XBMC.Notification("%s", "%s", %s)' % ( self.addonName, a['errorMessage'] , 4000) )
+ except: pass
+
+
+ def getAddonVideo(self,url):
+ xheaders = self.defaultHeaders.copy()
+ xheaders['X-Requested-With'] = 'XMLHttpRequest'
+ html = self.getRequest('http://www.pbs.org/video/%s/' % (url), None, xheaders)
+ url = re.compile("id: '(.+?)'", re.DOTALL).search(html).group(1)
+ addonLanguage = self.addon.getLocalizedString
+ pbs_uid = self.addon.getSetting('pbs_uid')
+ pg = self.getRequest('https://player.pbs.org/viralplayer/%s/?uid=%s' % (url, pbs_uid))
+ urls = re.compile("PBS.videoData =.+?recommended_encoding.+?'url'.+?'(.+?)'.+?'closed_captions_url'.+?'(.+?)'", re.DOTALL).search(pg)
+ if urls is not None:
+ url,suburl = urls.groups()
+ pg = self.getRequest('%s?format=json' % url)
+ url = json.loads(pg)['url']
+ else:
+ xbmc.executebuiltin('XBMC.Notification("%s", "%s", %s)' % ( self.addonName, addonLanguage(30049) , 4000) )
+ return
+
+ if 'mp4:' in url:
+ url = 'http://ga.video.cdn.pbs.org/%s' % url.split('mp4:',1)[1]
+ liz = xbmcgui.ListItem(path = url)
+ subfile = self.procConvertSubtitles(suburl)
+ liz.setSubtitles([(subfile)])
+ if ('.m3u8' in url):
+ liz.setProperty('inputstreamaddon','inputstream.adaptive')
+ liz.setProperty('inputstream.adaptive.manifest_type','hls')
+ xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
diff --git a/plugin.video.thinktv/resources/settings.xml b/plugin.video.thinktv/resources/settings.xml
new file mode 100644
index 0000000..6950b6f
--- /dev/null
+++ b/plugin.video.thinktv/resources/settings.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<settings>
+
+ <category label="30015">
+ <setting type="sep" />
+ <setting id="enable_login" type ="bool" label="30018" default="false"/>
+ <setting id="login_name" type="text" label="30016" enable="!eq(-1,false)" default=""/>
+ <setting id="login_pass" type="text" label="30017" enable="!eq(-1,)" option="hidden" default=""/>
+ <setting id="pbsol" type="text" label="30019" enable="false" default=""/>
+ <setting type="sep" />
+ </category>
+
+ <category label="30000">
+ <setting type="sep" />
+ <setting id="vid_res" type="enum" label="30000" lvalues="30001|30002|30003" default="2" />
+ <setting type="sep" />
+ </category>
+
+</settings>
diff --git a/plugin.video.vrt.nu/addon.py b/plugin.video.vrt.nu/addon.py
index dbeec3d..37c4ede 100644
--- a/plugin.video.vrt.nu/addon.py
+++ b/plugin.video.vrt.nu/addon.py
@@ -5,33 +5,37 @@ from resources.lib.vrtplayer import vrtplayer
from resources.lib.kodiwrappers import kodiwrapper
from resources.lib.vrtplayer import actions
from resources.lib.kodiwrappers import sortmethod
+from resources.lib.vrtplayer import urltostreamservice
-_addon_ = xbmcaddon.Addon()
_url = sys.argv[0]
_handle = int(sys.argv[1])
+
def router(params_string):
addon = xbmcaddon.Addon()
kodi_wrapper = kodiwrapper.KodiWrapper(_handle, _url, addon)
- vrt_player = vrtplayer.VRTPlayer(addon, addon.getAddonInfo("path"))
+ stream_service = urltostreamservice.UrlToStreamService(vrtplayer.VRTPlayer._VRT_BASE,
+ vrtplayer.VRTPlayer._VRTNU_BASE_URL,
+ kodi_wrapper)
+ vrt_player = vrtplayer.VRTPlayer(addon.getAddonInfo("path"), kodi_wrapper, stream_service)
params = dict(parse_qsl(params_string))
if params:
if params['action'] == actions.LISTING_AZ:
- kodi_wrapper.show_listing(vrt_player.get_az_menu_items(), sortmethod.ALPHABET)
+ vrt_player.show_az_menu_items()
elif params['action'] == actions.LISTING_CATEGORIES:
- kodi_wrapper.show_listing(vrt_player.get_category_menu_items(), sortmethod.ALPHABET)
+ vrt_player.show_category_menu_items()
elif params['action'] == actions.LISTING_LIVE:
- kodi_wrapper.show_listing(vrt_player.get_livestream_items(), sortmethod.ALPHABET)
+ vrt_player.show_livestream_items()
elif params['action'] == actions.LISTING_VIDEOS:
- kodi_wrapper.show_listing(vrt_player.get_videos(params['video']))
+ vrt_player.show_videos(params['video'])
elif params['action'] == actions.LISTING_CATEGORY_VIDEOS:
- kodi_wrapper.show_listing(vrt_player.get_video_category_episodes(params['video']), sortmethod.ALPHABET)
+ vrt_player.show_video_category_episodes(params['video'])
elif params['action'] == actions.PLAY:
- kodi_wrapper.play_video(params['video'])
+ vrt_player.play_vrtnu_video(params['video'])
elif params['action'] == actions.PLAY_LIVE:
- kodi_wrapper.play_livestream(params['video'])
+ vrt_player.play_livestream(params['video'])
else:
- kodi_wrapper.show_listing(vrt_player.get_main_menu_items(), sortmethod.ALPHABET)
+ vrt_player.show_main_menu_items()
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 3969872..8a45d0d 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="1.0.0"
+ version="1.1.0"
provider-name="Martijn Moreel">
<requires>
@@ -23,6 +23,8 @@
<platform>all</platform>
<license>GNU General Public License, v3</license>
<news>
+v1.1.0 (15-12-2017)
+- Refactored internal code
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
diff --git a/plugin.video.vrt.nu/resources/lib/helperobjects/helperobjects.py b/plugin.video.vrt.nu/resources/lib/helperobjects/helperobjects.py
index 599d3ef..9508545 100644
--- a/plugin.video.vrt.nu/resources/lib/helperobjects/helperobjects.py
+++ b/plugin.video.vrt.nu/resources/lib/helperobjects/helperobjects.py
@@ -16,14 +16,14 @@ class StreamURLS:
class Credentials:
- def __init__(self, addon):
- self.addon = addon
+ def __init__(self, kodi_wrapper):
+ self._kodi_wrapper = kodi_wrapper
self.reload()
def are_filled_in(self):
return not (self.username is None or self.password is None or self.username == "" or self.password == "")
def reload(self):
- self.username = self.addon.getSetting("username")
- self.password = self.addon.getSetting("password")
+ self.username = self._kodi_wrapper.get_setting("username")
+ self.password = self._kodi_wrapper.get_setting("password")
diff --git a/plugin.video.vrt.nu/resources/lib/kodiwrappers/kodiwrapper.py b/plugin.video.vrt.nu/resources/lib/kodiwrappers/kodiwrapper.py
index 7edcccd..6df324d 100644
--- a/plugin.video.vrt.nu/resources/lib/kodiwrappers/kodiwrapper.py
+++ b/plugin.video.vrt.nu/resources/lib/kodiwrappers/kodiwrapper.py
@@ -3,7 +3,6 @@ import xbmcgui
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:
@@ -35,11 +34,7 @@ class KodiWrapper:
xbmcplugin.endOfDirectory(self._handle)
- def play_video(self, path):
- stream_service = urltostreamservice.UrlToStreamService(vrtplayer.VRTPlayer._VRT_BASE,
- vrtplayer.VRTPlayer._VRTNU_BASE_URL,
- self._addon)
- stream = stream_service.get_stream_from_url(path)
+ def play_video(self, stream):
if stream is not None:
play_item = xbmcgui.ListItem(path=stream.stream_url)
if stream.subtitle_url is not None:
@@ -49,3 +44,16 @@ class KodiWrapper:
def play_livestream(self, path):
play_item = xbmcgui.ListItem(path=path)
xbmcplugin.setResolvedUrl(self._handle, True, listitem=play_item)
+
+ def show_ok_dialog(self, title, message):
+ xbmcgui.Dialog().ok(self._addon.getAddonInfo('name'), title, message)
+
+ def get_localized_string(self, string_id):
+ return self._addon.getLocalizedString(string_id)
+
+ def get_setting(self, setting_id ):
+ return self._addon.getSetting(setting_id)
+
+ def open_settings(self):
+ self._addon.openSettings()
+
diff --git a/plugin.video.vrt.nu/resources/lib/vrtplayer/metadatacreator.py b/plugin.video.vrt.nu/resources/lib/vrtplayer/metadatacreator.py
index 44a3c35..7abfb9d 100644
--- a/plugin.video.vrt.nu/resources/lib/vrtplayer/metadatacreator.py
+++ b/plugin.video.vrt.nu/resources/lib/vrtplayer/metadatacreator.py
@@ -29,7 +29,7 @@ class MetadataCreator:
return self._datetime
@datetime.setter
- def datetime (self, value):
+ def datetime(self, value):
self._datetime = value
def get_video_dictionary(self):
diff --git a/plugin.video.vrt.nu/resources/lib/vrtplayer/urltostreamservice.py b/plugin.video.vrt.nu/resources/lib/vrtplayer/urltostreamservice.py
index f295d65..f14e5ae 100644
--- a/plugin.video.vrt.nu/resources/lib/vrtplayer/urltostreamservice.py
+++ b/plugin.video.vrt.nu/resources/lib/vrtplayer/urltostreamservice.py
@@ -1,6 +1,4 @@
-import xbmcgui
import requests
-import xbmc
import json
import cookielib
import urlparse
@@ -13,16 +11,16 @@ class UrlToStreamService:
_API_KEY ="3_qhEcPa5JGFROVwu5SWKqJ4mVOIkwlFNMSKwzPDAh8QZOtHqu6L4nD5Q7lk0eXOOG"
_BASE_GET_STREAM_URL_PATH = "https://mediazone.vrt.be/api/v1/vrtvideo/assets/"
- def __init__(self, vrt_base, vrtnu_base_url, addon):
+ def __init__(self, vrt_base, vrtnu_base_url, kodi_wrapper):
self._vrt_base = vrt_base
self._vrtnu_base_url = vrtnu_base_url
- self._addon = addon
+ self._kodi_wrapper = kodi_wrapper
self._session = requests.session()
def get_stream_from_url(self, url):
- cred = helperobjects.Credentials(self._addon)
+ cred = helperobjects.Credentials(self._kodi_wrapper)
if not cred.are_filled_in():
- self._addon.openSettings()
+ self._kodi_wrapper.open_settings()
cred.reload()
url = urlparse.urljoin(self._vrt_base, url)
r = self._session.post("https://accounts.eu1.gigya.com/accounts.login",
@@ -55,13 +53,13 @@ class UrlToStreamService:
stream_response = self._session.get(final_url)
hls = self.__get_hls(stream_response.json()['targetUrls']).replace("https", "http")
subtitle = None
- if self._addon.getSetting("showsubtitles") == "true":
+ if self._kodi_wrapper.get_setting("showsubtitles") == "true":
subtitle = self.__get_subtitle(stream_response.json()['subtitleUrls'])
return helperobjects.StreamURLS(hls, subtitle)
else:
- xbmcgui.Dialog().ok(self._addon.getAddonInfo('name'),
- self._addon.getLocalizedString(32051),
- self._addon.getLocalizedString(32052))
+ title = self._kodi_wrapper.get_localized_string(32051)
+ message = self._kodi_wrapper.get_localized_string(32052)
+ self._kodi_wrapper.show_ok_dialog(title, message)
@staticmethod
def __get_hls(dictionary):
diff --git a/plugin.video.vrt.nu/resources/lib/vrtplayer/vrtplayer.py b/plugin.video.vrt.nu/resources/lib/vrtplayer/vrtplayer.py
index 3b413ce..9315387 100644
--- a/plugin.video.vrt.nu/resources/lib/vrtplayer/vrtplayer.py
+++ b/plugin.video.vrt.nu/resources/lib/vrtplayer/vrtplayer.py
@@ -8,6 +8,8 @@ from resources.lib.vrtplayer import metadatacollector
from resources.lib.vrtplayer import statichelper
from resources.lib.vrtplayer import actions
from resources.lib.vrtplayer import metadatacreator
+from resources.lib.kodiwrappers import sortmethod
+
class VRTPlayer:
@@ -21,33 +23,38 @@ class VRTPlayer:
_VRTNU_BASE_URL = urljoin(_VRT_BASE, "/vrtnu/")
_VRTNU_SEARCH_URL = "https://search.vrt.be/suggest?facets[categories]="
- def __init__(self, addon, addon_path):
+ def __init__(self, addon_path, kodi_wrapper, url_to_stream_service):
self.metadata_collector = metadatacollector.MetadataCollector()
- self._addon = addon
self._addon_path = addon_path
+ self._kodi_wrapper = kodi_wrapper
+ self._url_toStream_service = url_to_stream_service
- def get_main_menu_items(self):
- return {helperobjects.TitleItem(self._addon.getLocalizedString(32091), {'action': actions.LISTING_AZ}, False,
+ def show_main_menu_items(self):
+ menu_items = {helperobjects.TitleItem(self._kodi_wrapper.get_localized_string(32091), {'action': actions.LISTING_AZ}, False,
None),
- helperobjects.TitleItem(self._addon.getLocalizedString(32092), {'action': actions.LISTING_CATEGORIES},
+ helperobjects.TitleItem(self._kodi_wrapper.get_localized_string(32092), {'action': actions.LISTING_CATEGORIES},
False, None),
- helperobjects.TitleItem(self._addon.getLocalizedString(32100), {'action': actions.LISTING_LIVE}, False,
+ helperobjects.TitleItem(self._kodi_wrapper.get_localized_string(32100), {'action': actions.LISTING_LIVE}, False,
None)}
+ self._kodi_wrapper.show_listing(menu_items, sortmethod.ALPHABET)
- def get_az_menu_items(self):
+ def show_az_menu_items(self):
joined_url = urljoin(self._VRTNU_BASE_URL, "./a-z/")
- return self.__get_menu_items(joined_url, {"class": "tile"}, actions.LISTING_VIDEOS, self.metadata_collector.get_az_metadata)
+ menu_items = self.__get_menu_items(joined_url, {"class": "tile"}, actions.LISTING_VIDEOS,
+ self.metadata_collector.get_az_metadata)
+ self._kodi_wrapper.show_listing(menu_items, sortmethod.ALPHABET)
- def get_category_menu_items(self):
+ def show_category_menu_items(self):
joined_url = urljoin(self._VRTNU_BASE_URL, "./categorieen/")
- return self.__get_menu_items(joined_url, {"class": "tile tile--category"}, actions.LISTING_CATEGORY_VIDEOS)
+ menu_items = self.__get_menu_items(joined_url, {"class": "tile tile--category"}, actions.LISTING_CATEGORY_VIDEOS)
+ self._kodi_wrapper.show_listing(menu_items, sortmethod.ALPHABET)
- def get_video_category_episodes(self, path):
+ def show_video_category_episodes(self, path):
category = path.split('/')[-2]
joined_url = self._VRTNU_SEARCH_URL + category
response = requests.get(joined_url)
programs = response.json()
- listing = []
+ menu_items = []
for program in programs:
title = program["title"]
plot = BeautifulSoup(program["description"], "html.parser").text
@@ -62,25 +69,33 @@ class VRTPlayer:
"")
item = helperobjects.TitleItem(title, {'action': actions.LISTING_VIDEOS, 'video': link_to_video},
False, thumbnail, video_dictionary)
- listing.append(item)
- return listing
+ menu_items.append(item)
+ self._kodi_wrapper.show_listing(menu_items, sortmethod.ALPHABET)
- def get_livestream_items(self):
- return {helperobjects.TitleItem(self._addon.getLocalizedString(32101),
+ def play_vrtnu_video(self, url):
+ stream = self._url_toStream_service.get_stream_from_url(url)
+ self._kodi_wrapper.play_video(stream)
+
+ def play_livestream(self, url):
+ self._kodi_wrapper.play_livestream(url)
+
+ def show_livestream_items(self):
+ livestream_items = {helperobjects.TitleItem(self._kodi_wrapper.get_localized_string(32101),
{'action': actions.PLAY_LIVE, 'video': self._EEN_LIVESTREAM},
True, self.__get_media("een.png")),
- helperobjects.TitleItem(self._addon.getLocalizedString(32102),
+ helperobjects.TitleItem(self._kodi_wrapper.get_localized_string(32102),
{'action': actions.PLAY_LIVE, 'video': self._CANVAS_LIVESTREAM_},
True, self.__get_media("canvas.png")),
- helperobjects.TitleItem(self._addon.getLocalizedString(32103),
+ helperobjects.TitleItem(self._kodi_wrapper.get_localized_string(32103),
{'action': actions.PLAY_LIVE, 'video': self._KETNET_LIVESTREAM},
True, self.__get_media("ketnet.png")),
- helperobjects.TitleItem(self._addon.getLocalizedString(32104),
+ helperobjects.TitleItem(self._kodi_wrapper.get_localized_string(32104),
{'action': actions.PLAY_LIVE, 'video': self._SPORZA_LIVESTREAM},
True, self.__get_media("sporza.png"))
}
+ self._kodi_wrapper.show_listing(livestream_items, sortmethod.ALPHABET)
- def get_videos(self, path):
+ def show_videos(self, path):
url = urljoin(self._VRT_BASE, path)
#xbmc.log(url, xbmc.LOGWARNING)
# go to url.relevant gets redirected and go on with this url
@@ -102,7 +117,7 @@ class VRTPlayer:
title_items.extend(self.__get_multiple_videos(soup))
else:
title_items.extend(self.__get_single_video(relevant_path.url, soup))
- return title_items
+ self._kodi_wrapper.show_listing(title_items)
def __get_episodes(self, option_tags):
@@ -118,7 +133,6 @@ class VRTPlayer:
title_items.append(helperobjects.TitleItem(title, {"action" : actions.LISTING_VIDEOS, 'video':path}, False))
return title_items
-
def __get_multiple_videos(self, tiles):
title_items = []
episode_list = tiles.find("div", {"id": "episodelist__slider"})
@@ -136,7 +150,7 @@ class VRTPlayer:
path = tile["href"]
video_dictionary = self.metadata_collector.get_multiple_layout_episode_metadata(tile)
- title_items.append(helperobjects.TitleItem(title, {"action": "play", "video": path}, True, thumbnail, video_dictionary))
+ title_items.append(helperobjects.TitleItem(title, {"action": actions.PLAY, "video": path}, True, thumbnail, video_dictionary))
return title_items
def __get_single_video(self, path, soup):
@@ -149,7 +163,7 @@ class VRTPlayer:
vrt_video = soup.find(class_="vrtvideo")
thumbnail = VRTPlayer.__format_image_url(vrt_video)
- title_items.append(helperobjects.TitleItem(list_item_title, {"action": "play", "video": path}, True, thumbnail, video_dictionary))
+ title_items.append(helperobjects.TitleItem(list_item_title, {"action": actions.PLAY, "video": path}, True, thumbnail, video_dictionary))
return title_items
def __get_media(self, file_name):