Explorar el Código

Try to better attribute source of backed-up captions

microtasks
tech234a hace 3 años
padre
commit
a17736c293
Se han modificado 1 ficheros con 13 adiciones y 2 borrados
  1. +13
    -2
      export.py

+ 13
- 2
export.py Ver fichero

@@ -119,8 +119,12 @@ def subprrun(jobs, mysession):
inttext = page.text
del page

filestring = ""
if "forceedit" in mode:
filestring = "_community"
if '<li id="captions-editor-nav-captions" role="tab" data-state="published" class="published">' in inttext:
filestring = "_published"

if mode == "forceedit-captions":
filestring = "_community_revised"

if not "forceedit" in mode:
@@ -163,6 +167,13 @@ def subprrun(jobs, mysession):
if metadata["title"] == False:
metadata["title"] = ""
metadata["description"] = parser.description[:-16]

filestring = "_community"
if '<li id="captions-editor-nav-metadata" role="tab" data-state="published" class="published">' in inttext:
filestring = "_published"

if mode == "forceedit-metadata":
filestring = "_community_revised"
open("out/"+vid+"/"+vid+"_"+langcode+filestring+".json", "w", encoding="utf-8").write(dumps(metadata))
del metadata



Cargando…
Cancelar
Guardar