Comments (6)
It looks like you can just set an environment variable to enable the use of a proxy.
Something like this might work (set the environment variable before any calls to trakt.py):
import os
os.environ['HTTP_PROXY'] = 'http://...'
# or
os.environ['HTTPS_PROXY'] = 'http://...'
If this doesn't work, I can just add an extra configuration parameter into trakt.py.
from trakt.py.
Can you please have a look if I missed something?
razzeee/script.trakt@3eab97a
https://github.com/Razzeee/script.trakt/issues/181#issuecomment-98806541
from trakt.py.
Looks like the environment variables don't work with requests.Session
, try this instead (update to the develop branch of trakt.py):
Trakt.http.proxies = {
'http': 'http://<username>:<password>@<host>:<port>',
'https': 'http://<username>:<password>@<host>:<port>'
}
Note: the proxies
dictionary maps specific request schemes to a proxy, set both "http" and "https" to the same proxy url.
from trakt.py.
I'm not sure I understand you? Should there be a new commit to the develop branch?
Should this stay like this or do I use the real url? Should both be http or can both also be https?
Trakt.http.proxies = {
'http': 'http://<username>:<password>@<host>:<port>',
'https': 'http://<username>:<password>@<host>:<port>'
}
from trakt.py.
Woops, only pushed the commit to my private git server. fedd568 adds the "proxies" attribute.
You should be able to just replace:
proxyURL = checkAndConfigureProxy()
if proxyURL:
if proxyURL.startswith('http://'):
os.environ['HTTP_PROXY'] = proxyURL
elif proxyURL.startswith('https://'):
os.environ['HTTPS_PROXY'] = proxyURL
with (untested, make sure the indentation is correct):
proxyURL = checkAndConfigureProxy()
if proxyURL:
Trakt.http.proxies = {
'http': proxyURL,
'https': proxyURL
}
from trakt.py.
Working flawless, thank you!
from trakt.py.
Related Issues (20)
- watched attribute always None in Episode HOT 2
- Watchlist get all HOT 4
- Expose ratings endpoint
- Add extended info for user list items HOT 1
- Limit results from trending movies requests HOT 2
- Continue previous session HOT 3
- How do I add an episode/movie to history with `watched_at='released'`? HOT 1
- Support querying for user list items by type HOT 1
- Implement friends and following for users
- Implement users/id/watchlist and users/id/collection
- Implement lists/trending and lists/popular HOT 3
- Regression in version 4.x HOT 6
- Issues with Trakt HOT 10
- Rate limiting HOT 2
- Add support for Popular/Recommended Movies/Shows HOT 4
- ReadTimeout Error HOT 3
- "Images" is None when using extended=full HOT 1
- Update requirements? HOT 2
- [Help] How to mark an episode as watched ? HOT 1
- Search query return all matching items even if the year parameter is passed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trakt.py.