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 +4 -4
- data/.idea/Lady.iml +2 -28
- data/Gemfile.lock +1 -1
- data/README.md +9 -14
- data/exe/lady +2 -1
- data/lib/Lady/command/download.rb +11 -8
- data/lib/Lady/command.rb +2 -1
- data/lib/Lady/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 706490bacc0a4ddb819345a32a683c11a46cf5ffe58288a9c2d146809586dcbf
|
4
|
+
data.tar.gz: 6322a82429db37132322edee4c257174bc1d5bafcf982410465e99e2ad60276d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# Lady
|
2
2
|
|
3
|
-
|
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
|
-
|
26
|
-
|
27
|
-
|
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
|
-
|
27
|
+
eg:
|
32
28
|
|
33
|
-
|
29
|
+
```ruby
|
30
|
+
lady download "7.41 R@k.pD 11/23 sEH:/ 复制打开抖音,看看【大飞起来了的作品】Mreey Christmas 🎄 # 圣诞节 https://v.douyin.com/i8XdNDTV/"
|
31
|
+
```
|
34
32
|
|
35
|
-
|
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
@@ -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
|
-
|
37
|
+
mkdir = FileUtils.mkdir_p('~/Desktop/video')[0]
|
36
38
|
# 4.写入本地
|
37
|
-
file = File.open(
|
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
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
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
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.
|
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:
|
11
|
+
date: 2024-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|