-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubtitle.php
More file actions
executable file
·28 lines (28 loc) · 1.4 KB
/
subtitle.php
File metadata and controls
executable file
·28 lines (28 loc) · 1.4 KB
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
<?php
require_once('config.php');
require_once('user.php');
$loginPolicy = IsLogin();
if ($loginPolicy === null) {
RedirectLogin();
}
if (!$loginPolicy[2]['AllowDownloadFontArchive'] && !$loginPolicy[2]['AllowDownloadSubsetSubtitle'] && !$loginPolicy[2]['AllowDownloadSubsetSubtitleWithSeparateFont']) {
dieHTML(":(", 'Subtitle');
}
$filename = 'Content.ass';
$filehash = 'Unknown';
$t = time();
$sign = GenerateSign($loginPolicy[0], $loginPolicy[1], 0, $t, $filename, $filehash);
HTMLStart('Subtitle', GetUserBar($loginPolicy[0], $loginPolicy[1], $loginPolicy[2]['AllowLogout']));
echo <<<html
<script src="base64.js"></script>
<script>function Convert() { let content = document.getElementById('file').value; if (content === null || content === '') { alert('坏内容!'); return false; } document.forms[0].children[0].value = Base64.encode(content); return true; }</script>
<label for="file">ASS 字幕内容:</label>\n<br>
<textarea id="file" spellcheck="false" autocomplete="off" style="width: 100%; height: 600px; box-sizing: border-box;"></textarea>
<form id="subtitleForm" method="POST" onsubmit="return Convert();" action="download.php?source={$loginPolicy[0]}&uid={$loginPolicy[1]}&torrent_id=0&time={$t}&sign={$sign}&filename={$filename}&upload_subtitle=1">
<input type="hidden" name="file" value="" />
<button type="submit" style="margin-top: 8px;">上传</button>
</form>
html;
echo "\n";
HTMLEnd();
?>