manga_downloader 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ pkg
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ # A sample Gemfile
2
+ source "http://rubygems.org"
3
+
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,14 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ manga_downloader (0.0.alpha)
5
+
6
+ GEM
7
+ remote: http://rubygems.org/
8
+ specs:
9
+
10
+ PLATFORMS
11
+ ruby
12
+
13
+ DEPENDENCIES
14
+ manga_downloader!
data/README.rdoc ADDED
File without changes
data/Rakefile ADDED
@@ -0,0 +1,3 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env ruby
2
+
3
+
4
+ require 'net/http'
5
+ require 'uri'
6
+ require 'pp'
7
+
8
+
9
+ # http://www.cococomic.com/manhua/5338/43438/?v=3*s=7
10
+ #
11
+ #
12
+ #
13
+ servers = ["http://91.cococomic.com/dm01/", "http://91.cococomic.com/dm02/", "http://72.cococomic.com/dm03/", "http://173.comicservers.com:88/dm04/", "http://91.cococomic.com/dm05/", "http://91.cococomic.com/dm06/", "http://72.cococomic.com/dm07/", "http://91.cococomic.com/dm08/", "http://72.cococomic.com/dm09/", "http://91.cococomic.com/dm10/", "http://91.cococomic.com/dm11/", "http://91.cococomic.com/dm12/"]
14
+ if ARGV.size == 0
15
+ puts "Usage: #{$0} URL"
16
+ exit 2
17
+ end
18
+ url = ARGV.shift
19
+ if url =~ /s=(\d+)$/
20
+ server = servers[$1.to_i-1]
21
+ end
22
+ uri = URI.parse(url)
23
+
24
+ body = Net::HTTP.get(uri)
25
+ urls = nil
26
+ if body =~ /var PicListUrl = "([^"]+)"/
27
+ urls = $1.split('|').map {|x| server + x}
28
+ end
29
+
30
+ unless urls.nil?
31
+ urls.each do |image_url|
32
+ #pp image_url
33
+ `wget --referer="#{url}" #{image_url}`
34
+ end
35
+ end
36
+
37
+
38
+
File without changes
@@ -0,0 +1,3 @@
1
+ module MangaDownloader
2
+ VERSION = '0.0.1'
3
+ end
@@ -0,0 +1,23 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path("../lib/manga_downloader/version", __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "manga_downloader"
6
+ s.version = MangaDownloader::VERSION
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = ['LI Daobing']
9
+ s.email = ['lidaobing@gmail.com']
10
+ s.homepage = "https://github.com/lidaobing/manga_downloader"
11
+ s.summary = "Manga Downloader"
12
+ s.description = "can download manga"
13
+ s.rdoc_options << '--main' << 'README.rdoc' <<
14
+ '--charset' << 'UTF-8'
15
+ s.extra_rdoc_files = ['README.rdoc']
16
+
17
+ s.required_rubygems_version = ">= 1.3.6"
18
+ s.rubyforge_project = "manga_downloader"
19
+
20
+ s.files = `git ls-files`.split("\n")
21
+ s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
22
+ s.require_path = 'lib'
23
+ end
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: manga_downloader
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - LI Daobing
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-01-15 00:00:00 +08:00
19
+ default_executable:
20
+ dependencies: []
21
+
22
+ description: can download manga
23
+ email:
24
+ - lidaobing@gmail.com
25
+ executables:
26
+ - manga_downloader
27
+ extensions: []
28
+
29
+ extra_rdoc_files:
30
+ - README.rdoc
31
+ files:
32
+ - .gitignore
33
+ - Gemfile
34
+ - Gemfile.lock
35
+ - README.rdoc
36
+ - Rakefile
37
+ - bin/manga_downloader
38
+ - lib/manga_downloader.rb
39
+ - lib/manga_downloader/version.rb
40
+ - manga_downloader.gemspec
41
+ has_rdoc: true
42
+ homepage: https://github.com/lidaobing/manga_downloader
43
+ licenses: []
44
+
45
+ post_install_message:
46
+ rdoc_options:
47
+ - --main
48
+ - README.rdoc
49
+ - --charset
50
+ - UTF-8
51
+ require_paths:
52
+ - lib
53
+ required_ruby_version: !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ hash: 3
59
+ segments:
60
+ - 0
61
+ version: "0"
62
+ required_rubygems_version: !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ hash: 23
68
+ segments:
69
+ - 1
70
+ - 3
71
+ - 6
72
+ version: 1.3.6
73
+ requirements: []
74
+
75
+ rubyforge_project: manga_downloader
76
+ rubygems_version: 1.4.1
77
+ signing_key:
78
+ specification_version: 3
79
+ summary: Manga Downloader
80
+ test_files: []
81
+