root/trunk/install/perl/channelscan.pl
リビジョン 111, 12.7 kB (コミッタ: sorshi, コミット時期: 14 年 前) | |
---|---|
|
Line | |
---|---|
1 | #!/usr/bin/perl |
2 | # |
3 | # |
4 | # Anime recording system foltia |
5 | # http://www.dcc-jpl.com/soft/foltia/ |
6 | # |
7 | # |
8 | # チャンネルスキャン |
9 | # 初期インストール時に受信可能局をスキャンします |
10 | # |
11 | # DCC-JPL Japan/foltia project |
12 | # |
13 | |
14 | #use DBI; |
15 | #use DBD::Pg; |
16 | #use DBD::SQLite; |
17 | #use Schedule::At; |
18 | #use Time::Local; |
19 | #use Jcode; |
20 | |
21 | #$path = $0; |
22 | #$path =~ s/channelscan.pl$//i; |
23 | #if ($path ne "./"){ |
24 | #push( @INC, "$path"); |
25 | #} |
26 | |
27 | #require "foltialib.pl"; |
28 | |
29 | my $recpt1path = "/home/foltia/perl/tool/recpt1"; #ほかのキャプチャデバイス作ってる人はココを変更 |
30 | my $epgdumppath = "/home/foltia/perl/tool"; #epgdumpのあるディレクトリ |
31 | my $recfolderpath = "/home/foltia/php/tv";#tsを出力するディレクトリ |
32 | my $xmloutpath = "/tmp"; |
33 | my $channel = 13 ; #地デジチャンネルは13-62 |
34 | my $oserr = ""; |
35 | my $line = ""; |
36 | |
37 | print "Initialize\n"; |
38 | print "Tool path are\n"; |
39 | print "REC:$recpt1path\n"; |
40 | print "EPGDUMP:$epgdumppath/epgdump\n"; |
41 | print "TS OUT:$recfolderpath/\n"; |
42 | print "XML OUT:$xmloutpath/\n"; |
43 | |
44 | #ツールがあるか確認 |
45 | unless (-e "$recpt1path"){ |
46 | print "Please install $recpt1path.\n"; |
47 | exit 1; |
48 | } |
49 | unless (-e "$epgdumppath/epgdump"){ |
50 | print "Please install $epgdumppath/epgdump.\n"; |
51 | exit 1; |
52 | } |
53 | unless (-e "$recfolderpath"){ |
54 | print "Please make directory $recfolderpath.\n"; |
55 | exit 1; |
56 | } |
57 | unless (-e "$xmloutpath"){ |
58 | print "Please make directory $xmloutpath.\n"; |
59 | exit 1; |
60 | } |
61 | |
62 | |
63 | #地デジスキャンループ |
64 | for ($channel = 13; $channel <= 62 ; $channel++){ |
65 | print "\nChannel: $channel\n"; |
66 | $oserr = `$recpt1path $channel 4 $recfolderpath/__$channel.m2t`; |
67 | $oserr = `$epgdumppath/epgdump $channel $recfolderpath/__$channel.m2t $xmloutpath/__$channel-epg.xml`; |
68 | |
69 | if (-s "$xmloutpath/__$channel-epg.xml" ){ |
70 | print "\t\t This channel can view : $channel \n"; |
71 | open(XML, "< $xmloutpath/__$channel-epg.xml"); |
72 | while ( $line = <XML>) { |
73 | #Jcode::convert(\$line,'euc','utf8'); |
74 | if($line =~ /<display-name/){ |
75 | $line =~ s/<.*?>//g; |
76 | #Jcode::convert(\$line,'utf8','euc'); |
77 | print "\t\t $channel $line\n"; |
78 | }#end if |
79 | }#end while |
80 | close(XML); |
81 | }else{ |
82 | print "\t\t Not Available : $channel \n"; |
83 | }#end if |
84 | }#end for |
85 | |
86 | |
87 | #BSデジタル |
88 | $channel = 211; |
89 | print "\nBS Digital Scan\n"; |
90 | $oserr = `$recpt1path $channel 4 $recfolderpath/__$channel.m2t`; |
91 | $oserr = `$epgdumppath/epgdump /BS $recfolderpath/__$channel.m2t $xmloutpath/__$channel-epg.xml`; |
92 | |
93 | if (-s "$xmloutpath/__$channel-epg.xml" ){ |
94 | print "\t\t BS Digital can view : \n"; |
95 | open(XML, "< $xmloutpath/__$channel-epg.xml"); |
96 | while ( $line = <XML>) { |
97 | #Jcode::convert(\$line,'euc','utf8'); |
98 | if($line =~ /<display-name/){ |
99 | $line =~ s/<.*?>//g; |
100 | #Jcode::convert(\$line,'utf8','euc'); |
101 | print "\t\t $line\n"; |
102 | }#end if |
103 | }#end while |
104 | close(XML); |
105 | }else{ |
106 | print "\t\t Not Available : BS Digital \n"; |
107 | }#end if |
108 | |
109 | |
110 | # <channel id="3001.ontvjapan.com"> |
111 | # <display-name lang="ja_JP">NHK BS1</display-name> |
112 | # </channel> |
113 | # <channel id="3002.ontvjapan.com"> |
114 | # <display-name lang="ja_JP">NHK BS2</display-name> |
115 | # </channel> |
116 | # <channel id="3003.ontvjapan.com"> |
117 | # <display-name lang="ja_JP">NHK BSh</display-name> |
118 | # </channel> |
119 | # <channel id="3004.ontvjapan.com"> |
120 | # <display-name lang="ja_JP">BS日テレ</display-name> |
121 | # </channel> |
122 | # <channel id="3005.ontvjapan.com"> |
123 | # <display-name lang="ja_JP">BS朝日</display-name> |
124 | # </channel> |
125 | # <channel id="3006.ontvjapan.com"> |
126 | # <display-name lang="ja_JP">BS-TBS</display-name> |
127 | # </channel> |
128 | # <channel id="3007.ontvjapan.com"> |
129 | # <display-name lang="ja_JP">BSジャパン</display-name> |
130 | # </channel> |
131 | # <channel id="3008.ontvjapan.com"> |
132 | # <display-name lang="ja_JP">BSフジ</display-name> |
133 | # </channel> |
134 | # <channel id="3009.ontvjapan.com"> |
135 | # <display-name lang="ja_JP">WOWOW</display-name> |
136 | # </channel> |
137 | # <channel id="3010.ontvjapan.com"> |
138 | # <display-name lang="ja_JP">WOWOW2</display-name> |
139 | # </channel> |
140 | # <channel id="3011.ontvjapan.com"> |
141 | # <display-name lang="ja_JP">WOWOW3</display-name> |
142 | # </channel> |
143 | # <channel id="3012.ontvjapan.com"> |
144 | # <display-name lang="ja_JP">スター・チャンネル</display-name> |
145 | # </channel> |
146 | # <channel id="3013.ontvjapan.com"> |
147 | # <display-name lang="ja_JP">BS11</display-name> |
148 | # </channel> |
149 | # <channel id="3014.ontvjapan.com"> |
150 | # <display-name lang="ja_JP">TwellV</display-name> |
151 | # </channel> |
152 | # |
153 | |
154 | #CSデジタル |
155 | $channel = "CS8"; |
156 | print "\nCS Digital Scan\n"; |
157 | $oserr = `$recpt1path $channel 4 $recfolderpath/__$channel.m2t`; |
158 | $oserr = `$epgdumppath/epgdump /CS $recfolderpath/__$channel.m2t $xmloutpath/__$channel-epg.xml`; |
159 | |
160 | if (-s "$xmloutpath/__$channel-epg.xml" ){ |
161 | print "\t\t CS Digital can view : \n"; |
162 | open(XML, "< $xmloutpath/__$channel-epg.xml"); |
163 | while ( $line = <XML>) { |
164 | #Jcode::convert(\$line,'euc','utf8'); |
165 | if($line =~ /<display-name/){ |
166 | $line =~ s/<.*?>//g; |
167 | #Jcode::convert(\$line,'utf8','euc'); |
168 | print "\t\t $line\n"; |
169 | }#end if |
170 | }#end while |
171 | close(XML); |
172 | }else{ |
173 | print "\t\t Not Available : CS Digital \n"; |
174 | }#end if |
175 | |
176 | # <channel id="1002.ontvjapan.com"> |
177 | # <display-name lang="ja_JP">スターchプラス</display-name> |
178 | # </channel> |
179 | # <channel id="1086.ontvjapan.com"> |
180 | # <display-name lang="ja_JP">日本映画専門chHD</display-name> |
181 | # </channel> |
182 | # <channel id="306ch.epgdata.ontvjapan"> |
183 | # <display-name lang="ja_JP">フジテレビCSHD</display-name> |
184 | # </channel> |
185 | # <channel id="1059.ontvjapan.com"> |
186 | # <display-name lang="ja_JP">ショップチャンネル</display-name> |
187 | # </channel> |
188 | # <channel id="1217.ontvjapan.com"> |
189 | # <display-name lang="ja_JP">ザ・シネマ</display-name> |
190 | # </channel> |
191 | # <channel id="800ch.epgdata.ontvjapan"> |
192 | # <display-name lang="ja_JP">スカチャンHD800</display-name> |
193 | # </channel> |
194 | # <channel id="801ch.epgdata.ontvjapan"> |
195 | # <display-name lang="ja_JP">スカチャン801</display-name> |
196 | # </channel> |
197 | # <channel id="802ch.epgdata.ontvjapan"> |
198 | # <display-name lang="ja_JP">スカチャン802</display-name> |
199 | # </channel> |
200 | # <channel id="100ch.epgdata.ontvjapan"> |
201 | # <display-name lang="ja_JP">e2プロモ</display-name> |
202 | # </channel> |
203 | # <channel id="194ch.epgdata.ontvjapan"> |
204 | # <display-name lang="ja_JP">インターローカルTV</display-name> |
205 | # </channel> |
206 | # <channel id="1025.ontvjapan.com"> |
207 | # <display-name lang="ja_JP">Jスポーツ ESPN</display-name> |
208 | # </channel> |
209 | # <channel id="1016.ontvjapan.com"> |
210 | # <display-name lang="ja_JP">FOX</display-name> |
211 | # </channel> |
212 | # <channel id="1018.ontvjapan.com"> |
213 | # <display-name lang="ja_JP">スペースシャワーTV</display-name> |
214 | # </channel> |
215 | # <channel id="1046.ontvjapan.com"> |
216 | # <display-name lang="ja_JP">カートゥーン ネット</display-name> |
217 | # </channel> |
218 | # <channel id="1213.ontvjapan.com"> |
219 | # <display-name lang="ja_JP">トゥーン・ディズニー</display-name> |
220 | # </channel> |
221 | # <channel id="1010.ontvjapan.com"> |
222 | # <display-name lang="ja_JP">東映チャンネル</display-name> |
223 | # </channel> |
224 | # <channel id="1005.ontvjapan.com"> |
225 | # <display-name lang="ja_JP">衛星劇場</display-name> |
226 | # </channel> |
227 | # <channel id="1008.ontvjapan.com"> |
228 | # <display-name lang="ja_JP">チャンネルNECO</display-name> |
229 | # </channel> |
230 | # <channel id="1009.ontvjapan.com"> |
231 | # <display-name lang="ja_JP">洋画★シネフィル</display-name> |
232 | # </channel> |
233 | # <channel id="1003.ontvjapan.com"> |
234 | # <display-name lang="ja_JP">スター・クラシック</display-name> |
235 | # </channel> |
236 | # <channel id="1133.ontvjapan.com"> |
237 | # <display-name lang="ja_JP">時代劇専門チャンネル</display-name> |
238 | # </channel> |
239 | # <channel id="1006.ontvjapan.com"> |
240 | # <display-name lang="ja_JP">スーパードラマ</display-name> |
241 | # </channel> |
242 | # <channel id="1014.ontvjapan.com"> |
243 | # <display-name lang="ja_JP">AXN</display-name> |
244 | # </channel> |
245 | # <channel id="1204.ontvjapan.com"> |
246 | # <display-name lang="ja_JP">ナショジオチャンネル</display-name> |
247 | # </channel> |
248 | # <channel id="110ch.epgdata.ontvjapan"> |
249 | # <display-name lang="ja_JP">ワンテンポータル</display-name> |
250 | # </channel> |
251 | # <channel id="1028.ontvjapan.com"> |
252 | # <display-name lang="ja_JP">ゴルフチャンネル</display-name> |
253 | # </channel> |
254 | # <channel id="1092.ontvjapan.com"> |
255 | # <display-name lang="ja_JP">テレ朝チャンネル</display-name> |
256 | # </channel> |
257 | # <channel id="1019.ontvjapan.com"> |
258 | # <display-name lang="ja_JP">MTV</display-name> |
259 | # </channel> |
260 | # <channel id="1024.ontvjapan.com"> |
261 | # <display-name lang="ja_JP">ミュージック・エア</display-name> |
262 | # </channel> |
263 | # <channel id="1067.ontvjapan.com"> |
264 | # <display-name lang="ja_JP">朝日ニュースター</display-name> |
265 | # </channel> |
266 | # <channel id="1070.ontvjapan.com"> |
267 | # <display-name lang="ja_JP">BBCワールド</display-name> |
268 | # </channel> |
269 | # <channel id="1069.ontvjapan.com"> |
270 | # <display-name lang="ja_JP">CNNj</display-name> |
271 | # </channel> |
272 | # <channel id="361ch.epgdata.ontvjapan"> |
273 | # <display-name lang="ja_JP">ジャスト・アイ</display-name> |
274 | # </channel> |
275 | # <channel id="1041.ontvjapan.com"> |
276 | # <display-name lang="ja_JP">Jスポーツ 1</display-name> |
277 | # </channel> |
278 | # <channel id="1042.ontvjapan.com"> |
279 | # <display-name lang="ja_JP">Jスポーツ 2</display-name> |
280 | # </channel> |
281 | # <channel id="1043.ontvjapan.com"> |
282 | # <display-name lang="ja_JP">JスポーツPlusH</display-name> |
283 | # </channel> |
284 | # <channel id="1026.ontvjapan.com"> |
285 | # <display-name lang="ja_JP">GAORA</display-name> |
286 | # </channel> |
287 | # <channel id="1040.ontvjapan.com"> |
288 | # <display-name lang="ja_JP">sky・Aスポーツ+</display-name> |
289 | # </channel> |
290 | # <channel id="101ch.epgdata.ontvjapan"> |
291 | # <display-name lang="ja_JP">宝塚プロモチャンネル</display-name> |
292 | # </channel> |
293 | # <channel id="1207.ontvjapan.com"> |
294 | # <display-name lang="ja_JP">SKY・STAGE</display-name> |
295 | # </channel> |
296 | # <channel id="305ch.epgdata.ontvjapan"> |
297 | # <display-name lang="ja_JP">チャンネル銀河</display-name> |
298 | # </channel> |
299 | # <channel id="1201.ontvjapan.com"> |
300 | # <display-name lang="ja_JP">AT-X</display-name> |
301 | # </channel> |
302 | # <channel id="1050.ontvjapan.com"> |
303 | # <display-name lang="ja_JP">ヒストリーチャンネル</display-name> |
304 | # </channel> |
305 | # <channel id="803ch.epgdata.ontvjapan"> |
306 | # <display-name lang="ja_JP">スカチャン803</display-name> |
307 | # </channel> |
308 | # <channel id="804ch.epgdata.ontvjapan"> |
309 | # <display-name lang="ja_JP">スカチャン804</display-name> |
310 | # </channel> |
311 | # <channel id="1007.ontvjapan.com"> |
312 | # <display-name lang="ja_JP">ムービープラスHD</display-name> |
313 | # </channel> |
314 | # <channel id="1027.ontvjapan.com"> |
315 | # <display-name lang="ja_JP">ゴルフネットワーク</display-name> |
316 | # </channel> |
317 | # <channel id="1074.ontvjapan.com"> |
318 | # <display-name lang="ja_JP">LaLa HD</display-name> |
319 | # </channel> |
320 | # <channel id="1073.ontvjapan.com"> |
321 | # <display-name lang="ja_JP">フジテレビ739</display-name> |
322 | # </channel> |
323 | # <channel id="1072.ontvjapan.com"> |
324 | # <display-name lang="ja_JP">フジテレビ721</display-name> |
325 | # </channel> |
326 | # <channel id="1047.ontvjapan.com"> |
327 | # <display-name lang="ja_JP">アニマックス</display-name> |
328 | # </channel> |
329 | # <channel id="1062.ontvjapan.com"> |
330 | # <display-name lang="ja_JP">ディスカバリー</display-name> |
331 | # </channel> |
332 | # <channel id="1193.ontvjapan.com"> |
333 | # <display-name lang="ja_JP">アニマルプラネット</display-name> |
334 | # </channel> |
335 | # <channel id="160ch.epgdata.ontvjapan"> |
336 | # <display-name lang="ja_JP">C-TBSウエルカム</display-name> |
337 | # </channel> |
338 | # <channel id="1120.ontvjapan.com"> |
339 | # <display-name lang="ja_JP">QVC</display-name> |
340 | # </channel> |
341 | # <channel id="185ch.epgdata.ontvjapan"> |
342 | # <display-name lang="ja_JP">プライム365.TV</display-name> |
343 | # </channel> |
344 | # <channel id="1015.ontvjapan.com"> |
345 | # <display-name lang="ja_JP">ファミリー劇場</display-name> |
346 | # </channel> |
347 | # <channel id="3201.ontvjapan.com"> |
348 | # <display-name lang="ja_JP">TBSチャンネル</display-name> |
349 | # </channel> |
350 | # <channel id="1090.ontvjapan.com"> |
351 | # <display-name lang="ja_JP">ディズニーチャンネル</display-name> |
352 | # </channel> |
353 | # <channel id="1022.ontvjapan.com"> |
354 | # <display-name lang="ja_JP">MUSIC ON! TV</display-name> |
355 | # </channel> |
356 | # <channel id="1045.ontvjapan.com"> |
357 | # <display-name lang="ja_JP">キッズステーション</display-name> |
358 | # </channel> |
359 | # <channel id="1076.ontvjapan.com"> |
360 | # <display-name lang="ja_JP">TBSニュースバード</display-name> |
361 | # </channel> |
362 | # <channel id="147ch.epgdata.ontvjapan"> |
363 | # <display-name lang="ja_JP">CS日本番組ガイド</display-name> |
364 | # </channel> |
365 | # <channel id="1068.ontvjapan.com"> |
366 | # <display-name lang="ja_JP">日テレG+</display-name> |
367 | # </channel> |
368 | # <channel id="5004.ontvjapan.com"> |
369 | # <display-name lang="ja_JP">fashion TV</display-name> |
370 | # </channel> |
371 | # <channel id="300ch.epgdata.ontvjapan"> |
372 | # <display-name lang="ja_JP">日テレプラス</display-name> |
373 | # </channel> |
374 | # <channel id="1023.ontvjapan.com"> |
375 | # <display-name lang="ja_JP">エコミュージックTV</display-name> |
376 | # </channel> |
377 | # <channel id="1208.ontvjapan.com"> |
378 | # <display-name lang="ja_JP">Music Japan TV</display-name> |
379 | # </channel> |
380 | # <channel id="2002.ontvjapan.com"> |
381 | # <display-name lang="ja_JP">日テレNEWS24</display-name> |
382 | # </channel> |
383 | |
384 | |
385 | #CATV |
386 | # /home/foltia/perl/tool/recpt1 --b25 C13 10 /home/foltia/php/tv/__C13.m2t |
387 | # /home/foltia/perl/tool/epgdump /CS /home/foltia/php/tv/__C13.m2t /tmp/__C13-epg.xml |
388 |
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。