Update test.py

This commit is contained in:
zhushenwudi 2021-07-25 11:13:12 +08:00 committed by GitHub
parent 63a7662be4
commit 9d12e8a4aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,13 +8,12 @@ url = "https://www.bilibili.com/video/BV1GV411p7P9"
path = os.path.dirname(os.path.realpath(__file__)) path = os.path.dirname(os.path.realpath(__file__))
def getJson(url): def getJson(url):
from you_get import common as you
try: try:
__console__ = sys.stdout __console__ = sys.stdout
f = io.StringIO() f = io.StringIO()
sys.stdout = f sys.stdout = f
sys.argv = ['you-get', url, '--json'] sys.argv = ['you-get', url, '--json']
you.main() you_get.main()
text = f.getvalue() text = f.getvalue()
sys.stdout = __console__ sys.stdout = __console__
print(text) print(text)