Skip to content

Commit

Permalink
Multiple regions for Movistar+
Browse files Browse the repository at this point in the history
  • Loading branch information
miberian authored and AbuBaniaz committed Sep 19, 2023
1 parent 11cb1ec commit 4f1b2f0
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 11 deletions.
38 changes: 29 additions & 9 deletions AutoBouquetsMaker/providers/sat_192_movistar_plus_esp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,42 @@
onid="1"
/>
<dvbsconfigs>
<configuration key="sd_1" bouquet="0x21" region="0x82">Movistar+ SD</configuration>
<configuration key="hd_1" bouquet="0x21" region="0x83">Movistar+ HD</configuration>
<configuration key="hd_2" bouquet="0x21" region="0xFF">Movistar+ HD+SD</configuration>
</dvbsconfigs>
<sections>
<section number="1">Entretenimiento</section>
<section number="31">Pelis</section>
<section number="46">Deportes</section>
<section number="70">Documentales</section>
<section number="94">Infantil</section>
<section number="119">Noticias</section>
<section number="167">Taquilla</section>
<section number="400">No HD</section>
<section number="470">Otros</section>
<section number="1">Generalistas</section>
<section number="12">Originales</section>
<section number="30">Cine y Series</section>
<section number="53">Deportes</section>
<section number="82">Documentales</section>
<section number="92">Estilo de Vida</section>
<section number="110">Infantiles</section>
<section number="120">Música</section>
<section number="127">Noticias</section>
<section number="151">Autonómicos</section>
<section number="162">Alquiler SD</section>
<section number="167">Multideporte</section>
<section number="198">Alquiler HD</section>
<section number="199">Portada</section>
<section number="300">Bares</section>
<section number="400">SD</section>
<section number="485">Otros</section>
</sections>
<visibleserviceflag ignore="1"/>
<servicehacks>
<![CDATA[
# Remove invalid channels
blacklist = (
".",
"TEST TÉCNICO"
)
if service["number"] > 500 or service["service_name"] in blacklist:
skip.skip = True
]]>
</servicehacks>
</provider>
23 changes: 21 additions & 2 deletions AutoBouquetsMaker/src/scanner/dvbscanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ class DvbScanner():
HD_ALLOWED_TYPES = [17, 25, 27, 135]
HEVC_ALLOWED_TYPES = [31]

CATCH_ALL_BAT_TYPE = 255
# Valid regions in order of priority {region: priority}
CATCH_ALL_BAT_VALID_TYPES = {130: 130, 131: 131}

def __init__(self):
self.adapter = 0
self.demuxer = 0
Expand Down Expand Up @@ -510,15 +514,30 @@ def readLCNBAT(self, bouquet_id, descriptor_tag, TSID_ONID_list):
dvbreader.close(fd)

logical_channel_number_dict = {}
list_catch_all_bat_valid_types = []
for region in self.CATCH_ALL_BAT_VALID_TYPES.keys():
list_catch_all_bat_valid_types.append(region)

for service in bat_content:
if service["descriptor_tag"] != descriptor_tag:
continue
if descriptor_tag != self.CATCH_ALL_BAT_TYPE:
continue
elif service["descriptor_tag"] not in list_catch_all_bat_valid_types:
continue

key = "%x:%x:%x" % (service["transport_stream_id"], service["original_network_id"], service["service_id"])
TSID_ONID = "%x:%x" % (service["transport_stream_id"], service["original_network_id"])

logical_channel_number_dict[key] = service
if descriptor_tag != self.CATCH_ALL_BAT_TYPE:
logical_channel_number_dict[key] = service
else:
prio_new = self.CATCH_ALL_BAT_VALID_TYPES[(service["descriptor_tag"])]
try:
prio_old = self.CATCH_ALL_BAT_VALID_TYPES[((logical_channel_number_dict[key])["descriptor_tag"])]
except:
prio_old = 0
if prio_new > prio_old:
logical_channel_number_dict[key] = service
if TSID_ONID not in tmp_TSID_ONID_list:
tmp_TSID_ONID_list.append(TSID_ONID)

Expand Down

3 comments on commit 4f1b2f0

@Huevos
Copy link
Member

@Huevos Huevos commented on 4f1b2f0 Sep 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At @AbuBaniaz have you tested these commits? If not please revert.

@Huevos
Copy link
Member

@Huevos Huevos commented on 4f1b2f0 Sep 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really is a horrible hack for one provider that doesn't follow the standard.

@AbuBaniaz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I did.

Please sign in to comment.