avoid printing stack trace on normal youtube_dl unsupported condition (still prints error message unfortunately)

This commit is contained in:
Noah Levitt 2015-07-15 14:33:22 -07:00
parent 9b13f0c34c
commit 7b92ba39c7

View File

@ -69,13 +69,14 @@ def disclaim_site(site):
ydl_opts = { ydl_opts = {
"outtmpl": "/dev/null", "outtmpl": "/dev/null",
"verbose": True, "verbose": False,
"retries": 3, "retries": 1,
"logger": logging, "logger": logging,
"nocheckcertificate": True, "nocheckcertificate": True,
"hls_prefer_native": True, "hls_prefer_native": True,
"noprogress": True, "noprogress": True,
"nopart": True, "nopart": True,
"no_color": True,
} }
if args.proxy_server: if args.proxy_server:
ydl_opts["proxy"] = "http://{}".format(args.proxy_server) ydl_opts["proxy"] = "http://{}".format(args.proxy_server)
@ -109,8 +110,11 @@ def try_youtube_dl(site, crawl_url):
putmeta(url=crawl_url.url, putmeta(url=crawl_url.url,
content_type="application/vnd.youtube-dl_formats+json;charset=utf-8", content_type="application/vnd.youtube-dl_formats+json;charset=utf-8",
payload=info_json.encode("utf-8")) payload=info_json.encode("utf-8"))
except youtube_dl.utils.UnsupportedError: except BaseException as e:
if youtube_dl.utils.UnsupportedError in e.exc_info:
pass pass
else:
raise
def brozzle_site(site, browser): def brozzle_site(site, browser):
start = time.time() start = time.time()