Made it so hybrid mode actually works :p (thanks maddie)
This commit is contained in:
parent
2a638ac4b4
commit
7179c36af1
1 changed files with 3 additions and 2 deletions
|
@ -18,7 +18,7 @@ f = open("config.json")
|
||||||
config = json.load(f)
|
config = json.load(f)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
if config['config']['method'] == "api":
|
if config['config']['method'] in ('api', 'hybrid'):
|
||||||
auth = twitter.oauth.OAuth(config['api']['access_token'], config['api']['access_secret'], config['api']['api_key'], config['api']['api_secret'])
|
auth = twitter.oauth.OAuth(config['api']['access_token'], config['api']['access_secret'], config['api']['api_key'], config['api']['api_secret'])
|
||||||
twitter_api = twitter.Twitter(auth=auth)
|
twitter_api = twitter.Twitter(auth=auth)
|
||||||
|
|
||||||
|
@ -122,8 +122,9 @@ def linkToVNF(vidlink): # Return a VideoInfo object or die trying
|
||||||
if config['config']['method'] == 'hybrid':
|
if config['config']['method'] == 'hybrid':
|
||||||
try:
|
try:
|
||||||
return linkToVNFfromAPI(vidlink)
|
return linkToVNFfromAPI(vidlink)
|
||||||
except Exception:
|
except Exception as e:
|
||||||
print("API Failed")
|
print("API Failed")
|
||||||
|
print(e)
|
||||||
return linkToVNFfromYoutubeDL(vidlink)
|
return linkToVNFfromYoutubeDL(vidlink)
|
||||||
elif config['config']['method'] == 'api':
|
elif config['config']['method'] == 'api':
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue