ox.web.youtube: use in/out/value like ox.srt, decode html value
This commit is contained in:
parent
575549ae33
commit
2456ec2d5a
1 changed files with 4 additions and 3 deletions
|
@ -7,6 +7,7 @@ import re
|
||||||
from xml.dom.minidom import parseString
|
from xml.dom.minidom import parseString
|
||||||
|
|
||||||
import feedparser
|
import feedparser
|
||||||
|
import ox
|
||||||
from ox.cache import read_url, cache_timeout
|
from ox.cache import read_url, cache_timeout
|
||||||
|
|
||||||
|
|
||||||
|
@ -93,9 +94,9 @@ def info(id):
|
||||||
end = start + float(duration)
|
end = start + float(duration)
|
||||||
text = t.firstChild.data
|
text = t.firstChild.data
|
||||||
subs.append({
|
subs.append({
|
||||||
'start': start,
|
'in': start,
|
||||||
'end': end,
|
'out': end,
|
||||||
'value': text,
|
'value': ox.decode_html(text),
|
||||||
})
|
})
|
||||||
info['subtitles'][language] = subs
|
info['subtitles'][language] = subs
|
||||||
return info
|
return info
|
||||||
|
|
Loading…
Reference in a new issue