mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-08-19 13:01:46 -07:00
[compat] Use compat_open()
This commit is contained in:
parent
aac33155e4
commit
a25e9f3c84
16 changed files with 68 additions and 55 deletions
|
@ -22,6 +22,7 @@ from youtube_dl.compat import (
|
|||
compat_http_cookiejar_Cookie,
|
||||
compat_http_cookies_SimpleCookie,
|
||||
compat_kwargs,
|
||||
compat_open as open,
|
||||
compat_str,
|
||||
compat_urllib_error,
|
||||
)
|
||||
|
@ -701,12 +702,12 @@ class TestYoutubeDL(unittest.TestCase):
|
|||
|
||||
class SimplePP(PostProcessor):
|
||||
def run(self, info):
|
||||
with open(audiofile, 'wt') as f:
|
||||
with open(audiofile, 'w') as f:
|
||||
f.write('EXAMPLE')
|
||||
return [info['filepath']], info
|
||||
|
||||
def run_pp(params, PP):
|
||||
with open(filename, 'wt') as f:
|
||||
with open(filename, 'w') as f:
|
||||
f.write('EXAMPLE')
|
||||
ydl = YoutubeDL(params)
|
||||
ydl.add_post_processor(PP())
|
||||
|
@ -725,7 +726,7 @@ class TestYoutubeDL(unittest.TestCase):
|
|||
|
||||
class ModifierPP(PostProcessor):
|
||||
def run(self, info):
|
||||
with open(info['filepath'], 'wt') as f:
|
||||
with open(info['filepath'], 'w') as f:
|
||||
f.write('MODIFIED')
|
||||
return [], info
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue