Upload files to "includes"
This commit is contained in:
parent
281bcaf36d
commit
74bae56f05
2 changed files with 134 additions and 0 deletions
29
includes/config.php
Normal file
29
includes/config.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
// AllDebrid API Configuration
|
||||
if (!defined('ALLDEBRID_API_KEY')) {
|
||||
define('ALLDEBRID_API_KEY', 'INSERT_ALLDEBRID_API_KEY_HERE');
|
||||
}
|
||||
if (!defined('ALLDEBRID_API_URL')) {
|
||||
define('ALLDEBRID_API_URL', 'https://api.alldebrid.com/v4/');
|
||||
}
|
||||
|
||||
// Rate limiting configuration
|
||||
if (!defined('REQUESTS_PER_SECOND_LIMIT')) {
|
||||
define('REQUESTS_PER_SECOND_LIMIT', 10); // 10 requests per second
|
||||
}
|
||||
if (!defined('REQUESTS_PER_MINUTE_LIMIT')) {
|
||||
define('REQUESTS_PER_MINUTE_LIMIT', 500); // 500 requests per minute
|
||||
}
|
||||
|
||||
// Start session if not already started
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
|
||||
// Initialize rate-limiting counters if they don't exist
|
||||
if (!isset($_SESSION['request_count_second'])) {
|
||||
$_SESSION['request_count_second'] = 0;
|
||||
$_SESSION['request_count_minute'] = 0;
|
||||
$_SESSION['last_request_time'] = time();
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue