Skip to content

Commit

Permalink
add test for testing format merging
Browse files Browse the repository at this point in the history
  • Loading branch information
d0u9 committed Apr 18, 2018
1 parent 96062d9 commit 083769d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,28 @@

class MyLogger(object):
def debug(self, msg):
pass
print('dbg: ', msg)

def warning(self, msg):
pass
print('warn: ', msg)

def error(self, msg):
print(msg)
print('err: ', msg)


def my_hook(d):
print(d)
if d['status'] == 'finished':
print('Done downloading, now converting ...')
print('--------------- finish -----------------')

if __name__ == '__main__':
chdir('/tmp')

ydl_opts = {
# 'format': 'bestaudio+best',
'format': 'bestvideo+bestaudio',
'postprocessors': [{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'mp3',
'preferredquality': '192',
}],
'logger': MyLogger(),
'progress_hooks': [my_hook],
}

with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download(['https://www.youtube.com/watch?v=BaW_jenozKc'])
ret = ydl.extract_info('https://www.youtube.com/watch?v=jZvC7NWkeA0')
40 changes: 0 additions & 40 deletions youtube_dl_webui/test/postprocessor.py

This file was deleted.

0 comments on commit 083769d

Please sign in to comment.