Exemplo n.º 1
0
from ambit import Ambito
from country import Country
from utils import stringbetween, get_radio_channels_from_part, get_license_info, get_current_timestamp

page = requests.get(
    'https://raw.githubusercontent.com/LaQuay/TDTChannels/master/RADIO.md',
    headers={'Cache-Control': 'no-cache'})
content = str(page.text)

print("Updating RADIO files")

spain = Country("Spain")
andorra = Country("Andorra")
international = Country("International")

content_nacional = stringbetween(content, "## Nacionales", "## Locales")
content_local = stringbetween(content, "## Locales", "## Internacionales")

canales_nacionales = stringbetween(content_nacional, "", "## Deportivos")
spain.add_ambit(
    Ambito("Generalistas", get_radio_channels_from_part(canales_nacionales)))

canales_deportivos = stringbetween(content_nacional, "## Deportivos",
                                   "## Autonómicos")
spain.add_ambit(
    Ambito("Deportivos", get_radio_channels_from_part(canales_deportivos)))

canales_autonomicos_andalucia = stringbetween(content_nacional,
                                              "### Andalucía", "### Aragón")
spain.add_ambit(
    Ambito("Andalucía",
Exemplo n.º 2
0
from ambit import Ambito
from country import Country
from utils import stringbetween, get_tv_channels_from_part, get_license_info

page = requests.get('https://raw.githubusercontent.com/LaQuay/TDTChannels/master/TELEVISION.md',
                    headers={'Cache-Control': 'no-cache'})
content = str(page.text)

print("Updating TV files")

spain = Country("Spain")
andorra = Country("Andorra")
international = Country("International")

content_nacional = stringbetween(content, "## Nacionales", "## Locales")
content_local = stringbetween(content, "## Locales", "## Internacionales")

canales_nacionales = stringbetween(content_nacional, "", "## Informativos")
spain.add_ambit(Ambito("Generalistas", get_tv_channels_from_part(canales_nacionales)))

canales_informativos = stringbetween(content_nacional, "## Informativos", "## Deportivos")
spain.add_ambit(Ambito("Informativos", get_tv_channels_from_part(canales_informativos)))

canales_deportivos = stringbetween(content_nacional, "## Deportivos", "## Infantiles")
spain.add_ambit(Ambito("Deportivos", get_tv_channels_from_part(canales_deportivos)))

canales_infantiles = stringbetween(content_nacional, "## Infantiles", "## Musicales")
spain.add_ambit(Ambito("Infantiles", get_tv_channels_from_part(canales_infantiles)))

canales_musicales = stringbetween(content_nacional, "## Musicales", "## Webcams")