piratebay_api 0.0.2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.idea/workspace.xml +83 -19
- data/lib/piratebay_api/pirate_bay.rb +4 -4
- data/lib/piratebay_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d01b97ad5887fff53f885b7cd0e0027de0122bb6
|
4
|
+
data.tar.gz: 128457182d11b6c50e87a7ad600c67a4fd0c33e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87799623aded88c8e6458eda407b42506deae3cffe325cc74f9a4ccf0c01253caf7e1a97c0d3d9c78aaec2eee1645723d25640300bb2ffb90396158dc5e7ff5a
|
7
|
+
data.tar.gz: 30f81a26bc96399e1d0145562f6a74f3cfaf96f7611b7767d3a17813850a925269658d5fc9c118f470d0844222b6e26db25bbba028f562ce075a6faefe1c30ab
|
data/.idea/workspace.xml
CHANGED
@@ -30,7 +30,7 @@
|
|
30
30
|
<entry file="file://$PROJECT_DIR$/lib/piratebay_api.rb">
|
31
31
|
<provider selected="true" editor-type-id="text-editor">
|
32
32
|
<state vertical-scroll-proportion="0.0">
|
33
|
-
<caret line="
|
33
|
+
<caret line="20" column="22" selection-start-line="20" selection-start-column="22" selection-end-line="20" selection-end-column="22" />
|
34
34
|
<folding />
|
35
35
|
</state>
|
36
36
|
</provider>
|
@@ -60,7 +60,7 @@
|
|
60
60
|
<entry file="file://$PROJECT_DIR$/lib/piratebay_api/pirate_bay.rb">
|
61
61
|
<provider selected="true" editor-type-id="text-editor">
|
62
62
|
<state vertical-scroll-proportion="0.0">
|
63
|
-
<caret line="
|
63
|
+
<caret line="22" column="0" selection-start-line="22" selection-start-column="0" selection-end-line="22" selection-end-column="0" />
|
64
64
|
<folding />
|
65
65
|
</state>
|
66
66
|
</provider>
|
@@ -89,8 +89,8 @@
|
|
89
89
|
<file leaf-file-name="version.rb" pinned="false" current-in-tab="true">
|
90
90
|
<entry file="file://$PROJECT_DIR$/lib/piratebay_api/version.rb">
|
91
91
|
<provider selected="true" editor-type-id="text-editor">
|
92
|
-
<state vertical-scroll-proportion="0.
|
93
|
-
<caret line="
|
92
|
+
<state vertical-scroll-proportion="0.027732464">
|
93
|
+
<caret line="1" column="16" selection-start-line="1" selection-start-column="16" selection-end-line="1" selection-end-column="16" />
|
94
94
|
<folding />
|
95
95
|
</state>
|
96
96
|
</provider>
|
@@ -211,8 +211,8 @@
|
|
211
211
|
</PATH>
|
212
212
|
</subPane>
|
213
213
|
</pane>
|
214
|
-
<pane id="Scratches" />
|
215
214
|
<pane id="Scope" />
|
215
|
+
<pane id="Scratches" />
|
216
216
|
</panes>
|
217
217
|
</component>
|
218
218
|
<component name="PropertiesComponent">
|
@@ -276,14 +276,14 @@
|
|
276
276
|
<frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
|
277
277
|
<editor active="true" />
|
278
278
|
<layout>
|
279
|
-
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32597265" sideWeight="0.
|
279
|
+
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32597265" sideWeight="0.48507464" order="7" side_tool="false" content_ui="tabs" />
|
280
280
|
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32899022" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
281
281
|
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
282
282
|
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
283
283
|
<window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
284
|
-
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.
|
284
|
+
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.26066098" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
|
285
285
|
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
|
286
|
-
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32597265" sideWeight="0.
|
286
|
+
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32597265" sideWeight="0.51492536" order="7" side_tool="true" content_ui="tabs" />
|
287
287
|
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
288
288
|
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
|
289
289
|
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
@@ -340,7 +340,7 @@
|
|
340
340
|
<entry file="file://$PROJECT_DIR$/lib/piratebay_api/pirate_bay.rb">
|
341
341
|
<provider selected="true" editor-type-id="text-editor">
|
342
342
|
<state vertical-scroll-proportion="0.0">
|
343
|
-
<caret line="
|
343
|
+
<caret line="8" column="16" selection-start-line="8" selection-start-column="16" selection-end-line="8" selection-end-column="16" />
|
344
344
|
<folding />
|
345
345
|
</state>
|
346
346
|
</provider>
|
@@ -348,7 +348,7 @@
|
|
348
348
|
<entry file="file://$PROJECT_DIR$/lib/piratebay_api/result.rb">
|
349
349
|
<provider selected="true" editor-type-id="text-editor">
|
350
350
|
<state vertical-scroll-proportion="0.0">
|
351
|
-
<caret line="
|
351
|
+
<caret line="28" column="35" selection-start-line="28" selection-start-column="35" selection-end-line="28" selection-end-column="35" />
|
352
352
|
<folding />
|
353
353
|
</state>
|
354
354
|
</provider>
|
@@ -364,7 +364,7 @@
|
|
364
364
|
<entry file="file://$PROJECT_DIR$/lib/piratebay_api/version.rb">
|
365
365
|
<provider selected="true" editor-type-id="text-editor">
|
366
366
|
<state vertical-scroll-proportion="0.0">
|
367
|
-
<caret line="
|
367
|
+
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
368
368
|
<folding />
|
369
369
|
</state>
|
370
370
|
</provider>
|
@@ -441,10 +441,18 @@
|
|
441
441
|
</state>
|
442
442
|
</provider>
|
443
443
|
</entry>
|
444
|
-
<entry file="file://$PROJECT_DIR$/piratebay_api.
|
444
|
+
<entry file="file://$PROJECT_DIR$/lib/piratebay_api.rb">
|
445
445
|
<provider selected="true" editor-type-id="text-editor">
|
446
446
|
<state vertical-scroll-proportion="0.0">
|
447
|
-
<caret line="
|
447
|
+
<caret line="26" column="12" selection-start-line="26" selection-start-column="12" selection-end-line="26" selection-end-column="12" />
|
448
|
+
<folding />
|
449
|
+
</state>
|
450
|
+
</provider>
|
451
|
+
</entry>
|
452
|
+
<entry file="file://$PROJECT_DIR$/lib/piratebay_api/categories.rb">
|
453
|
+
<provider selected="true" editor-type-id="text-editor">
|
454
|
+
<state vertical-scroll-proportion="0.0">
|
455
|
+
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
448
456
|
<folding />
|
449
457
|
</state>
|
450
458
|
</provider>
|
@@ -457,7 +465,7 @@
|
|
457
465
|
</state>
|
458
466
|
</provider>
|
459
467
|
</entry>
|
460
|
-
<entry file="file://$PROJECT_DIR$/lib/piratebay_api/
|
468
|
+
<entry file="file://$PROJECT_DIR$/lib/piratebay_api/pirate_bay.rb">
|
461
469
|
<provider selected="true" editor-type-id="text-editor">
|
462
470
|
<state vertical-scroll-proportion="0.0">
|
463
471
|
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
@@ -465,10 +473,50 @@
|
|
465
473
|
</state>
|
466
474
|
</provider>
|
467
475
|
</entry>
|
468
|
-
<entry file="file://$PROJECT_DIR$/lib/piratebay_api.rb">
|
476
|
+
<entry file="file://$PROJECT_DIR$/lib/piratebay_api/result.rb">
|
469
477
|
<provider selected="true" editor-type-id="text-editor">
|
470
478
|
<state vertical-scroll-proportion="0.0">
|
471
|
-
<caret line="
|
479
|
+
<caret line="5" column="17" selection-start-line="5" selection-start-column="8" selection-end-line="5" selection-end-column="17" />
|
480
|
+
<folding />
|
481
|
+
</state>
|
482
|
+
</provider>
|
483
|
+
</entry>
|
484
|
+
<entry file="file://$PROJECT_DIR$/lib/piratebay_api/result_set.rb">
|
485
|
+
<provider selected="true" editor-type-id="text-editor">
|
486
|
+
<state vertical-scroll-proportion="0.0">
|
487
|
+
<caret line="16" column="5" selection-start-line="16" selection-start-column="5" selection-end-line="16" selection-end-column="5" />
|
488
|
+
<folding />
|
489
|
+
</state>
|
490
|
+
</provider>
|
491
|
+
</entry>
|
492
|
+
<entry file="file://$PROJECT_DIR$/lib/piratebay_api/version.rb">
|
493
|
+
<provider selected="true" editor-type-id="text-editor">
|
494
|
+
<state vertical-scroll-proportion="0.0">
|
495
|
+
<caret line="3" column="0" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
|
496
|
+
<folding />
|
497
|
+
</state>
|
498
|
+
</provider>
|
499
|
+
</entry>
|
500
|
+
<entry file="file://$PROJECT_DIR$/piratebay_api.gemspec">
|
501
|
+
<provider selected="true" editor-type-id="text-editor">
|
502
|
+
<state vertical-scroll-proportion="0.0">
|
503
|
+
<caret line="8" column="31" selection-start-line="8" selection-start-column="31" selection-end-line="8" selection-end-column="31" />
|
504
|
+
<folding />
|
505
|
+
</state>
|
506
|
+
</provider>
|
507
|
+
</entry>
|
508
|
+
<entry file="file://$PROJECT_DIR$/lib/piratebay_api/details.rb">
|
509
|
+
<provider selected="true" editor-type-id="text-editor">
|
510
|
+
<state vertical-scroll-proportion="0.0">
|
511
|
+
<caret line="16" column="2" selection-start-line="16" selection-start-column="2" selection-end-line="16" selection-end-column="2" />
|
512
|
+
<folding />
|
513
|
+
</state>
|
514
|
+
</provider>
|
515
|
+
</entry>
|
516
|
+
<entry file="file://$PROJECT_DIR$/lib/piratebay_api/categories.rb">
|
517
|
+
<provider selected="true" editor-type-id="text-editor">
|
518
|
+
<state vertical-scroll-proportion="0.0">
|
519
|
+
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
472
520
|
<folding />
|
473
521
|
</state>
|
474
522
|
</provider>
|
@@ -489,18 +537,34 @@
|
|
489
537
|
</state>
|
490
538
|
</provider>
|
491
539
|
</entry>
|
540
|
+
<entry file="file://$PROJECT_DIR$/lib/piratebay_api.rb">
|
541
|
+
<provider selected="true" editor-type-id="text-editor">
|
542
|
+
<state vertical-scroll-proportion="0.0">
|
543
|
+
<caret line="20" column="22" selection-start-line="20" selection-start-column="22" selection-end-line="20" selection-end-column="22" />
|
544
|
+
<folding />
|
545
|
+
</state>
|
546
|
+
</provider>
|
547
|
+
</entry>
|
492
548
|
<entry file="file://$PROJECT_DIR$/lib/piratebay_api/pirate_bay.rb">
|
493
549
|
<provider selected="true" editor-type-id="text-editor">
|
494
550
|
<state vertical-scroll-proportion="0.0">
|
495
|
-
<caret line="
|
551
|
+
<caret line="22" column="0" selection-start-line="22" selection-start-column="0" selection-end-line="22" selection-end-column="0" />
|
552
|
+
<folding />
|
553
|
+
</state>
|
554
|
+
</provider>
|
555
|
+
</entry>
|
556
|
+
<entry file="file://$PROJECT_DIR$/piratebay_api.gemspec">
|
557
|
+
<provider selected="true" editor-type-id="text-editor">
|
558
|
+
<state vertical-scroll-proportion="0.0">
|
559
|
+
<caret line="8" column="31" selection-start-line="8" selection-start-column="31" selection-end-line="8" selection-end-column="31" />
|
496
560
|
<folding />
|
497
561
|
</state>
|
498
562
|
</provider>
|
499
563
|
</entry>
|
500
564
|
<entry file="file://$PROJECT_DIR$/lib/piratebay_api/version.rb">
|
501
565
|
<provider selected="true" editor-type-id="text-editor">
|
502
|
-
<state vertical-scroll-proportion="0.
|
503
|
-
<caret line="
|
566
|
+
<state vertical-scroll-proportion="0.027732464">
|
567
|
+
<caret line="1" column="16" selection-start-line="1" selection-start-column="16" selection-end-line="1" selection-end-column="16" />
|
504
568
|
<folding />
|
505
569
|
</state>
|
506
570
|
</provider>
|
@@ -1,12 +1,12 @@
|
|
1
1
|
module PirateBay
|
2
2
|
class Search
|
3
3
|
attr_accessor :search_string, :category_id, :page, :caching, :results
|
4
|
-
BASE_URL = 'https://thepiratebay.se'
|
5
4
|
|
6
|
-
def initialize(search_string, category=0)
|
5
|
+
def initialize(search_string, category=0, url='https://thepiratebay.se')
|
7
6
|
@search_string = URI.encode(search_string)
|
8
7
|
@category_id = PirateBay::Categories::IDS[category.upcase.strip.gsub(/S$/, '').to_sym] unless category == 0
|
9
8
|
@page = -1
|
9
|
+
@base_url = url
|
10
10
|
|
11
11
|
@results = PirateBay::ResultSet.new(self)
|
12
12
|
end
|
@@ -51,7 +51,7 @@ module PirateBay
|
|
51
51
|
def get_quality
|
52
52
|
execute
|
53
53
|
results = @results.map do |result|
|
54
|
-
url = "#{
|
54
|
+
url = "#{@base_url}/torrent/#{result.id}/"
|
55
55
|
html = open(url).read
|
56
56
|
p = PirateBay::Details.new html, :init
|
57
57
|
puts 'Fetching results'
|
@@ -75,7 +75,7 @@ module PirateBay
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def fetch_search_results
|
78
|
-
url = "#{
|
78
|
+
url = "#{@base_url}/search/#{search_string}/#{page}/7/#{category_id}" # highest seeded first
|
79
79
|
open(url, { 'User-Agent' => 'libcurl-agent/1.0' }).read
|
80
80
|
end
|
81
81
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: piratebay_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dani
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|