From eba1c0a5eddb0fce64cbc982d3a5dca5cbee934a Mon Sep 17 00:00:00 2001
From: Marc <marcvila10@hotmail.com>
Date: Tue, 8 Jan 2019 15:57:44 +0100
Subject: [PATCH] Add andorra to script, m3u8 and json

---
 TELEVISION.md                |  2 +-
 script/my_script.py          | 12 ++++++++----
 script/{public => }/utils.py |  0
 3 files changed, 9 insertions(+), 5 deletions(-)
 rename script/{public => }/utils.py (100%)

diff --git a/TELEVISION.md b/TELEVISION.md
index 67f65bfd..f893ab64 100644
--- a/TELEVISION.md
+++ b/TELEVISION.md
@@ -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) | - |
diff --git a/script/my_script.py b/script/my_script.py
index 45b77230..532567b3 100644
--- a/script/my_script.py
+++ b/script/my_script.py
@@ -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()
 
diff --git a/script/public/utils.py b/script/utils.py
similarity index 100%
rename from script/public/utils.py
rename to script/utils.py