Commit 72f6427c authored by Jonas's avatar Jonas

Les xmltvs peuvent contenir des - et _

parent 33a5d25b
......@@ -46,7 +46,7 @@ if r.ok :
else :
print 'Error: can\'t load xmltvid list'
pattern = re.compile('^XMLTV: (.*) \([0-9A-Za-z\.]*\)$')
pattern = re.compile('^XMLTV: (.*) \([0-9A-Za-z\.\-_]*\)$')
for ch in channels['entries'] :
if ch['epggrab'] :
print '%(name)s already have xmltvid, pass'%ch
......@@ -54,23 +54,27 @@ for ch in channels['entries'] :
print 'Search xmltvid for %(name)s'%ch
found = False
for xmltvid in xmltvids['entries'] :
chan_name = pattern.search(xmltvid['val']).group(1)
if chan_name.lower() == ch['name'].lower() :
print " - found (%s)"%xmltvid['key']
found = True
r = requests.post(
args.hts_url+'api/idnode/save',
auth=(args.hts_user, args.hts_password),
data={
'node': json.dumps({
"epggrab":[xmltvid['key']],
"uuid":ch['uuid']
})
}
)
if r.ok :
print " - saved"
else :
print " - error"
r_search = pattern.search(xmltvid['val'])
if r_search :
chan_name = r_search.group(1)
if chan_name.lower() == ch['name'].lower() :
print " - found (%s)"%xmltvid['key']
found = True
r = requests.post(
args.hts_url+'api/idnode/save',
auth=(args.hts_user, args.hts_password),
data={
'node': json.dumps({
"epggrab":[xmltvid['key']],
"uuid":ch['uuid']
})
}
)
if r.ok :
print " - saved"
else :
print " - error"
else :
print " - search error (%s)"%xmltvid['val']
if not found :
print " - no found"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment