Browse Source

Try to better attribute source of backed-up captions

microtasks
tech234a 3 years ago
parent
commit
a17736c293
1 changed files with 13 additions and 2 deletions
  1. +13
    -2
      export.py

+ 13
- 2
export.py View File

@@ -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



Loading…
Cancel
Save