VictoriaFreSh 2024.3.24 → 2024.9.16
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/lib/victoriafresh.rb +42 -35
- data/victoriafresh.example.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1b4715d21e2d74203453ae9563d9dcfc25d5824ce9944b9272d3090197e5de8
|
4
|
+
data.tar.gz: 00322e417b47835c4d5fb516ad2f1e6798dac2639f7f621e80b324904a28519d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aab347f0afeb0768e222d059e656f1232cbc4dc9b153177e165913fa6a0c92cb0343807f4c42358808aa8165d269f70abe057898fde38b0fb9ad2856278da860
|
7
|
+
data.tar.gz: bed7c8c806eb34743710e07eb37267c4caf979f900fe4716ee39a48a3f39879661c5bb98bf4bfcf6607c327b5c55822f1aee1660b92e141679fdd5b62796c7bb
|
data/lib/victoriafresh.rb
CHANGED
@@ -377,6 +377,9 @@ class VictoriaFresh
|
|
377
377
|
current_paragraph << line.strip # 记录一行
|
378
378
|
end # if line.strip.empty? # 空行
|
379
379
|
end # File&.foreach(datastore).with_index do |line, _line_num|
|
380
|
+
rescue Errno::EACCES => e
|
381
|
+
# 处理权限不足的情况
|
382
|
+
puts e.message
|
380
383
|
rescue Errno::ENOENT
|
381
384
|
end
|
382
385
|
end # if @ignoreFileName # 设置了忽略列表
|
@@ -496,45 +499,49 @@ class VictoriaFresh
|
|
496
499
|
|
497
500
|
ignoreFileList=readIgnoreFileList(directoryPathName) # 读取要忽略的文件名列表。
|
498
501
|
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
if (ignoreFileList.include?(subFilebaseName)) # 是要忽略的文件
|
504
|
-
puts "ignore #{subFile}" # 报告,忽略。
|
505
|
-
elsif (timestampTooEarly(subFile)) # 文件时间过早。
|
506
|
-
puts "ignore #{subFile} early file" # 报告,忽略。
|
507
|
-
else # 不忽略
|
508
|
-
realPath=subFile.expand_path #获取绝对路径。
|
509
|
-
|
510
|
-
packagedSubFile,subFileContent=checkOnce(realPath,subFileStartIndex, layer+1) #打包这个子文件。
|
511
|
-
|
512
|
-
packagedFile['sub_files'] << packagedSubFile #加入到子文件列表中。
|
513
|
-
|
514
|
-
assessDiskFlush(layer) #考虑是否要向磁盘先输出内容
|
515
|
-
|
516
|
-
subFileStartIndex+=packagedSubFile['file_length'] #记录打包的子文件的长度,更新下一个要打包的子文件的起始位置。
|
502
|
+
begin # try to list files and directories.
|
503
|
+
directoryPathName.each_child do |subFile| #一个个文件地处理。
|
504
|
+
begin
|
505
|
+
subFilebaseName=subFile.basename.to_s #基本文件名。
|
517
506
|
|
518
|
-
|
507
|
+
if (ignoreFileList.include?(subFilebaseName)) # 是要忽略的文件
|
508
|
+
puts "ignore #{subFile}" # 报告,忽略。
|
509
|
+
elsif (timestampTooEarly(subFile)) # 文件时间过早。
|
510
|
+
puts "ignore #{subFile} early file" # 报告,忽略。
|
511
|
+
else # 不忽略
|
512
|
+
realPath=subFile.expand_path #获取绝对路径。
|
513
|
+
|
514
|
+
packagedSubFile,subFileContent=checkOnce(realPath,subFileStartIndex, layer+1) #打包这个子文件。
|
515
|
+
|
516
|
+
packagedFile['sub_files'] << packagedSubFile #加入到子文件列表中。
|
517
|
+
|
518
|
+
assessDiskFlush(layer) #考虑是否要向磁盘先输出内容
|
519
|
+
|
520
|
+
subFileStartIndex+=packagedSubFile['file_length'] #记录打包的子文件的长度,更新下一个要打包的子文件的起始位置。
|
521
|
+
|
522
|
+
packagedFile['file_length']+=packagedSubFile['file_length'] #随着子文件的打包而更新本目录的总长度。
|
523
|
+
end
|
524
|
+
rescue Errno::EMFILE # too many open Files in process
|
525
|
+
puts "Rescued by Errno::EMFILE statement. #{subFile}" #报告错误
|
519
526
|
end
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
527
|
+
end #directoryPathName.each_child do |subFile| #一个个文件地处理。
|
528
|
+
rescue Errno::EACCES => e
|
529
|
+
# 处理权限不足的情况
|
530
|
+
puts e.message
|
531
|
+
end # begin # try to list files and directories.
|
524
532
|
end #if (isFile) #是文件,不用再列出其子文件了。
|
525
533
|
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
return packagedFile, contentToResult #返回打包之后的对象。和文件内容字节数组。
|
534
|
+
contentToResult="" #要返回的内容
|
535
|
+
|
536
|
+
if (layer==0) #是最外层
|
537
|
+
assessDiskFlush(layer, true) #考虑是否要向磁盘先输出内容
|
538
|
+
|
539
|
+
if (@diskFlush) #要向磁盘写入缓存内容
|
540
|
+
else #不向磁盘写入缓存内容
|
541
|
+
contentToResult=@contentPartArray.join #重新合并成字符串
|
542
|
+
end #if (@diskFlush) #要向磁盘写入缓存内容
|
543
|
+
end #if (layer==0) #是最外层
|
544
|
+
return packagedFile, contentToResult #返回打包之后的对象。和文件内容字节数组。
|
538
545
|
end #def downloadOne #下载一个视频。
|
539
546
|
end
|
540
547
|
|
data/victoriafresh.example.rb
CHANGED
@@ -12,8 +12,8 @@ else #指定了命令行参数。
|
|
12
12
|
# $clipDownloader.diskFlush=false # Do not write disk cache.
|
13
13
|
$clipDownloader.diskFlush=true #write disk cache.
|
14
14
|
|
15
|
-
|
16
|
-
$clipDownloader.diskMultiFile = false # Write single file
|
15
|
+
$clipDownloader.diskMultiFile = true # Write multiple files
|
16
|
+
# $clipDownloader.diskMultiFile = false # Write single file
|
17
17
|
|
18
18
|
$clipDownloader.diskFileName='victoriafreshdata' #磁盘文件名前缀
|
19
19
|
$clipDownloader.diskFlushSize=32*1024*1024 #磁盘文件大小
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: VictoriaFreSh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2024.
|
4
|
+
version: 2024.9.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hxcan Cai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hx_cbor
|
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
65
|
- !ruby/object:Gem::Version
|
66
66
|
version: '0'
|
67
67
|
requirements: []
|
68
|
-
rubygems_version: 3.
|
68
|
+
rubygems_version: 3.5.11
|
69
69
|
signing_key:
|
70
70
|
specification_version: 4
|
71
71
|
summary: VictoriaFreSh
|