apple-tv-converter 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/Gemfile +2 -2
- data/Gemfile.lock +1 -1
- data/gems/streamio-ffmpeg/lib/ffmpeg/movie.rb +2 -9
- data/gems/streamio-ffmpeg/lib/ffmpeg/transcoder.rb +2 -2
- data/lib/apple_tv_converter/apple_tv_converter.sublime-workspace +386 -143
- data/lib/apple_tv_converter/media_converter_adapter.rb +2 -2
- data/lib/apple_tv_converter/media_converter_mac_adapter.rb +14 -5
- data/lib/apple_tv_converter/subtitles_fetcher/opensubtitles.rb +2 -3
- data/lib/apple_tv_converter/version.rb +1 -1
- metadata +2 -2
data/CHANGELOG
CHANGED
data/Gemfile
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
source :rubygems
|
1
|
+
source RUBY_VERSION =~ /^1\.8/ ? 'https://rubygems.org' : :rubygems
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
gem 'streamio-ffmpeg', :path => File.expand_path(File.join(File.dirname(__FILE__)
|
5
|
+
gem 'streamio-ffmpeg', :path => File.expand_path(File.join(File.dirname(__FILE__), 'gems', 'streamio-ffmpeg'))
|
6
6
|
gem 'language_list'
|
7
7
|
gem 'imdb'
|
8
8
|
|
data/Gemfile.lock
CHANGED
@@ -106,7 +106,7 @@ module FFMPEG
|
|
106
106
|
end
|
107
107
|
|
108
108
|
def screenshot(output_file, options = EncodingOptions.new, transcoder_options = {}, &block)
|
109
|
-
Transcoder.new(self, output_file, options.merge(screenshot
|
109
|
+
Transcoder.new(self, output_file, options.merge(:screenshot => true), transcoder_options).run &block
|
110
110
|
end
|
111
111
|
|
112
112
|
protected
|
@@ -138,14 +138,7 @@ module FFMPEG
|
|
138
138
|
stream.send(:input_number=, input_number)
|
139
139
|
stream.send(:stream_number=, stream_number)
|
140
140
|
if language
|
141
|
-
|
142
|
-
if language_code
|
143
|
-
stream.send(:language=, language_code.to_a.first)
|
144
|
-
else
|
145
|
-
stream.send(:language=, language)
|
146
|
-
end
|
147
|
-
# else
|
148
|
-
# stream.send(:language=, :unk)
|
141
|
+
stream.send(:language=, language.gsub(/.*?\[/, '').gsub(/\].*?/, ''))
|
149
142
|
end
|
150
143
|
stream.send(:type=, type.downcase.gsub(/s$/, '').to_sym)
|
151
144
|
|
@@ -57,15 +57,15 @@ module FFMPEG
|
|
57
57
|
end
|
58
58
|
progress = time / @movie.duration
|
59
59
|
yield(progress) if block_given?
|
60
|
+
STDOUT.flush
|
60
61
|
end
|
61
62
|
end
|
62
63
|
|
63
|
-
if @@timeout
|
64
|
+
if !(RUBY_VERSION =~ /^1\.8/) && @@timeout
|
64
65
|
stderr.each_with_timeout(wait_thr.pid, @@timeout, 'size=', &next_line)
|
65
66
|
else
|
66
67
|
stderr.each('size=', &next_line)
|
67
68
|
end
|
68
|
-
|
69
69
|
rescue Timeout::Error => e
|
70
70
|
FFMPEG.logger.error "Process hung...\nCommand\n#{command}\nOutput\n#{output}\n"
|
71
71
|
raise Error, "Process hung. Full output: #{output}"
|
@@ -3,6 +3,14 @@
|
|
3
3
|
{
|
4
4
|
"selected_items":
|
5
5
|
[
|
6
|
+
[
|
7
|
+
"std",
|
8
|
+
"stdout"
|
9
|
+
],
|
10
|
+
[
|
11
|
+
"RUB",
|
12
|
+
"RUBY_VERSION"
|
13
|
+
],
|
6
14
|
[
|
7
15
|
"subt",
|
8
16
|
"subtitles"
|
@@ -506,14 +514,6 @@
|
|
506
514
|
[
|
507
515
|
"main",
|
508
516
|
"main_address"
|
509
|
-
],
|
510
|
-
[
|
511
|
-
"docume",
|
512
|
-
"document_series"
|
513
|
-
],
|
514
|
-
[
|
515
|
-
"be",
|
516
|
-
"belongs_to"
|
517
517
|
]
|
518
518
|
]
|
519
519
|
},
|
@@ -523,7 +523,7 @@
|
|
523
523
|
"file": "subtitles_fetcher/opensubtitles.rb",
|
524
524
|
"settings":
|
525
525
|
{
|
526
|
-
"buffer_size":
|
526
|
+
"buffer_size": 7535,
|
527
527
|
"line_ending": "Unix"
|
528
528
|
}
|
529
529
|
},
|
@@ -539,49 +539,71 @@
|
|
539
539
|
"file": "media_converter_adapter.rb",
|
540
540
|
"settings":
|
541
541
|
{
|
542
|
-
"buffer_size":
|
542
|
+
"buffer_size": 8156,
|
543
543
|
"line_ending": "Unix"
|
544
544
|
}
|
545
545
|
},
|
546
546
|
{
|
547
|
-
"
|
547
|
+
"file": "/Users/pedro/development/personal/apple-tv-converter/gems/streamio-ffmpeg/lib/ffmpeg/movie.rb",
|
548
548
|
"settings":
|
549
549
|
{
|
550
|
-
"buffer_size":
|
551
|
-
"line_ending": "Unix"
|
552
|
-
"name": "Find Results",
|
553
|
-
"scratch": true
|
550
|
+
"buffer_size": 6598,
|
551
|
+
"line_ending": "Unix"
|
554
552
|
}
|
555
553
|
},
|
556
554
|
{
|
557
|
-
"file": "
|
555
|
+
"file": "/Users/pedro/development/personal/apple-tv-converter/apple_tv_converter.gemspec",
|
558
556
|
"settings":
|
559
557
|
{
|
560
|
-
"buffer_size":
|
558
|
+
"buffer_size": 996,
|
561
559
|
"line_ending": "Unix"
|
562
560
|
}
|
563
561
|
},
|
564
562
|
{
|
565
|
-
"file": "
|
563
|
+
"file": "command_line.rb",
|
566
564
|
"settings":
|
567
565
|
{
|
568
|
-
"buffer_size":
|
566
|
+
"buffer_size": 5397,
|
569
567
|
"line_ending": "Unix"
|
570
568
|
}
|
571
569
|
},
|
572
570
|
{
|
573
|
-
"file": "/Users/pedro/development/personal/apple-tv-converter/apple_tv_converter.
|
571
|
+
"file": "/Users/pedro/development/personal/apple-tv-converter/lib/apple_tv_converter.rb",
|
574
572
|
"settings":
|
575
573
|
{
|
576
|
-
"buffer_size":
|
574
|
+
"buffer_size": 3944,
|
577
575
|
"line_ending": "Unix"
|
578
576
|
}
|
579
577
|
},
|
580
578
|
{
|
581
|
-
"file": "
|
579
|
+
"file": "/Users/pedro/development/personal/apple-tv-converter/Gemfile",
|
582
580
|
"settings":
|
583
581
|
{
|
584
|
-
"buffer_size":
|
582
|
+
"buffer_size": 268,
|
583
|
+
"line_ending": "Unix"
|
584
|
+
}
|
585
|
+
},
|
586
|
+
{
|
587
|
+
"file": "media_converter_mac_adapter.rb",
|
588
|
+
"settings":
|
589
|
+
{
|
590
|
+
"buffer_size": 5117,
|
591
|
+
"line_ending": "Unix"
|
592
|
+
}
|
593
|
+
},
|
594
|
+
{
|
595
|
+
"file": "/Users/pedro/development/personal/apple-tv-converter/gems/streamio-ffmpeg/lib/ffmpeg/transcoder.rb",
|
596
|
+
"settings":
|
597
|
+
{
|
598
|
+
"buffer_size": 4116,
|
599
|
+
"line_ending": "Unix"
|
600
|
+
}
|
601
|
+
},
|
602
|
+
{
|
603
|
+
"file": "/Users/pedro/development/personal/apple-tv-converter/README.md",
|
604
|
+
"settings":
|
605
|
+
{
|
606
|
+
"buffer_size": 3632,
|
585
607
|
"line_ending": "Unix"
|
586
608
|
}
|
587
609
|
}
|
@@ -750,8 +772,12 @@
|
|
750
772
|
},
|
751
773
|
"file_history":
|
752
774
|
[
|
753
|
-
"/Users/pedro/development/personal/apple-tv-converter/README.md",
|
754
775
|
"/Users/pedro/development/personal/apple-tv-converter/CHANGELOG",
|
776
|
+
"/Users/pedro/development/personal/apple-tv-converter/lib/apple_tv_converter/version.rb",
|
777
|
+
"/Users/pedro/development/personal/apple-tv-converter/gems/streamio-ffmpeg/lib/streamio-ffmpeg.rb",
|
778
|
+
"/Users/pedro/development/personal/apple-tv-converter/gems/streamio-ffmpeg/streamio-ffmpeg.gemspec",
|
779
|
+
"/Users/pedro/development/personal/apple-tv-converter/gems/streamio-ffmpeg/Gemfile",
|
780
|
+
"/Users/pedro/development/personal/apple-tv-converter/README.md",
|
755
781
|
"/Users/pedro/development/personal/apple-tv-converter/subtitle_1953515823.gzip",
|
756
782
|
"/Users/pedro/development/personal/apple-tv-converter/Rakefile",
|
757
783
|
"/Users/pedro/development/personal/apple-tv-converter/lib/apple_tv_converter/movie_hasher.rb",
|
@@ -762,7 +788,6 @@
|
|
762
788
|
"/Users/pedro/development/personal/apple-tv-converter/lib/apple_tv_converter/media_converter_mac_adapter.rb",
|
763
789
|
"/Users/pedro/development/personal/apple-tv-converter/lib/apple_tv_converter.rb",
|
764
790
|
"/Users/pedro/development/personal/apple-tv-converter/lib/apple_tv_converter/media_converter_adapter.rb",
|
765
|
-
"/Users/pedro/development/personal/apple-tv-converter/gems/streamio-ffmpeg/lib/streamio-ffmpeg.rb",
|
766
791
|
"/Users/pedro/development/personal/apple-tv-converter/gems/streamio-ffmpeg/lib/ffmpeg/movie.rb",
|
767
792
|
"/Users/pedro/development/personal/apple-tv-converter/apple_tv_converter.gemspec",
|
768
793
|
"/Users/pedro/development/personal/apple-tv-converter/Gemfile",
|
@@ -771,7 +796,6 @@
|
|
771
796
|
"/Users/pedro/development/personal/apple-tv-converter/spec/apple_tv_converter_spec.rb",
|
772
797
|
"/Users/pedro/development/personal/apple-tv-converter/gems/streamio-ffmpeg/spec/streamio-ffmpeg_spec.rb",
|
773
798
|
"/Users/pedro/development/personal/apple-tv-converter/lib/apple_tv_converter/media_converter.rb",
|
774
|
-
"/Users/pedro/development/personal/apple-tv-converter/lib/apple_tv_converter/version.rb",
|
775
799
|
"/Users/pedro/development/personal/apple-tv-converter/bin/apple-tv-converter",
|
776
800
|
"/Users/pedro/Library/Application Support/Sublime Text 2/Packages/Markdown Preview/sample.md",
|
777
801
|
"/Users/pedro/Library/Application Support/Sublime Text 2/Packages/SmartMarkdown/SmartMarkdown.sublime-settings",
|
@@ -875,9 +899,7 @@
|
|
875
899
|
"/Users/pedro/development/toconline/app/controllers/billing/documents_controller.rb",
|
876
900
|
"/Users/pedro/development/toconline/app/controllers/billing/items_controller.rb",
|
877
901
|
"/Users/pedro/development/toconline/app/controllers/billing/gadgets_controller.rb",
|
878
|
-
"/Users/pedro/development/toconline/app/views/my_company/companies/summary.html.erb"
|
879
|
-
"/Users/pedro/development/toconline/db/migrate/20121119141256_create_banks.rb",
|
880
|
-
"/Users/pedro/development/toconline/app/views/billing/invoices/index.html.erb"
|
902
|
+
"/Users/pedro/development/toconline/app/views/my_company/companies/summary.html.erb"
|
881
903
|
],
|
882
904
|
"find":
|
883
905
|
{
|
@@ -902,6 +924,10 @@
|
|
902
924
|
"case_sensitive": false,
|
903
925
|
"find_history":
|
904
926
|
[
|
927
|
+
", st",
|
928
|
+
"Shellwords.escape(",
|
929
|
+
"round(",
|
930
|
+
"sequence:",
|
905
931
|
"@@subtitles",
|
906
932
|
"Opensubtitles",
|
907
933
|
"opensubtitles",
|
@@ -1025,11 +1051,7 @@
|
|
1025
1051
|
"audio",
|
1026
1052
|
"AppleTvConverter.logger.debug",
|
1027
1053
|
"||=",
|
1028
|
-
"[:custom]"
|
1029
|
-
"7",
|
1030
|
-
"←[0m",
|
1031
|
-
"←[0m←[0;33m",
|
1032
|
-
"←[0;37m"
|
1054
|
+
"[:custom]"
|
1033
1055
|
],
|
1034
1056
|
"highlight": true,
|
1035
1057
|
"in_selection": false,
|
@@ -1054,7 +1076,7 @@
|
|
1054
1076
|
"groups":
|
1055
1077
|
[
|
1056
1078
|
{
|
1057
|
-
"selected":
|
1079
|
+
"selected": 10,
|
1058
1080
|
"sheets":
|
1059
1081
|
[
|
1060
1082
|
{
|
@@ -1062,15 +1084,15 @@
|
|
1062
1084
|
"file": "subtitles_fetcher/opensubtitles.rb",
|
1063
1085
|
"settings":
|
1064
1086
|
{
|
1065
|
-
"buffer_size":
|
1087
|
+
"buffer_size": 7535,
|
1066
1088
|
"regions":
|
1067
1089
|
{
|
1068
1090
|
},
|
1069
1091
|
"selection":
|
1070
1092
|
[
|
1071
1093
|
[
|
1072
|
-
|
1073
|
-
|
1094
|
+
3568,
|
1095
|
+
3568
|
1074
1096
|
]
|
1075
1097
|
],
|
1076
1098
|
"settings":
|
@@ -1127,7 +1149,7 @@
|
|
1127
1149
|
"translate_tabs_to_spaces": true
|
1128
1150
|
},
|
1129
1151
|
"translation.x": 0.0,
|
1130
|
-
"translation.y":
|
1152
|
+
"translation.y": 2139.0,
|
1131
1153
|
"zoom_level": 1.0
|
1132
1154
|
},
|
1133
1155
|
"type": "text"
|
@@ -1212,15 +1234,15 @@
|
|
1212
1234
|
"file": "media_converter_adapter.rb",
|
1213
1235
|
"settings":
|
1214
1236
|
{
|
1215
|
-
"buffer_size":
|
1237
|
+
"buffer_size": 8156,
|
1216
1238
|
"regions":
|
1217
1239
|
{
|
1218
1240
|
},
|
1219
1241
|
"selection":
|
1220
1242
|
[
|
1221
1243
|
[
|
1222
|
-
|
1223
|
-
|
1244
|
+
5098,
|
1245
|
+
5098
|
1224
1246
|
]
|
1225
1247
|
],
|
1226
1248
|
"settings":
|
@@ -1277,40 +1299,25 @@
|
|
1277
1299
|
"translate_tabs_to_spaces": true
|
1278
1300
|
},
|
1279
1301
|
"translation.x": 0.0,
|
1280
|
-
"translation.y":
|
1302
|
+
"translation.y": 1531.0,
|
1281
1303
|
"zoom_level": 1.0
|
1282
1304
|
},
|
1283
1305
|
"type": "text"
|
1284
1306
|
},
|
1285
1307
|
{
|
1286
1308
|
"buffer": 3,
|
1309
|
+
"file": "/Users/pedro/development/personal/apple-tv-converter/gems/streamio-ffmpeg/lib/ffmpeg/movie.rb",
|
1287
1310
|
"settings":
|
1288
1311
|
{
|
1289
|
-
"buffer_size":
|
1312
|
+
"buffer_size": 6598,
|
1290
1313
|
"regions":
|
1291
1314
|
{
|
1292
|
-
"match":
|
1293
|
-
{
|
1294
|
-
"flags": 112,
|
1295
|
-
"regions":
|
1296
|
-
[
|
1297
|
-
[
|
1298
|
-
281,
|
1299
|
-
294
|
1300
|
-
],
|
1301
|
-
[
|
1302
|
-
529,
|
1303
|
-
542
|
1304
|
-
]
|
1305
|
-
],
|
1306
|
-
"scope": ""
|
1307
|
-
}
|
1308
1315
|
},
|
1309
1316
|
"selection":
|
1310
1317
|
[
|
1311
1318
|
[
|
1312
|
-
|
1313
|
-
|
1319
|
+
4454,
|
1320
|
+
4454
|
1314
1321
|
]
|
1315
1322
|
],
|
1316
1323
|
"settings":
|
@@ -1359,36 +1366,33 @@
|
|
1359
1366
|
"bh_single_quote_open",
|
1360
1367
|
"bh_single_quote_close"
|
1361
1368
|
],
|
1362
|
-
"
|
1369
|
+
"encoding_helper_confidence": 1.0,
|
1370
|
+
"encoding_helper_encoding": "UTF-8",
|
1363
1371
|
"encoding_helper_encoding_sublime": "UTF-8",
|
1364
|
-
"
|
1365
|
-
"
|
1366
|
-
"
|
1367
|
-
"result_line_regex": "^ +([0-9]+):",
|
1368
|
-
"scroll_past_end": true,
|
1369
|
-
"syntax": "Packages/Default/Find Results.hidden-tmLanguage",
|
1370
|
-
"translate_tabs_to_spaces": false
|
1372
|
+
"syntax": "Packages/Ruby/Ruby.tmLanguage",
|
1373
|
+
"tab_size": 2,
|
1374
|
+
"translate_tabs_to_spaces": true
|
1371
1375
|
},
|
1372
1376
|
"translation.x": 0.0,
|
1373
|
-
"translation.y":
|
1377
|
+
"translation.y": 2442.0,
|
1374
1378
|
"zoom_level": 1.0
|
1375
1379
|
},
|
1376
1380
|
"type": "text"
|
1377
1381
|
},
|
1378
1382
|
{
|
1379
1383
|
"buffer": 4,
|
1380
|
-
"file": "
|
1384
|
+
"file": "/Users/pedro/development/personal/apple-tv-converter/apple_tv_converter.gemspec",
|
1381
1385
|
"settings":
|
1382
1386
|
{
|
1383
|
-
"buffer_size":
|
1387
|
+
"buffer_size": 996,
|
1384
1388
|
"regions":
|
1385
1389
|
{
|
1386
1390
|
},
|
1387
1391
|
"selection":
|
1388
1392
|
[
|
1389
1393
|
[
|
1390
|
-
|
1391
|
-
|
1394
|
+
426,
|
1395
|
+
426
|
1392
1396
|
]
|
1393
1397
|
],
|
1394
1398
|
"settings":
|
@@ -1440,7 +1444,9 @@
|
|
1440
1444
|
"encoding_helper_confidence": 1.0,
|
1441
1445
|
"encoding_helper_encoding": "UTF-8",
|
1442
1446
|
"encoding_helper_encoding_sublime": "UTF-8",
|
1443
|
-
"syntax": "Packages/Ruby/Ruby.tmLanguage"
|
1447
|
+
"syntax": "Packages/Ruby/Ruby.tmLanguage",
|
1448
|
+
"tab_size": 2,
|
1449
|
+
"translate_tabs_to_spaces": true
|
1444
1450
|
},
|
1445
1451
|
"translation.x": 0.0,
|
1446
1452
|
"translation.y": 0.0,
|
@@ -1450,18 +1456,18 @@
|
|
1450
1456
|
},
|
1451
1457
|
{
|
1452
1458
|
"buffer": 5,
|
1453
|
-
"file": "
|
1459
|
+
"file": "command_line.rb",
|
1454
1460
|
"settings":
|
1455
1461
|
{
|
1456
|
-
"buffer_size":
|
1462
|
+
"buffer_size": 5397,
|
1457
1463
|
"regions":
|
1458
1464
|
{
|
1459
1465
|
},
|
1460
1466
|
"selection":
|
1461
1467
|
[
|
1462
1468
|
[
|
1463
|
-
|
1464
|
-
|
1469
|
+
3564,
|
1470
|
+
3564
|
1465
1471
|
]
|
1466
1472
|
],
|
1467
1473
|
"settings":
|
@@ -1518,25 +1524,25 @@
|
|
1518
1524
|
"translate_tabs_to_spaces": true
|
1519
1525
|
},
|
1520
1526
|
"translation.x": 0.0,
|
1521
|
-
"translation.y":
|
1527
|
+
"translation.y": 1168.0,
|
1522
1528
|
"zoom_level": 1.0
|
1523
1529
|
},
|
1524
1530
|
"type": "text"
|
1525
1531
|
},
|
1526
1532
|
{
|
1527
1533
|
"buffer": 6,
|
1528
|
-
"file": "/Users/pedro/development/personal/apple-tv-converter/apple_tv_converter.
|
1534
|
+
"file": "/Users/pedro/development/personal/apple-tv-converter/lib/apple_tv_converter.rb",
|
1529
1535
|
"settings":
|
1530
1536
|
{
|
1531
|
-
"buffer_size":
|
1537
|
+
"buffer_size": 3944,
|
1532
1538
|
"regions":
|
1533
1539
|
{
|
1534
1540
|
},
|
1535
1541
|
"selection":
|
1536
1542
|
[
|
1537
1543
|
[
|
1538
|
-
|
1539
|
-
|
1544
|
+
277,
|
1545
|
+
277
|
1540
1546
|
]
|
1541
1547
|
],
|
1542
1548
|
"settings":
|
@@ -1600,18 +1606,91 @@
|
|
1600
1606
|
},
|
1601
1607
|
{
|
1602
1608
|
"buffer": 7,
|
1603
|
-
"file": "
|
1609
|
+
"file": "/Users/pedro/development/personal/apple-tv-converter/Gemfile",
|
1604
1610
|
"settings":
|
1605
1611
|
{
|
1606
|
-
"buffer_size":
|
1612
|
+
"buffer_size": 268,
|
1607
1613
|
"regions":
|
1608
1614
|
{
|
1609
1615
|
},
|
1610
1616
|
"selection":
|
1611
1617
|
[
|
1612
1618
|
[
|
1613
|
-
|
1614
|
-
|
1619
|
+
0,
|
1620
|
+
0
|
1621
|
+
]
|
1622
|
+
],
|
1623
|
+
"settings":
|
1624
|
+
{
|
1625
|
+
"BracketHighlighterBusy": false,
|
1626
|
+
"bh_regions":
|
1627
|
+
[
|
1628
|
+
"bh_regex",
|
1629
|
+
"bh_regex_center",
|
1630
|
+
"bh_regex_open",
|
1631
|
+
"bh_regex_close",
|
1632
|
+
"bh_double_quote",
|
1633
|
+
"bh_double_quote_center",
|
1634
|
+
"bh_double_quote_open",
|
1635
|
+
"bh_double_quote_close",
|
1636
|
+
"bh_square",
|
1637
|
+
"bh_square_center",
|
1638
|
+
"bh_square_open",
|
1639
|
+
"bh_square_close",
|
1640
|
+
"bh_angle",
|
1641
|
+
"bh_angle_center",
|
1642
|
+
"bh_angle_open",
|
1643
|
+
"bh_angle_close",
|
1644
|
+
"bh_curly",
|
1645
|
+
"bh_curly_center",
|
1646
|
+
"bh_curly_open",
|
1647
|
+
"bh_curly_close",
|
1648
|
+
"bh_default",
|
1649
|
+
"bh_default_center",
|
1650
|
+
"bh_default_open",
|
1651
|
+
"bh_default_close",
|
1652
|
+
"bh_unmatched",
|
1653
|
+
"bh_unmatched_center",
|
1654
|
+
"bh_unmatched_open",
|
1655
|
+
"bh_unmatched_close",
|
1656
|
+
"bh_round",
|
1657
|
+
"bh_round_center",
|
1658
|
+
"bh_round_open",
|
1659
|
+
"bh_round_close",
|
1660
|
+
"bh_tag",
|
1661
|
+
"bh_tag_center",
|
1662
|
+
"bh_tag_open",
|
1663
|
+
"bh_tag_close",
|
1664
|
+
"bh_single_quote",
|
1665
|
+
"bh_single_quote_center",
|
1666
|
+
"bh_single_quote_open",
|
1667
|
+
"bh_single_quote_close"
|
1668
|
+
],
|
1669
|
+
"encoding_helper_confidence": 1.0,
|
1670
|
+
"encoding_helper_encoding": "UTF-8",
|
1671
|
+
"encoding_helper_encoding_sublime": "UTF-8",
|
1672
|
+
"syntax": "Packages/Ruby/Ruby.tmLanguage"
|
1673
|
+
},
|
1674
|
+
"translation.x": 0.0,
|
1675
|
+
"translation.y": 0.0,
|
1676
|
+
"zoom_level": 1.0
|
1677
|
+
},
|
1678
|
+
"type": "text"
|
1679
|
+
},
|
1680
|
+
{
|
1681
|
+
"buffer": 8,
|
1682
|
+
"file": "media_converter_mac_adapter.rb",
|
1683
|
+
"settings":
|
1684
|
+
{
|
1685
|
+
"buffer_size": 5117,
|
1686
|
+
"regions":
|
1687
|
+
{
|
1688
|
+
},
|
1689
|
+
"selection":
|
1690
|
+
[
|
1691
|
+
[
|
1692
|
+
1394,
|
1693
|
+
1394
|
1615
1694
|
]
|
1616
1695
|
],
|
1617
1696
|
"settings":
|
@@ -1668,7 +1747,171 @@
|
|
1668
1747
|
"translate_tabs_to_spaces": true
|
1669
1748
|
},
|
1670
1749
|
"translation.x": 0.0,
|
1671
|
-
"translation.y":
|
1750
|
+
"translation.y": 106.0,
|
1751
|
+
"zoom_level": 1.0
|
1752
|
+
},
|
1753
|
+
"type": "text"
|
1754
|
+
},
|
1755
|
+
{
|
1756
|
+
"buffer": 9,
|
1757
|
+
"file": "/Users/pedro/development/personal/apple-tv-converter/gems/streamio-ffmpeg/lib/ffmpeg/transcoder.rb",
|
1758
|
+
"settings":
|
1759
|
+
{
|
1760
|
+
"buffer_size": 4116,
|
1761
|
+
"regions":
|
1762
|
+
{
|
1763
|
+
},
|
1764
|
+
"selection":
|
1765
|
+
[
|
1766
|
+
[
|
1767
|
+
1111,
|
1768
|
+
1111
|
1769
|
+
]
|
1770
|
+
],
|
1771
|
+
"settings":
|
1772
|
+
{
|
1773
|
+
"BracketHighlighterBusy": false,
|
1774
|
+
"bh_regions":
|
1775
|
+
[
|
1776
|
+
"bh_regex",
|
1777
|
+
"bh_regex_center",
|
1778
|
+
"bh_regex_open",
|
1779
|
+
"bh_regex_close",
|
1780
|
+
"bh_double_quote",
|
1781
|
+
"bh_double_quote_center",
|
1782
|
+
"bh_double_quote_open",
|
1783
|
+
"bh_double_quote_close",
|
1784
|
+
"bh_square",
|
1785
|
+
"bh_square_center",
|
1786
|
+
"bh_square_open",
|
1787
|
+
"bh_square_close",
|
1788
|
+
"bh_angle",
|
1789
|
+
"bh_angle_center",
|
1790
|
+
"bh_angle_open",
|
1791
|
+
"bh_angle_close",
|
1792
|
+
"bh_curly",
|
1793
|
+
"bh_curly_center",
|
1794
|
+
"bh_curly_open",
|
1795
|
+
"bh_curly_close",
|
1796
|
+
"bh_default",
|
1797
|
+
"bh_default_center",
|
1798
|
+
"bh_default_open",
|
1799
|
+
"bh_default_close",
|
1800
|
+
"bh_unmatched",
|
1801
|
+
"bh_unmatched_center",
|
1802
|
+
"bh_unmatched_open",
|
1803
|
+
"bh_unmatched_close",
|
1804
|
+
"bh_round",
|
1805
|
+
"bh_round_center",
|
1806
|
+
"bh_round_open",
|
1807
|
+
"bh_round_close",
|
1808
|
+
"bh_tag",
|
1809
|
+
"bh_tag_center",
|
1810
|
+
"bh_tag_open",
|
1811
|
+
"bh_tag_close",
|
1812
|
+
"bh_single_quote",
|
1813
|
+
"bh_single_quote_center",
|
1814
|
+
"bh_single_quote_open",
|
1815
|
+
"bh_single_quote_close"
|
1816
|
+
],
|
1817
|
+
"encoding_helper_confidence": 1.0,
|
1818
|
+
"encoding_helper_encoding": "UTF-8",
|
1819
|
+
"encoding_helper_encoding_sublime": "UTF-8",
|
1820
|
+
"syntax": "Packages/Ruby/Ruby.tmLanguage",
|
1821
|
+
"tab_size": 2,
|
1822
|
+
"translate_tabs_to_spaces": true
|
1823
|
+
},
|
1824
|
+
"translation.x": 0.0,
|
1825
|
+
"translation.y": 584.0,
|
1826
|
+
"zoom_level": 1.0
|
1827
|
+
},
|
1828
|
+
"type": "text"
|
1829
|
+
},
|
1830
|
+
{
|
1831
|
+
"buffer": 10,
|
1832
|
+
"file": "/Users/pedro/development/personal/apple-tv-converter/README.md",
|
1833
|
+
"settings":
|
1834
|
+
{
|
1835
|
+
"buffer_size": 3632,
|
1836
|
+
"regions":
|
1837
|
+
{
|
1838
|
+
"TagLint":
|
1839
|
+
{
|
1840
|
+
"flags": 52,
|
1841
|
+
"icon": "dot",
|
1842
|
+
"regions":
|
1843
|
+
[
|
1844
|
+
[
|
1845
|
+
1502,
|
1846
|
+
1506
|
1847
|
+
]
|
1848
|
+
],
|
1849
|
+
"scope": "variable.parameter"
|
1850
|
+
}
|
1851
|
+
},
|
1852
|
+
"selection":
|
1853
|
+
[
|
1854
|
+
[
|
1855
|
+
2165,
|
1856
|
+
2167
|
1857
|
+
]
|
1858
|
+
],
|
1859
|
+
"settings":
|
1860
|
+
{
|
1861
|
+
"BracketHighlighterBusy": false,
|
1862
|
+
"bh_regions":
|
1863
|
+
[
|
1864
|
+
"bh_regex",
|
1865
|
+
"bh_regex_center",
|
1866
|
+
"bh_regex_open",
|
1867
|
+
"bh_regex_close",
|
1868
|
+
"bh_double_quote",
|
1869
|
+
"bh_double_quote_center",
|
1870
|
+
"bh_double_quote_open",
|
1871
|
+
"bh_double_quote_close",
|
1872
|
+
"bh_square",
|
1873
|
+
"bh_square_center",
|
1874
|
+
"bh_square_open",
|
1875
|
+
"bh_square_close",
|
1876
|
+
"bh_angle",
|
1877
|
+
"bh_angle_center",
|
1878
|
+
"bh_angle_open",
|
1879
|
+
"bh_angle_close",
|
1880
|
+
"bh_curly",
|
1881
|
+
"bh_curly_center",
|
1882
|
+
"bh_curly_open",
|
1883
|
+
"bh_curly_close",
|
1884
|
+
"bh_default",
|
1885
|
+
"bh_default_center",
|
1886
|
+
"bh_default_open",
|
1887
|
+
"bh_default_close",
|
1888
|
+
"bh_unmatched",
|
1889
|
+
"bh_unmatched_center",
|
1890
|
+
"bh_unmatched_open",
|
1891
|
+
"bh_unmatched_close",
|
1892
|
+
"bh_round",
|
1893
|
+
"bh_round_center",
|
1894
|
+
"bh_round_open",
|
1895
|
+
"bh_round_close",
|
1896
|
+
"bh_tag",
|
1897
|
+
"bh_tag_center",
|
1898
|
+
"bh_tag_open",
|
1899
|
+
"bh_tag_close",
|
1900
|
+
"bh_single_quote",
|
1901
|
+
"bh_single_quote_center",
|
1902
|
+
"bh_single_quote_open",
|
1903
|
+
"bh_single_quote_close"
|
1904
|
+
],
|
1905
|
+
"encoding_helper_confidence": 1.0,
|
1906
|
+
"encoding_helper_encoding": "UTF-8",
|
1907
|
+
"encoding_helper_encoding_sublime": "UTF-8",
|
1908
|
+
"is_xml": false,
|
1909
|
+
"syntax": "Packages/Markdown/Markdown.tmLanguage",
|
1910
|
+
"tab_size": 4,
|
1911
|
+
"translate_tabs_to_spaces": true
|
1912
|
+
},
|
1913
|
+
"translation.x": 0.0,
|
1914
|
+
"translation.y": 657.0,
|
1672
1915
|
"zoom_level": 1.0
|
1673
1916
|
},
|
1674
1917
|
"type": "text"
|
@@ -1721,6 +1964,58 @@
|
|
1721
1964
|
"height": 0.0,
|
1722
1965
|
"selected_items":
|
1723
1966
|
[
|
1967
|
+
[
|
1968
|
+
"version",
|
1969
|
+
"lib/apple_tv_converter/version.rb"
|
1970
|
+
],
|
1971
|
+
[
|
1972
|
+
"chang",
|
1973
|
+
"CHANGELOG"
|
1974
|
+
],
|
1975
|
+
[
|
1976
|
+
"readm",
|
1977
|
+
"README.md"
|
1978
|
+
],
|
1979
|
+
[
|
1980
|
+
"gemspec",
|
1981
|
+
"gems/streamio-ffmpeg/streamio-ffmpeg.gemspec"
|
1982
|
+
],
|
1983
|
+
[
|
1984
|
+
"gemfile",
|
1985
|
+
"gems/streamio-ffmpeg/Gemfile"
|
1986
|
+
],
|
1987
|
+
[
|
1988
|
+
"strea",
|
1989
|
+
"gems/streamio-ffmpeg/lib/streamio-ffmpeg.rb"
|
1990
|
+
],
|
1991
|
+
[
|
1992
|
+
"transco",
|
1993
|
+
"gems/streamio-ffmpeg/lib/ffmpeg/transcoder.rb"
|
1994
|
+
],
|
1995
|
+
[
|
1996
|
+
"mediaconada",
|
1997
|
+
"lib/apple_tv_converter/media_converter_adapter.rb"
|
1998
|
+
],
|
1999
|
+
[
|
2000
|
+
"mac",
|
2001
|
+
"lib/apple_tv_converter/media_converter_mac_adapter.rb"
|
2002
|
+
],
|
2003
|
+
[
|
2004
|
+
"opens",
|
2005
|
+
"lib/apple_tv_converter/subtitles_fetcher/opensubtitles.rb"
|
2006
|
+
],
|
2007
|
+
[
|
2008
|
+
"gem",
|
2009
|
+
"Gemfile"
|
2010
|
+
],
|
2011
|
+
[
|
2012
|
+
"apple_",
|
2013
|
+
"lib/apple_tv_converter.rb"
|
2014
|
+
],
|
2015
|
+
[
|
2016
|
+
"movie.rb",
|
2017
|
+
"gems/streamio-ffmpeg/lib/ffmpeg/movie.rb"
|
2018
|
+
],
|
1724
2019
|
[
|
1725
2020
|
"command",
|
1726
2021
|
"lib/apple_tv_converter/command_line.rb"
|
@@ -1813,10 +2108,6 @@
|
|
1813
2108
|
"macada",
|
1814
2109
|
"lib/apple_tv_converter/media_converter_mac_adapter.rb"
|
1815
2110
|
],
|
1816
|
-
[
|
1817
|
-
"version",
|
1818
|
-
"lib/apple_tv_converter/version.rb"
|
1819
|
-
],
|
1820
2111
|
[
|
1821
2112
|
"movie",
|
1822
2113
|
"gems/streamio-ffmpeg/lib/ffmpeg/movie.rb"
|
@@ -1825,22 +2116,10 @@
|
|
1825
2116
|
"",
|
1826
2117
|
"apple_tv_converter.gemspec"
|
1827
2118
|
],
|
1828
|
-
[
|
1829
|
-
"gemspec",
|
1830
|
-
"apple-tv-converter/apple_tv_converter.gemspec"
|
1831
|
-
],
|
1832
|
-
[
|
1833
|
-
"gemfile",
|
1834
|
-
"apple-tv-converter/Gemfile"
|
1835
|
-
],
|
1836
2119
|
[
|
1837
2120
|
"appl",
|
1838
2121
|
"apple-tv-converter/lib/apple_tv_converter.rb"
|
1839
2122
|
],
|
1840
|
-
[
|
1841
|
-
"transco",
|
1842
|
-
"streamio-ffmpeg/lib/ffmpeg/transcoder.rb"
|
1843
|
-
],
|
1844
2123
|
[
|
1845
2124
|
"md",
|
1846
2125
|
"apple-tv-converter/README.md"
|
@@ -1893,10 +2172,6 @@
|
|
1893
2172
|
"commandline",
|
1894
2173
|
"apple-tv-converter/lib/apple_tv_converter/command_line.rb"
|
1895
2174
|
],
|
1896
|
-
[
|
1897
|
-
"mac",
|
1898
|
-
"apple-tv-converter/lib/apple_tv_converter/media_converter_mac_adapter.rb"
|
1899
|
-
],
|
1900
2175
|
[
|
1901
2176
|
"ffmpegmovie",
|
1902
2177
|
"streamio-ffmpeg/lib/ffmpeg/movie.rb"
|
@@ -2045,14 +2320,6 @@
|
|
2045
2320
|
"apll_",
|
2046
2321
|
"apple-tv-converter/lib/apple_tv_converter.rb"
|
2047
2322
|
],
|
2048
|
-
[
|
2049
|
-
"chang",
|
2050
|
-
"apple-tv-converter/CHANGELOG"
|
2051
|
-
],
|
2052
|
-
[
|
2053
|
-
"apple_",
|
2054
|
-
"apple-tv-converter/lib/apple_tv_converter.rb"
|
2055
|
-
],
|
2056
2323
|
[
|
2057
2324
|
"rake",
|
2058
2325
|
"Rakefile"
|
@@ -2208,30 +2475,6 @@
|
|
2208
2475
|
[
|
2209
2476
|
"mycompsett",
|
2210
2477
|
"toconline/app/views/my_company/companies/_settings.html.erb"
|
2211
|
-
],
|
2212
|
-
[
|
2213
|
-
"documentshe",
|
2214
|
-
"toconline/app/helpers/documents_helper.rb"
|
2215
|
-
],
|
2216
|
-
[
|
2217
|
-
"documentseries",
|
2218
|
-
"toconline/app/controllers/my_company/document_series_controller.rb"
|
2219
|
-
],
|
2220
|
-
[
|
2221
|
-
"documjs",
|
2222
|
-
"toconline/app/assets/javascripts/billing/documents.js"
|
2223
|
-
],
|
2224
|
-
[
|
2225
|
-
"customersfor",
|
2226
|
-
"toconline/app/views/billing/customers/_form.html.erb"
|
2227
|
-
],
|
2228
|
-
[
|
2229
|
-
"tocj",
|
2230
|
-
"toconline/app/assets/javascripts/toc_jquery.js"
|
2231
|
-
],
|
2232
|
-
[
|
2233
|
-
"tocform",
|
2234
|
-
"toconline/lib/cloudware/toc_online/toc_form_builder.rb"
|
2235
2478
|
]
|
2236
2479
|
],
|
2237
2480
|
"width": 0.0
|
@@ -2247,7 +2490,7 @@
|
|
2247
2490
|
"show_minimap": true,
|
2248
2491
|
"show_open_files": true,
|
2249
2492
|
"show_tabs": true,
|
2250
|
-
"side_bar_visible":
|
2493
|
+
"side_bar_visible": false,
|
2251
2494
|
"side_bar_width": 307.0,
|
2252
2495
|
"status_bar_visible": true
|
2253
2496
|
}
|
@@ -44,7 +44,7 @@ module AppleTvConverter
|
|
44
44
|
transcoded = media.ffmpeg_data.transcode(filename, "#{options} -map #{stream.input_number}:#{stream.stream_number}", :validate_output => false) do |progress|
|
45
45
|
elapsed = Time.now.to_i - start_time
|
46
46
|
printf "\r" + (" " * 40)
|
47
|
-
printf "\r * #{File.basename(filename)}: Progress: #{(progress *
|
47
|
+
printf "\r * #{File.basename(filename)}: Progress: #{(progress * 10000).round.to_s.gsub(/(\d{2})$/, '.\1').gsub(/^\./, '0.').rjust(6)}%% (#{(elapsed / 60).to_s.rjust(2, '0')}:#{(elapsed % 60).to_s.rjust(2, '0')}) "
|
48
48
|
end
|
49
49
|
puts ""
|
50
50
|
rescue Interrupt
|
@@ -113,7 +113,7 @@ module AppleTvConverter
|
|
113
113
|
transcoded = media.ffmpeg_data.transcode(media.converted_filename, options) do |progress|
|
114
114
|
elapsed = Time.now.to_i - start_time
|
115
115
|
printf "\r" + (" " * 40)
|
116
|
-
printf %Q[\r * Progress: #{(progress *
|
116
|
+
printf %Q[\r * Progress: #{(progress * 10000).round.to_s.gsub(/(\d{2})$/, '.\1').gsub(/^\./, '0.').rjust(6)}%% (#{(elapsed / 60).to_s.rjust(2, '0')}:#{(elapsed % 60).to_s.rjust(2, '0')})]
|
117
117
|
end
|
118
118
|
rescue Interrupt
|
119
119
|
puts "\nProcess canceled!"
|
@@ -21,9 +21,14 @@ module AppleTvConverter
|
|
21
21
|
AppleTvConverter.logger.debug command_line
|
22
22
|
|
23
23
|
printf " * Adding #{language_name} subtitles"
|
24
|
-
output, exit_status = Open3.popen3(command_line) { |stdin, stdout, stderr, wait_thr| [ stdout.read, wait_thr.value] }
|
25
24
|
|
26
|
-
|
25
|
+
if RUBY_VERSION =~ /^1\.8/
|
26
|
+
output, error = Open3.popen3(command_line) { |stdin, stdout, stderr| [ stdout.read, stderr.read ] }
|
27
|
+
puts error.strip == '' ? " [DONE]" : " [ERROR]"
|
28
|
+
else
|
29
|
+
output, error, exit_status = Open3.popen3(command_line) { |stdin, stdout, stderr, wait_thr| [ stdout.read, stderr.read, wait_thr.value ] }
|
30
|
+
puts exit_status.exitstatus == 0 ? " [DONE]" : " [ERROR]"
|
31
|
+
end
|
27
32
|
end
|
28
33
|
else
|
29
34
|
puts " * No subtitles found"
|
@@ -81,9 +86,13 @@ module AppleTvConverter
|
|
81
86
|
|
82
87
|
printf "* Tagging"
|
83
88
|
|
84
|
-
|
85
|
-
|
86
|
-
|
89
|
+
if RUBY_VERSION =~ /^1\.8/
|
90
|
+
output, error = Open3.popen3(command_line) { |stdin, stdout, stderr| [ stdout.read, stderr.read ] }
|
91
|
+
puts error.strip == '' ? " [DONE]" : " [ERROR]"
|
92
|
+
else
|
93
|
+
output, error, exit_status = Open3.popen3(command_line) { |stdin, stdout, stderr, wait_thr| [ stdout.read, stderr.read, wait_thr.value ] }
|
94
|
+
puts exit_status.exitstatus == 0 ? " [DONE]" : " [ERROR]"
|
95
|
+
end
|
87
96
|
|
88
97
|
return output.strip.empty?
|
89
98
|
end
|
@@ -121,9 +121,8 @@ module AppleTvConverter
|
|
121
121
|
end
|
122
122
|
|
123
123
|
def filter_subtitles(data, media)
|
124
|
-
media_subtitles = data
|
125
|
-
|
126
|
-
.select { |s| languages.empty? || languages.include?(s['SubLanguageID']) } # Filter by language
|
124
|
+
media_subtitles = data.select { |s| s['SubFormat'].downcase == 'srt' } # Filter by format
|
125
|
+
media_subtitles = media_subtitles.select { |s| languages.empty? || languages.include?(s['SubLanguageID']) } # Filter by language
|
127
126
|
|
128
127
|
exact_match = media_subtitles.select do |s|
|
129
128
|
!File.basename(media.original_filename).downcase.index(s['MovieReleaseName'].downcase).nil? ||
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apple-tv-converter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-05-
|
12
|
+
date: 2013-05-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|