1
0
Fork 0
mirror of https://github.com/LaQuay/TDTChannels.git synced 2024-12-27 09:42:28 +01:00

Add andorra to script, m3u8 and json

This commit is contained in:
Marc 2019-01-08 15:57:44 +01:00
parent dab42a1501
commit eba1c0a5ed
3 changed files with 9 additions and 5 deletions

View file

@ -248,7 +248,7 @@
| 8 La Janda | - | [web](https://www.youtube.com/watch?v=-Dkg-AejlIw) | - | [Logo](https://yt3.ggpht.com/a-/AAuE7mChtew-NIbpSmzmq7EKPWe_1ZxNLKG3-LO0JA=s288-mo-c-c0xffffffff-rj-k-no) | - |
| Huelva TV | [m3u8](http://cls.todostreaming.eu/telehuelva/restricted/playlist.m3u8) | [web](http://huelvatv.com/directo/) | - | [Logo](https://pbs.twimg.com/profile_images/645349922103889920/JGbRJMxo.jpg) | - |
| Canal 45 TV | [m3u8](https://5940924978228.streamlock.net/f_Directo/f_Directo/master.m3u8) | [web](http://www.canal45tv.com/)| 420p | [Logo](https://i1.wp.com/directostv.teleame.com/wp-content/uploads/2016/02/Canal-45-Ja%C3%A9n.png) | - |
| Lebrija TV | [m3u8](http://212.104.160.156:1935/live/lebrijatv2/playlist2.m3u8?wowzasessionid=1758058924.m3u8) | [web](http://www.lebrija.tv/directo/) | 720x576 | [Logo](http://www.lebrija.tv/wp-content/uploads/2016/06/logo-web-2.png) | - |
| Lebrija TV | [m3u8](http://212.104.160.156:1935/live/lebrijatv2/playlist2.m3u8?wowzasessionid=1758058924.m3u8) | [web](http://www.lebrija.tv/directo/) | 576p | [Logo](http://www.lebrija.tv/wp-content/uploads/2016/06/logo-web-2.png) | - |
| Onda Algeciras TV | [m3u8](http://cls.provideo.es/algecirastv/livestream/playlist.m3u8) | [web](http://ondaalgecirastv.com/en-directo/) | - | [Logo](http://ondaalgecirastv.com/wp-content/uploads/2015/11/header-ok.png) | - |
| Teleonuba | [m3u8](http://stream.teleonuba.es:1935/live/GdZpE8ef/playlist.m3u8) | [web](http://www.teleonuba.es/en-directo/)| - | [Logo](http://www.teleonuba.es/imagenes/logo_teleonuba_fb.png) | - |
| CanalCosta | [m3u8](http://stream.canalcostatv.es:1935/web/IKbtqOuj/chunklist_w2068473919.m3u8) | [web](http://www.canalcostatv.es/en-directo/)| - | [Logo](http://www.canalcostatv.es/wp-content/uploads/2013/12/logo-cabecera.png) | - |

View file

@ -5,14 +5,14 @@ import requests
from ambit import Ambito
from country import Country
# TODO Change this
from public.utils import stringbetween, get_channels_from_part, get_license_info
from utils import stringbetween, get_channels_from_part, get_license_info
page = requests.get('https://raw.githubusercontent.com/LaQuay/TDTChannels/add-local-m3u8/TELEVISION.md',
page = requests.get('https://raw.githubusercontent.com/LaQuay/TDTChannels/master/TELEVISION.md',
headers={'Cache-Control': 'no-cache'})
content = str(page.text)
spain = Country("Spain")
andorra = Country("Andorra")
international = Country("International")
content_nacional = stringbetween(content, "### Nacionales", "### Locales")
@ -150,15 +150,19 @@ spain.get_ambit("Valencia").add_channels(get_channels_from_part(canales_locales_
canales_internacionales = stringbetween(content, "## Internacionales", "### Andorra")
international.add_ambit(Ambito("Internacional", get_channels_from_part(canales_internacionales)))
canales_andorra = stringbetween(content, "### Andorra", "")
andorra.add_ambit(Ambito("Andorra", get_channels_from_part(canales_andorra)))
# Save data to JSON file
json_file = open('./public/output/channels.json', "w+")
# TODO Add license
json_file.write("[")
json_file.write(json.dumps(get_license_info()))
json_file.write(", ")
json_file.write(json.dumps(spain.to_json()))
json_file.write(", ")
json_file.write(json.dumps(international.to_json()))
json_file.write(", ")
json_file.write(json.dumps(andorra.to_json()))
json_file.write("]")
json_file.close()