Lady 0.1.3 → 0.1.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 031064723a3ce98b0f101d450bea3e50baae838cc69bc75cd8cffbd4f1a99676
4
- data.tar.gz: 39c433642e35faec8035bf916e2a09efa627430f2da08a01f79f98ea8d97c500
3
+ metadata.gz: 706490bacc0a4ddb819345a32a683c11a46cf5ffe58288a9c2d146809586dcbf
4
+ data.tar.gz: 6322a82429db37132322edee4c257174bc1d5bafcf982410465e99e2ad60276d
5
5
  SHA512:
6
- metadata.gz: 0413cc80f7d22937684bd0726f3bf94a8cdf18b039c21b4e7a13e671e2b9c05a94d09e61b1b0f579b1a84c36e56cd934ca5dce8fc21a204c9ba769f5b6a3648e
7
- data.tar.gz: e7088fa37148ce3922115800ae8fbdf3d3c24ccb03c1efb152d8ecc561761001388523e51c036c31184e3cc3f06222179b8ad79733690e2d5688e533224a0a7b
6
+ metadata.gz: 4ba66e694a160b2f5ffbbd7fe6b5345106346867eebf881b15766ce198f8cbaba95f67315835dfd41d28a87219197a9cd2b97b31ff9de9c4024d3bf56d62d987
7
+ data.tar.gz: 2e89c63446eb4faac2ea5833fbe8d099250204cee44eef6a16bdbd725f5920159c82b0aec1a1c60e711e98f8f7b0530a28a5bf82508f790003cd05568fd8fe05
data/.idea/Lady.iml CHANGED
@@ -11,6 +11,7 @@
11
11
  </content>
12
12
  <orderEntry type="jdk" jdkName="RVM: ruby-2.7.2" jdkType="RUBY_SDK" />
13
13
  <orderEntry type="sourceFolder" forTests="false" />
14
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v2.3.7, RVM: ruby-2.7.2) [gem]" level="application" />
14
15
  <orderEntry type="library" scope="PROVIDED" name="claide (v1.1.0, RVM: ruby-2.7.2) [gem]" level="application" />
15
16
  <orderEntry type="library" scope="PROVIDED" name="colored2 (v3.1.2, RVM: ruby-2.7.2) [gem]" level="application" />
16
17
  <orderEntry type="library" scope="PROVIDED" name="domain_name (v0.6.20231109, RVM: ruby-2.7.2) [gem]" level="application" />
@@ -24,34 +25,7 @@
24
25
  </component>
25
26
  <component name="RakeTasksCache">
26
27
  <option name="myRootTask">
27
- <RakeTaskImpl id="rake">
28
- <subtasks>
29
- <RakeTaskImpl description="Build Lady-0.1.0.gem into the pkg directory" fullCommand="build" id="build" />
30
- <RakeTaskImpl id="build">
31
- <subtasks>
32
- <RakeTaskImpl description="Generate SHA512 checksum if Lady-0.1.0.gem into the checksums directory" fullCommand="build:checksum" id="checksum" />
33
- </subtasks>
34
- </RakeTaskImpl>
35
- <RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
36
- <RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
37
- <RakeTaskImpl description="Build and install Lady-0.1.0.gem into system gems" fullCommand="install" id="install" />
38
- <RakeTaskImpl id="install">
39
- <subtasks>
40
- <RakeTaskImpl description="Build and install Lady-0.1.0.gem into system gems without network access" fullCommand="install:local" id="local" />
41
- </subtasks>
42
- </RakeTaskImpl>
43
- <RakeTaskImpl description="Create tag v0.1.0 and build and push Lady-0.1.0.gem to rubygems.org" fullCommand="release[remote]" id="release[remote]" />
44
- <RakeTaskImpl description="" fullCommand="default" id="default" />
45
- <RakeTaskImpl description="" fullCommand="release" id="release" />
46
- <RakeTaskImpl id="release">
47
- <subtasks>
48
- <RakeTaskImpl description="" fullCommand="release:guard_clean" id="guard_clean" />
49
- <RakeTaskImpl description="" fullCommand="release:rubygem_push" id="rubygem_push" />
50
- <RakeTaskImpl description="" fullCommand="release:source_control_push" id="source_control_push" />
51
- </subtasks>
52
- </RakeTaskImpl>
53
- </subtasks>
54
- </RakeTaskImpl>
28
+ <RakeTaskImpl id="rake" />
55
29
  </option>
56
30
  </component>
57
31
  </module>
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- Lady (0.1.3)
4
+ Lady (0.1.6)
5
5
  claide (~> 1.1.0)
6
6
  colored2 (~> 3.1.2)
7
7
  rest-client (~> 2.1.0)
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # Lady
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/Lady`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ 通过抖音分享链接下载视频
6
4
 
7
5
  ## Installation
8
6
 
@@ -22,22 +20,19 @@ Or install it yourself as:
22
20
 
23
21
  ## Usage
24
22
 
25
- TODO: Write usage instructions here
26
-
27
- ## Development
28
-
29
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
23
+ ```ruby
24
+ $ lady download "分享的文本"
25
+ ```
30
26
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
27
+ eg:
32
28
 
33
- ## Contributing
29
+ ```ruby
30
+ lady download "7.41 R@k.pD 11/23 sEH:/ 复制打开抖音,看看【大飞起来了的作品】Mreey Christmas 🎄 # 圣诞节 https://v.douyin.com/i8XdNDTV/"
31
+ ```
34
32
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/Lady. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/Lady/blob/master/CODE_OF_CONDUCT.md).
33
+ 默认会把视频保存到用户桌面
36
34
 
37
35
  ## License
38
36
 
39
37
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
38
 
41
- ## Code of Conduct
42
-
43
- Everyone interacting in the Lady project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/Lady/blob/master/CODE_OF_CONDUCT.md).
data/exe/lady CHANGED
@@ -4,4 +4,5 @@
4
4
  # 所以,当修改过lib文件下的代码,都需要重新执行
5
5
  # gem build *.gemspec 和 gem install *.gem 命令
6
6
  require 'Lady'
7
- Lady::Command.run(ARGV)
7
+ Lady::Command.run(ARGV)
8
+ # Lady::Command.run(['download', '5.89 c@N.JI WMJ:/ 06/12 复制打开抖音,看看【朦胧521的作品】 https://v.douyin.com/i8XmEK8n/'])
@@ -28,14 +28,17 @@ module Lady
28
28
  # 2.解析下载链接
29
29
  response = RestClient.get(ANALYSE_PREFIX + urls[0] , HEADERS)
30
30
  json_obj = JSON.parse(response)
31
+ nickname = json_obj['nickname'] ||= 'temp'
32
+ #puts json_obj
31
33
  video_url = json_obj['video']
32
34
  if video_url.length > 0
33
35
  # 3.下载
34
36
  video_data = RestClient.get(video_url)
35
- puts "下载完成".green
37
+ mkdir = FileUtils.mkdir_p('~/Desktop/video')[0]
36
38
  # 4.写入本地
37
- file = File.open('/Users/mac/Desktop/video.mp4', 'a+')
39
+ file = File.open("#{mkdir}/#{nickname}.mp4", 'a+')
38
40
  if file
41
+ puts "保存成功!".green
39
42
  file.syswrite(video_data)
40
43
  end
41
44
  end
@@ -51,12 +54,12 @@ module Lady
51
54
  urls
52
55
  end
53
56
 
54
- # def validate!
55
- # super
56
- # unless @link
57
- # help! "link is necessary!"
58
- # end
59
- # end
57
+ def validate!
58
+ super
59
+ unless @link
60
+ help! "link is necessary!"
61
+ end
62
+ end
60
63
 
61
64
  end
62
65
 
data/lib/Lady/command.rb CHANGED
@@ -2,6 +2,7 @@ require 'claide'
2
2
  require 'colored2'
3
3
  require 'rest-client'
4
4
  require 'json'
5
+ require 'fileutils'
5
6
 
6
7
  module Lady
7
8
 
@@ -14,7 +15,7 @@ module Lady
14
15
  # 和可执行程序同名
15
16
  self.command = 'lady'
16
17
  self.version = VERSION
17
- self.description = "通过抖音分享链接下载小姐姐视频"
18
+ self.description = "通过抖音分享链接下载小姐姐视频(支持Web和App)"
18
19
 
19
20
  def self.options
20
21
  []
data/lib/Lady/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lady
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.7"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Lady
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - HZHCoder1990
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-25 00:00:00.000000000 Z
11
+ date: 2024-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client