update sitemap video namespace
This commit is contained in:
parent
86599a4341
commit
90d8d46603
1 changed files with 3 additions and 1 deletions
|
@ -100,7 +100,7 @@ def update_sitemap(base_url):
|
||||||
urlset.attrib['xmlns'] = "http://www.sitemaps.org/schemas/sitemap/0.9"
|
urlset.attrib['xmlns'] = "http://www.sitemaps.org/schemas/sitemap/0.9"
|
||||||
urlset.attrib['xmlns:xsi'] = "http://www.w3.org/2001/XMLSchema-instance"
|
urlset.attrib['xmlns:xsi'] = "http://www.w3.org/2001/XMLSchema-instance"
|
||||||
urlset.attrib['xsi:schemaLocation'] = "http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"
|
urlset.attrib['xsi:schemaLocation'] = "http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"
|
||||||
urlset.attrib['xmlns:video']= "http://www.google.com/schemas/sitemap-video/1.0"
|
urlset.attrib['xmlns:video']= "http://www.google.com/schemas/sitemap-video/1.1"
|
||||||
|
|
||||||
url = ET.SubElement(urlset, "url")
|
url = ET.SubElement(urlset, "url")
|
||||||
loc = ET.SubElement(url, "loc")
|
loc = ET.SubElement(url, "loc")
|
||||||
|
@ -162,6 +162,8 @@ def update_sitemap(base_url):
|
||||||
if duration > 0:
|
if duration > 0:
|
||||||
el = ET.SubElement(video, "video:duration")
|
el = ET.SubElement(video, "video:duration")
|
||||||
el.text = "%s" % int(duration)
|
el.text = "%s" % int(duration)
|
||||||
|
el = ET.SubElement(video, "video:live")
|
||||||
|
el.text = "no"
|
||||||
|
|
||||||
if Text.objects.filter(name='').exclude(text='').exists():
|
if Text.objects.filter(name='').exclude(text='').exists():
|
||||||
t = Text.objects.filter(name='')[0]
|
t = Text.objects.filter(name='')[0]
|
||||||
|
|
Loading…
Reference in a new issue