my.youtube.takeout: deduplicate watched videos and sort out a few minor errors
This commit is contained in:
parent
75639a3d5e
commit
8ed9e1947e
3 changed files with 102 additions and 33 deletions
|
@ -22,12 +22,17 @@ if not TYPE_CHECKING:
|
|||
source.backup(dest, **kwargs)
|
||||
|
||||
|
||||
# can remove after python3.9 (although need to keep the method itself for bwd compat)
|
||||
## can remove after python3.9 (although need to keep the method itself for bwd compat)
|
||||
def removeprefix(text: str, prefix: str) -> str:
|
||||
if text.startswith(prefix):
|
||||
return text[len(prefix) :]
|
||||
return text
|
||||
|
||||
def removesuffix(text: str, suffix: str) -> str:
|
||||
if text.endswith(suffix):
|
||||
return text[:-len(suffix)]
|
||||
return text
|
||||
##
|
||||
|
||||
## used to have compat function before 3.8 for these, keeping for runtime back compatibility
|
||||
if not TYPE_CHECKING:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue