Bestand openen in externe programma

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

RareAMV Unknown

RareAMV Unknown

02/03/2013 11:56:30
Quote Anchor link
Hallo,

Ik wil voor een paar vrienden een postgenerator maken voor hun site. Nu moet die postgen doormiddel van een extern programma een screenshot maken van een videobestand. Dit externe programma heet MovieThumbnailer.
De postgenerator bestond al, maar in verschillende delen, en nu wil ik ze dus samenvoegen. Dat betekent dus dat de script niet bedacht en gemaakt zijn door mij. Ik had toestemming om ze te gebruiken, en heb er alleen wat kleine dingetjes aan veranderd, om het in zn geheel te laten werken.
Ik heb in de code die jullie hieronder zullen lezen van alles geprobeerd om dit werkende te krijgen.
Dit script was origineel bedoelt om op een server te draaien, maar omdat de admin (en vriend) niet wou dat ik ging experimenteren met scripts op de server, was ik genoodzaakt om het op mijn pc te doen.
Ik hoop dat jullie mij verder kunnen helpen.
Al vast bedankt.

PHP script
Quote:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
<?php

//-----postgen variables-----
$name = $_POST['name'];
$onco = $_POST['onco'];
$kind = $_POST['kind'];
$reso = $_POST['reso'];
$file = $_POST['file'];
$des1 = $_POST['des1'];
$des2 = $_POST['des2'];
$pic = $_POST['pic'];
$time1 = $_POST['time1'];
$time2 = $_POST['time2'];
$day = $_POST['day'];
$info = $_POST['info'];
$fullhtml = htmlentities($html);
//---variables from doloop----
$dir = $_POST['dir'];
$url = $_POST['url'];
$start = '1';
$del = 'Usually Space or Underscore';
$exp = 'No';
$delvalue = '5';

$files = glob($dir . '{*.mkv,*.png,*.jpeg,*.gif}', GLOB_BRACE);
$torrents = glob($dir . '{*.torrent}', GLOB_BRACE);
$ep = "$start";
$count = count($torrents);
$torrent = $torrents[$count-1];
//---variables from screen----
$mtn = 'C:\xampp\htdocs\test postgen.php\mtn\mtn';
$font = 'C:\xampp\htdocs\test postgen.php\mtn\Cyberbit.ttf';
$indir = $indirgood ;
$infile = $_POST['infile'];
$width = $_POST['width'];
$rows = $_POST['rows'];
$columns = $_POST['columns'];
$omit = '300';
$time = '200';
$url = $_POST['url'];
$filename = basename("$infile", ".mkv");
$imagename = $filename."_s.jpg";
$fulllink = "$url$dir$imagename";

$command = '' . $mtn . ' -O "' . $dir . '" -r ' . $rows . ' -c ' . $columns . ' -w ' . $width . ' -E ' . $omit . ' -s ' . $time . ' -f "' . $font . '" -T "AnimeOut" "'. $dir . $infile .'" 2>&1"';
$output = shell_exec('$command');
$whoami = shell_exec("whoami");

//----if codes postgen----

if ($onco == 'completed')
{

$sortof = '- Completed Anime ' . $kind . '';
}

elseif ($onco == 'ongoing')
{

$sortof = '- Ongoing Anime '. $kind . '';
};


if ($onco == 'completed')
{

$release = '' . $name . ' is a released Anime ' . $kind .' on AnimeOut';
}

elseif ($onco == 'ongoing')
{

$release = '' . $name . ' releases at ' . $time1 .  ' to ' . $time2 . ' on ' . $day . ' on AnimeOut';
};


$test = explode(':' , $des2);

if(strpos($des2 , 'Type:') !== false)
{

$maldes = 'Type: ' . $test[1] . '<br> Episodes: ' . $test[2] . '<br> Status: ' . $test[3] . '<br> Aired: ' . $test[4] . '<br> Producers: ' . $test[5] . '<br> Genres: ' . $test[6] . '<br> Duration: ' . $test[7] . '<br> Rating: ' . $test[8];
};


//----if/foreach codes doloop----

foreach($files as $ind_file)
{

if($exp=="Yes")
{

$filename= explode("$del", $ind_file);
 
$doloop = htmlentities ("Episode $filename[$delvalue] : <a href=\"$url$ind_file\">Direct Download</a> | <a href=\"$url$torrent\">Torrent</a>")."<br />";
$ep;
}

else
{
$doloop = htmlentities ("Episode $ep : <a href=\"$url$ind_file\">Direct Download</a> |  <a href=\"$url$torrent\">Torrent</a>")."<br />";
$ep;
};

};


//-----if codes for screen----

if(strpos($dir , 'series/') !== false)
{

$indirgood = '\\' . $dir;
};


//----post html outcome----

$html =

'<h1 style="text-align: center;">
'
. $name . ' ' . $reso . ' - ' . $sortof . '
</h1>

<h2 style="text-align: center;">
'
. $name . ' - ' . $reso . ' - ' . $file . ' Encoded ' . $kind . '
</h2>

<h3 style="text-align: center;">
'
. $name . ' ' . $info . ' Direct Download - ' . $reso . ' ' . $kind . ' encoded to ' . $reso . ' in ' . $file . ' Size - With Torrent Download
</h3>

<center>
    <img class="aligncenter" src="'
. $pic . '" alt="' . $name . '' . $info . ' Direct Download - AnimeOut" />
</center>

<p style="text-align: center;">
'
. $des1 . '
</p>

<div style="text-align: center;">
'
. $maldes . '
</div>


<div style="text-align: center;">
    <center>
    <img src="'
. $fulllink . '" alt="' . $name . '' . $info . ' (Latest 1) (' . $reso . ' - ' . $file . ' - Encoded)" />
    </center>
</div>
<h3 style="text-align: center;">
    <strong>
    Direct-Download Links | Torrent Links for '
. $name . ' ' . $info . ' miniHD Encodes
    </strong>
</h3>
<p style="text-align: center;">
    <strong>
'
. $doloop . '
    </strong>
</p>
<p style="text-align: center;">
------------------------------------------------------------------------------------------
</p>
<p style="text-align: center;">
    <em>
        <span style="color: #008000;">
            <strong>
                '
. $release . '
            </strong>
        </span>
    </em>
</p>
'
;

//----html output program code----

$fullhtml = htmlentities($html);

if($_POST['submit'] == 'submit')
{

echo
'<font size="6" color="GREEN">
    <center>
        <b>
            <u>
            Copy this html code to wordpress:
            </u>
        </b>
    </center>
</font>
<p>
<p>
'
. $fullhtml . '
<p>
<p>
<p>
<font size="6" Color="GREEN">
    <center>    
        <b>
            <u>
            META/SEO/Tag DATA:
            </u>
        </b>
    </center>
</font>
<br>
    <b>
    SEO title:
    </b>
<br>

'
. $name . ' (' . $kind . ') (' . $file . ') • ' . $reso . ' ' . $kind . ' Anime DirectDownload - AnimeOut
<br>
    <b>
    META DATA:
    </b>
<br>

'
. $name . ' anime (' . $kind . ') (' . $file . ') ' . $reso . ' Anime ' . $kind . ' for DirectDownload and Torrent Download from AnimeOut

<br>
    <b>
    TAG:
    </b>
<br>
    
'
. $reso . ', ' . $file . ', ' . $name . ' , ' . $name . ' direct download, ' . $name . ' direct download ' . $kind . ', ' . $name . ' direct download ' . $kind . ' ' . $reso . ' ' . $file . ', ' . $name . ' torrent download



<P>
<P>
<P>
<P>
<font size="6" color="GREEN">
    <center>
        <b>
            <u>
            Preview of the POST:
            </u>
        </b>
    </center>
</font>
<p>
<p>
'
. $html;
}

else
{
echo '';
};


//-----debug window only for editors-----
if($_POST['submit'] == 'submit')
{

echo '<br><br>indirgood path:' . $indirgood . '<p>';
echo '<br><br>indir path:' . $indir . '<p>';
echo '<br><br>dir path:' . $dir . '<p>';
echo "<p><center><b> screen debug</b></center>
$command <br /><br />Conversion Success<br /><br />
Converted image is $fulllink <br /><br />$output<br /><br />
<img src=\"$fulllink\"></img><p>"
;

foreach($files as $ind_file)
{

if($exp=="Yes")
{

$filename= explode("$del", $ind_file);
 
echo htmlentities("Episode $filename[$delvalue] : <a href=\"$url$ind_file\">Direct Download</a> | <a href=\"$url$torrent\">Torrent</a>")."<br />";
$ep++;
}

else
{
echo htmlentities("Episode $ep : <a href=\"$url$ind_file\">Direct Download</a> |  <a href=\"$url$torrent\">Torrent</a>")."<br />";
$ep++;
}

}




$files2 = array_diff(scandir($dir), array('.', '..', '.DS_Store'));
foreach($files2 as $nfile){
echo "<br /><br />$url$dir$nfile";

};
}

else
{
echo '';
};





?>


HTML (voor de formulier)
Quote:
<html>
<body>

<form method="POST" action="postgenv4.php">
<table border="1">
<tr>
<th>postgen</th><th>File location(for doloop & screen)</th> <th>Screenshot Gen(screen.php by shubhank)</th>
</tr>
<tr>
<td>
<form method="POST">
<b> Enter anime name here: </b>
<br>
<input type="text" name="name">
<p>
<b>enter info here(like: (Size, dual audio, resolution, etc.):
<br>
<input type="text" name="info">
<p>
<b> Ongoin or Completed?</b>
<br>
<input type="checkbox" name="onco" value="ongoing">ogoing</input> <br> <input type="checkbox" name="onco" value="completed">completed</input>
<p>
<b>If its a ongoing, on what time does it aprox releases?</b>
<br>
<input type="text" name="time1">
<br>
to
<br>
<input type="text" name="time2">
<br>
Day(just type for examplet Thuesday):
<br>
<input type="text" name="day">
<p>
<b> Movie, Ova, Serie or Special.</b>
<br>
<input type="checkbox" name="kind" value="movie"> Movie </input><input type="checkbox" name="kind" value="Ova">Ova</input><input type="checkbox" name="kind" value="serie">Serie</input><input type="checkbox" name="kind" value="special">Special</input>
<p>
<b> 480p or 720p?</b>
<br>
<select name="reso">
<option value="720p">720p</option>
<option value="480p">480p</option>
</select>
<p>
<b> Filesize: </b>
<br>
<input type="text" name="file">
<p>
<b>Description 1:</b>
<br>
<input type="textarea" name="des1">
<p>
<b>Description 2:</b>
<br>
<input type="textarea" name="des2">
<p>
<b>picture </b>
<br>
<input type="text" name="pic">
<p>
<input type="submit" value="submit" name="submit">


</td>


<td>


<input type="text" name="dir" style="width:450px;height:30px" value="series/">** Folder path were you put your anime.
<br>
<input type="text" name="url" style="width:450px;height:30px" value="http://sv4.animeout.com/" />** URL of page(server were anime is stored).
<br>
<input type="text" name="infile" style="width:450px;height:30px" value="[AnimeOut]" />*Input Filename(needed for screenshot).
<input type="submit" value="submit" name="submit">

</td>

<td>

<input type="text" name="width" style="width:450px;height:30px" value="1280" />*Width of Output Image
<br>
<input type="text" name="rows" style="width:450px;height:30px" value="3" />*Rows
<br>
<input type="text" name="columns" style="width:450px;height:30px" value="1" />*Columns
<input type="submit" value="submit" name="submit">

</td>
</tr>
<tr>
<td>
<center>
<font size="4" color="RED"> Create Post</font>
<input type="submit" value="submit" name="submit">
</center>
</td>
</tr>
</tabel>
</form>'

</body>
</html>


Originele PHP script voor het screenshot programma:
Quote:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php

echo "<form method=\"post\">
    <input type=\"text\" name=\"mtn\" style='width:450px;height:30px' value=\"./mtn\"/>*MTN Path
    <br/>
    <input type=\"text\" name=\"font\" style='width:450px;height:30px' value=\"./Cyberbit.ttf\" />*TTF Font File Path
    <br/>
    <input type=\"text\" name=\"indir\" style='width:450px;height:30px' value=\"series/\"/>*Input Directory with trailing slash
    <br/>
    <input type=\"text\" name=\"infile\" style='width:450px;height:30px' value=\"[AnimeOut] \" />*Input Filename
    <br/>
    <input type=\"text\" name=\"width\" style='width:450px;height:30px' value=\"1280\"/>*Width of Output Image
    <br/>
    <input type=\"text\" name=\"rows\" style='width:450px;height:30px' value=\"3\" />*Rows
    <br/>
    <input type=\"text\" name=\"columns\" style='width:450px;height:30px' value=\"1\"/>*Columns
    <br/>
    <input type=\"text\" name=\"omit\" style='width:450px;height:30px' value=\"300\" />*Omit seconds from beginning
    <br/>
    <input type=\"text\" name=\"time\" style='width:850px;height:30px' value=\"200\" /> *Duration between each shot<br/>
        <input type=\"text\" name=\"url\" style='width:850px;height:30px' value=\"http://download.animeout.com/\" /> *URL of This Dir with Trailing Slash<br/>
        <input type=\"submit\" name=\"submit\"/>
    </form>"
;
    
$mtn= $_POST['mtn'];
$font= $_POST['font'];
$indir= $_POST['indir'];
$infile= $_POST['infile'];
$width= $_POST['width'];
$rows= $_POST['rows'];
$columns= $_POST['columns'];
$omit= $_POST['omit'];
$time= $_POST['time'];
$url= $_POST['url'];
$filename= basename("$infile", ".mkv");
$imagename= $filename."_s.jpg";
$fulllink= "$url$indir$imagename";


$command = "$mtn -O \"$indir\" -r $rows -c $columns -w $width -E $omit -s $time -f \"$font\" -T \"AnimeOut\" \"$indir/$infile\" 2>&1";




 
$output = shell_exec("$command");
$whoami = shell_exec("whoami");
echo "$command <br /><br />Conversion Success<br /><br />
Converted image is $fulllink <br /><br />$output<br /><br />
<img src=\"$fulllink\"></img>"
;


?>
 
PHP hulp

PHP hulp

24/11/2024 11:10:44
 
Frank Nietbelangrijk

Frank Nietbelangrijk

02/03/2013 11:59:03
Quote Anchor link
kun je even blokhaak-code-blokhaak boven je code zetten? en onderaan blokhaak /code blokhaak? bij de html
Gewijzigd op 02/03/2013 12:00:54 door Frank Nietbelangrijk
 
RareAMV Unknown

RareAMV Unknown

02/03/2013 13:40:39
Quote Anchor link
Frank Nietbelangrijk op 02/03/2013 11:59:03:
kun je even blokhaak-code-blokhaak boven je code zetten? en onderaan blokhaak /code blokhaak? bij de html


blokhaak?
 
Eddy E

Eddy E

02/03/2013 14:10:01
Quote Anchor link
[code]...[/code]
Gewijzigd op 02/03/2013 14:10:26 door Eddy E
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.