You should not borrow code when you don't understand it, I clearly said I posted the All Channels code for inspiration not the all bouquet channels one.
The allBouquet Channel code is below but it is not usable in your case 1:1 because EPGLoad is not using this strange idea of Ignore lists, instead you select for which Bouquets you WANT to have EPG loaded and all OTHERS are ignored, even whenv data for them would be in the XMLTV File.
def getAllBouquetServices(self):
services=[]
sp=[]
for bouquet in os.listdir("/etc/enigma2"):
if bouquet.startswith("userbouquet.") and bouquet.endswith(".tv"):
f=open("/etc/enigma2/%s" % bouquet,"r")
line=f.readline()
bouquet_name = line.replace("#NAME ","").rstrip().lstrip()
# cprint("[EPGLOAD] CHECKS bouquet %s" % bouquet_name)
found=False
for x in range(bouquet_length):
# print ">>>>>>>", bouquet_name, bouquet, config.plugins.epgload.bouquets[x].file.value, config.plugins.epgload.bouquets[x].importing.value
if bouquet==config.plugins.epgload.bouquets[x].file.value and config.plugins.epgload.bouquets[x].importing.value:
cprint("[EPGLOAD] FOUND bouquet %s" % bouquet_name)
found=True
if found:
while line:
line=f.readline()
if line.startswith("#SERVICE"):
service=line.replace("#SERVICE ","").rstrip('\r\n')
if service.find(":0:0:0:0:0:0:0:") is -1:
mref=miniServiceReference(service)
services.append(mref)
else:
cprint("[EPGLOAD] IGNORES bouquet %s" % bouquet_name)
f.close()
return services
Because it answers you question how 'efficiently' you can get the sref from ALL bouqets files (even hidden ones whiich are only for IPTV not even in listed bouqets.tv), I also posted the code getAllBouquetServices above, but keep in mind that my bouqets selection config variables from EPG Load which control from which bouqets the sref/mini sref should be added to the list is useless in you case.
BTW the code I posted FIRST would have also worked for individual bouqets (of favorites) when you would have adapted the epg query string correctly ... but this is another story and it just reflects why I walked away from your EPGImport code and created my onw one... but now I'm repeating myself.
Ciao
gutemine
Edited by gutemine, 21 June 2019 - 10:08.