Comments (5)
Unfortunately no this isn't built to be a module.
Not sure if this is what you wanted but you probably could modify the spawn command to do something else like launch an actual torrent client if you strip out the peerflix arguments.
from torrentflix.
Will close this if you have any other questions feel free to post them here.
from torrentflix.
I actually do have one question, I've forked your library because there is no other decent node modules which have good torrent site search result scrapers, I plan to execute the torrent searches in a loop and save the resulting torrent files after the user has selected them (I'm pulling data on music releases and want to allow the user to select a tracker, then select a torrent for each release; the search terms are created dynamically, however).
I noticed however that when the prompt/inquirer code is put in a loop, node's execution doesn't halt on the response... but rather it continues pushing the prompt question after question to the console without waiting for user input.
Do you have a recommendation for how I can have the inquirer actually wait for user input, so that each prompt can be executed sequentially in some kind of dynamically created loop?
from torrentflix.
Yea i ran into the same problem when building this, Its because node works asynchronously.
There are a few ways around this there is a module called async you can use and wait for a callback before running the next task you want to do:
https://github.com/caolan/async#seriestasks-callback
So for example you can do [task] [task] [task] [prompt]
I'm also using promises for the actual scraping. http://howtonode.org/promises.
Once i have grabbed everything from the torrent site i send a promise response with an object of all the data that the main script is waiting for and then handles.
If you need a guide or a basic how two i'm happy to write one up for you.
from torrentflix.
This is great, thanks for pointing me in the right direction. Let you know
how it goes.
On 7 May 2015 at 10:16, Declan [email protected] wrote:
Yea i ran into the same problem when building this, Its because node works
asynchronously.There are a few ways around this there is a module called async you can
use and wait for a callback before running the next task you want to do:https://github.com/caolan/async#seriestasks-callback
So for example you can do [task] [task] [task] [prompt]
I'm also using promises for the actual scraping.
http://howtonode.org/promises.
Once i have grabbed everything from the torrent site i send a promise
response with an object of all the data that the main script is waiting for
and then handles.If you need a guide or a basic how two i'm happy to write one up for you.
β
Reply to this email directly or view it on GitHub
#15 (comment)
.
Evan Cameron
from torrentflix.
Related Issues (20)
- Error on linux when installing with npm
- Can't run
- can't find config file
- crash for bad http certificate HOT 1
- New site to search? HOT 1
- Crashes while using GetStrike HOT 2
- Issue searching torrent on Cpasbien.io HOT 2
- How to get more results? HOT 1
- Doesn't update using npm HOT 4
- [ADD] x[BiT] as a provider (have rss and api) HOT 1
- Update Nyaa URL HOT 1
- Could not locate the bindings files. HOT 6
- rarbg updated their api (fixed) HOT 1
- Problem with installation HOT 1
- Is there possibility for download? HOT 8
- Erroring after selecting correct number of torrent to play HOT 2
- NODE_TLS_REJECT_UNAUTHORIZED = "0"
- Torrentflix froze HOT 5
- `/usr/bin/env: βnode\rβ: No such file or directory` on Linux HOT 6
- tpb search isn't working HOT 2
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 torrentflix.