Comments (4)
hey @Mr-Steal-Your-Script
Tthanks for the question.
It should be noted right away that the current api is based on rest-api and provides only a more convenient and typed response. As for the stream, this can potentially be done by implementing your own backend and taking data in "chunks". If we are talking about polling or opening a long connection, then I would like to hear the problem in a little more detail.
from pornhub-api.
Thanks for the quick response! I was trying to get a stream of all videos with a certain keyword, so that I could add it together with PRAW and automatically submit to a subreddit.
from pornhub-api.
ok, I think I get the idea.
In an amicable way, it is worth creating a kind of wrapper and periodically calling the api with the necessary parameters, iterating through the pages along the way (if necessary).
in pseudocode it might look like
def stream(timeout, **params):
while True:
result = api.get_videos(**params)
for video in result.videos:
yield video
sleep(timeout)
@Mr-Steal-Your-Script did I understand You correctly?
from pornhub-api.
yes, this is working. thanks.
from pornhub-api.
Related Issues (14)
- Attributeerror HOT 2
- Is this the power of god?
- Why? HOT 1
- Period = weekly don't work
- Example with page search HOT 2
- View a video HOT 1
- Search function can't be called
- Playlist support HOT 2
- Dependabot couldn't authenticate with https://pypi.python.org/simple/
- way to limit how many results come back?
- decoder error HOT 2
- premium HOT 3
- Return uploader?
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 pornhub-api.