my.youtube: use new my.google.takeout.parser module for its data

- fallback on the old logic if google_takeout_parser isn't available
- move to my.youtube.takeout (possibly mixing in other sources later)
- keep my.media.youtube, but issue deprecation warning
  currently used in orger etc, so doesn't hurt to keep
- also fixes https://github.com/karlicoss/HPI/issues/113
This commit is contained in:
Dima Gerasimov 2022-04-20 21:58:10 +01:00 committed by karlicoss
parent 915cfe69b3
commit 78f6ae96d1
5 changed files with 154 additions and 51 deletions

View file

@ -83,3 +83,10 @@ def sqlite_backup(*, source: sqlite3.Connection, dest: sqlite3.Connection, **kwa
dest.cursor().executescript(tempfile.read())
dest.commit()
# can remove after python3.9
def removeprefix(text: str, prefix: str) -> str:
if text.startswith(prefix):
return text[len(prefix):]
return text