Add the ability to add a proxy to youtube_dl
This commit is contained in:
parent
3e14ddfb89
commit
d792f1d648
|
@ -28,6 +28,7 @@ The only required file to modify would be the config.yml.sample file. The entrie
|
|||
- discord_bots_key: The key for the [bots.discord.pw site](https://bots.discord.pw/#g=1), if you don't have a key just leave it blank, it should fail and log the failure
|
||||
- carbon_key: The key used for the [carbonitex site](https://www.carbonitex.net/discord/bots)
|
||||
- twitch_key: The twitch token that is used for the API calls
|
||||
- youtube_dl_proxy: A URL that can be used to proxy the calls youtube_dl goes through. Useful if your server is in a location that has many youtube videos blocked.
|
||||
- youtube_key: The key used for youtube API calls
|
||||
- osu_key: The key used for Osu API calls
|
||||
- db_*: This is the information for the rethinkdb database.
|
||||
|
|
|
@ -10,7 +10,7 @@ global_config = {}
|
|||
try:
|
||||
with open("config.yml", "r") as f:
|
||||
global_config = yaml.safe_load(f)
|
||||
global_config = {k: v if isinstance(v, str) and len(v) != 0 else None for k, v in global_config.items()}
|
||||
global_config = {k: v for k, v in global_config.items() if v}
|
||||
except FileNotFoundError:
|
||||
print("You have no config file setup! Please use config.yml.sample to setup a valid config file")
|
||||
quit()
|
||||
|
@ -56,7 +56,9 @@ lol_key = global_config.get('lol_key', '')
|
|||
# The invite link for the server made for the bot
|
||||
dev_server = global_config.get("dev_server", "")
|
||||
# The User-Agent that we'll use for most requests
|
||||
user_agent = global_config.get('user_agent', "")
|
||||
user_agent = global_config.get('user_agent', None)
|
||||
# The URL to proxy youtube_dl's requests through
|
||||
ytdl_proxy = global_config.get('youtube_dl_proxy', None)
|
||||
# The extensions to load
|
||||
extensions = ['cogs.interaction', 'cogs.misc', 'cogs.mod', 'cogs.admin', 'cogs.images',
|
||||
'cogs.owner', 'cogs.stats', 'cogs.picarto', 'cogs.overwatch', 'cogs.links',
|
||||
|
|
|
@ -9,6 +9,7 @@ twitch_key: 'key'
|
|||
youtube_key: 'key'
|
||||
osu_key: 'key'
|
||||
dev_server: 'https://discord.gg/123456'
|
||||
youtube_dl_proxy: 'https://myproxy.proxy:1234'
|
||||
|
||||
user_agent: 'User-Agent/1.0.0 (Comment like link to site)'
|
||||
|
||||
|
|
Loading…
Reference in a new issue