mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-21 17:51:51 +00:00
change regular expression
This commit is contained in:
parent
be008e657d
commit
3462456666
1 changed files with 1 additions and 1 deletions
|
@ -19,7 +19,7 @@ from youtube_dl import compat_str
|
||||||
year = compat_str(datetime.datetime.now().year)
|
year = compat_str(datetime.datetime.now().year)
|
||||||
for fn in glob.glob('*.html*'):
|
for fn in glob.glob('*.html*'):
|
||||||
content = read_file(fn)
|
content = read_file(fn)
|
||||||
newc = re.sub(r'(?P<copyright>Copyright © 2011-)(?P<year>[0-9]{4})', 'Copyright © 2011-' + year, content)
|
newc = re.sub(r'(?P<copyright>Copyright © 2011-)(?P<year>\d{4})', 'Copyright © 2011-' + year, content)
|
||||||
if content != newc:
|
if content != newc:
|
||||||
tmpFn = fn + '.part'
|
tmpFn = fn + '.part'
|
||||||
write_file(tmpFn, newc)
|
write_file(tmpFn, newc)
|
||||||
|
|
Loading…
Reference in a new issue