@@ -76,83 +76,3 @@ class CCExtractor {
7676 return process.exitCode;
7777 }
7878}
79-
80-
81-
82- // // Dart imports:
83- // import 'dart:convert';
84- // import 'dart:io';
85-
86- // // Package imports:
87- // import 'package:file_selector/file_selector.dart';
88- // import 'package:localstorage/localstorage.dart';
89-
90- // class CCExtractor {
91- // late Process process;
92- // final RegExp progressRegx = RegExp(r'###PROGRESS#(\d+)', multiLine: true);
93- // final RegExp summaryRegx = RegExp(r'\[(.*?)\]', multiLine: true);
94- // final RegExp logsRegx =
95- // RegExp(r'###SUBTITLE###(.+)|###TIME###(.+)', multiLine: true);
96- // final RegExp videoDetailsRegx = RegExp(r'###VIDEOINFO#(.+)', multiLine: true);
97- // LocalStorage storage = LocalStorage('config.json');
98- // late String outputFileName;
99- // late String outputformat;
100-
101- // Future getData() async {
102- // await storage.ready;
103- // outputFileName = await storage.getItem('output_file_name');
104- // outputformat = await storage.getItem('output_format');
105- // }
106-
107- // String get ccextractor {
108- // return Platform.isWindows ? './ccextractor.exe' : 'ccextractor';
109- // }
110-
111- // Future<int> extractFile(
112- // XFile file, {
113- // required Function(String) listenProgress,
114- // required Function(String) listenOutput,
115- // required Function(List<String>) listenVideoDetails,
116- // }) async {
117- // await getData();
118- // print(ccextractor);
119- // process = await Process.start(
120- // './ccextractor.exe',
121- // [
122- // file.path,
123- // '--gui_mode_reports',
124- // // encoder
125- // '-latin1',
126- // // output file name
127- // outputFileName.isNotEmpty ? '-o' : '',
128- // outputFileName.isNotEmpty
129- // ? '${file.path.substring(0, file.path.lastIndexOf(RegExp(r'(\\|\/)')))}/$outputFileName.$outputformat'
130- // : '',
131- // // output format
132- // '-out=$outputformat',
133- // ],
134- // );
135- // process.stderr.transform(latin1.decoder).listen((update) {
136- // if (progressRegx.hasMatch(update)) {
137- // for (RegExpMatch i in progressRegx.allMatches(update)) {
138- // listenProgress(i[1]!);
139- // }
140- // }
141- // if (logsRegx.hasMatch(update)) {
142- // for (RegExpMatch i in logsRegx.allMatches(update)) {
143- // // 1,2 are here for regex groups, 1 corresponds to subtitle regex
144- // // match and 2 is time regex match. Later we can seperate this if
145- // // needed (no additonal benefit rn imo;td)
146- // if (i[1] != null) listenOutput(i[1]!);
147- // if (i[2] != null) listenOutput(i[2]!);
148- // }
149- // }
150- // if (videoDetailsRegx.hasMatch(update)) {
151- // for (RegExpMatch i in videoDetailsRegx.allMatches(update)) {
152- // listenVideoDetails(i[1]!.split('#'));
153- // }
154- // }
155- // });
156- // return process.exitCode;
157- // }
158- // }
0 commit comments