Skip to content

Commit

Permalink
⭐️ New provider zooqle,
Browse files Browse the repository at this point in the history
Problems column for providers,
List providers option
  • Loading branch information
murat committed Aug 31, 2017
1 parent 5b46eb7 commit 58dd726
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 14 deletions.
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ Because katcr fastest provider for scrabing currently.

Yep, there is a few provider option.

| Provider | Status |
|:------------------|:------:|
| katcr ||
| rarbg ||
| thepiratebay ||
| extratorrent ||
| 1337x ||
| zooqle | ☑️ |
| torrentfunk | ☑️ |
| limetorrents | ☑️ |
| Provider | Status | Problems |
|:------------------|:------:|:---------|
| katcr || - |
| rarbg || Slow Connection, Threat defensing |
| thepiratebay || Only Magnet |
| extratorrent || Slow Connection |
| 1337x || Connection N+1 |
| zooqle | | Skipping some torrents |
| torrentfunk | ☑️ | 🙈 |
| limetorrents | ☑️ | 🙈 |

Use `-p PROVIDER` flag for scrape another providers.

Expand All @@ -76,9 +76,11 @@ And you can list all active providers and usage instructions with `-h` or `--hel
-s, --search=s Search term [SEARCH]
-d, --directory=d Destination path for download torrent [DIRECTORY]
-p, --provider=p Provider name [PROVIDER]
-l, --list-providers List providers
-a, --auto-download Auto download best choice



[![See it in action](https://asciinema.org/a/No1Zdfk3gYoCYdGb2XUdFaUyS.png)](https://asciinema.org/a/No1Zdfk3gYoCYdGb2XUdFaUyS)

## Development
Expand Down
14 changes: 11 additions & 3 deletions lib/tors/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,20 @@ def scrape

puts 'Scrabing...'

@page.css(@provider['scrape']['selector']).each_with_index do |row, key|
key = 0
@page.css(@provider['scrape']['selector']).each do |row|
hash = {
key: key + 1,
name: row.search(@provider['scrape']['data']['name']).text,
url: ''
}
if @provider['scrape']['data']['download'].is_a?(String)
hash[:url] = @provider['download_prefix'] + row.search(@provider['scrape']['data']['download']).first['href']
link = row.search(@provider['scrape']['data']['download'])
if !link.empty?
hash[:url] = @provider['download_prefix'] + link.first['href']
else
next
end
else
@subpage = Nokogiri::HTML(open(@provider['download_prefix'] + row.css(@provider['scrape']['data']['download']['url']).first['href']))

Expand All @@ -61,11 +67,13 @@ def scrape
@rows << [
(key + 1).to_s,
!@provider['scrape']['data']['category'].empty? ? row.css(@provider['scrape']['data']['category']).text.tr("\n", ' ').squeeze(' ').strip : '',
!@provider['scrape']['data']['name'].empty? ? row.css(@provider['scrape']['data']['name']).text.strip : '',
!@provider['scrape']['data']['name'].empty? ? row.css(@provider['scrape']['data']['name']).text.strip[0..60] + '[...]' : '',
!@provider['scrape']['data']['size'].empty? ? row.css(@provider['scrape']['data']['size']).text.strip : '',
!@provider['scrape']['data']['seed'].empty? ? row.css(@provider['scrape']['data']['seed']).text.strip.green : '',
!@provider['scrape']['data']['leech'].empty? ? row.css(@provider['scrape']['data']['leech']).text.strip.red : ''
]

key += 1
end

results
Expand Down
2 changes: 1 addition & 1 deletion lib/tors/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module TorS
VERSION = '0.2.2'.freeze
VERSION = '0.3.0'.freeze
end
12 changes: 12 additions & 0 deletions providers/zooqle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: 'zooqle'
url: "https://zooqle.com/search?q=%{query}&s=ns&v=t&sd=d"
download_prefix: "https://zooqle.com/"
scrape:
selector: 'table.table-torrents > tr'
data:
name: 'td:nth-child(2) > a'
category: ''
download: 'td:nth-child(3) ul li:nth-child(3) a'
size: 'div.progress-bar.prog-blue'
seed: 'div.progress-bar.prog-green'
leech: 'div.progress-bar.prog-yellow'

0 comments on commit 58dd726

Please sign in to comment.