mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Move rss routes to their own route file
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
2019-02-24 DariusIII
|
||||
* Chg: Move rss routes to their own route file
|
||||
* Chg: Move RSS route out of authentification
|
||||
* Chg: Change routes handling for api and rss
|
||||
2019-02-22 DariusIII
|
||||
|
||||
@@ -72,11 +72,11 @@ class RssController extends BasePageController
|
||||
$rssToken = $this->userdata['api_token'];
|
||||
$maxRequests = $this->userdata->role->apirequests;
|
||||
} else {
|
||||
if (! $request->has('r')) {
|
||||
if (! $request->has('api_token')) {
|
||||
Utility::showApiError(100, 'API key is required for viewing the RSS!');
|
||||
}
|
||||
|
||||
$res = User::getByRssToken($request->input('r'));
|
||||
$res = User::getByRssToken($request->input('api_token'));
|
||||
|
||||
if ($res === null) {
|
||||
return response()->json(['error' => 'Invalid RSS token'], 403);
|
||||
|
||||
@@ -39,7 +39,7 @@ class RouteServiceProvider extends ServiceProvider
|
||||
|
||||
$this->mapWebRoutes();
|
||||
|
||||
//
|
||||
$this->mapRssRoutes();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,4 +70,18 @@ class RouteServiceProvider extends ServiceProvider
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/api.php'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "rss" routes for the application.
|
||||
*
|
||||
* These routes are typically stateless.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function mapRssRoutes()
|
||||
{
|
||||
Route::middleware(['api', 'auth:api'])
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/rss.php'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,6 +136,7 @@
|
||||
"rtconner/laravel-tagging": "^3.0",
|
||||
"smarty/smarty": "^3.1",
|
||||
"spatie/laravel-directory-cleanup": "^1.2",
|
||||
"spatie/laravel-feed": "^2.1",
|
||||
"spatie/laravel-fractal": "^5.3",
|
||||
"spatie/laravel-permission": "^2.12",
|
||||
"tunaabutbul/cloudflare-middleware": "^1.2",
|
||||
|
||||
Generated
+72
-1
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "2bb038c6329ef149ab0a4d7f30b2371e",
|
||||
"content-hash": "f71a4761addac08399fd0311cda48c1b",
|
||||
"packages": [
|
||||
{
|
||||
"name": "aharen/omdbapi",
|
||||
@@ -5990,6 +5990,77 @@
|
||||
],
|
||||
"time": "2019-01-18T16:32:41+00:00"
|
||||
},
|
||||
{
|
||||
"name": "spatie/laravel-feed",
|
||||
"version": "2.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/spatie/laravel-feed.git",
|
||||
"reference": "ee9aab3b33553e0f621ccd9c0cbc2016a5be73e5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/spatie/laravel-feed/zipball/ee9aab3b33553e0f621ccd9c0cbc2016a5be73e5",
|
||||
"reference": "ee9aab3b33553e0f621ccd9c0cbc2016a5be73e5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"laravel/framework": "~5.5.0|~5.6.0|~5.7.0",
|
||||
"nesbot/carbon": "^1.0",
|
||||
"php": "^7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"orchestra/testbench": "~3.5.0|~3.6.0|~3.7.0",
|
||||
"phpunit/phpunit": "^6.0|^7.0",
|
||||
"spatie/phpunit-snapshot-assertions": "^1.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Spatie\\Feed\\FeedServiceProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Spatie\\Feed\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Sebastian De Deyne",
|
||||
"email": "sebastian@spatie.be",
|
||||
"homepage": "https://spatie.be",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "Freek Van der Herten",
|
||||
"email": "freek@spatie.be",
|
||||
"homepage": "https://spatie.be",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "Jolita Grazyte",
|
||||
"email": "jolita@spatie.be",
|
||||
"homepage": "https://spatie.be",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "Generates rss feed",
|
||||
"homepage": "https://github.com/spatie/laravel-feed",
|
||||
"keywords": [
|
||||
"laravel",
|
||||
"laravel-feed",
|
||||
"rss",
|
||||
"spatie"
|
||||
],
|
||||
"time": "2018-08-27T15:07:12+00:00"
|
||||
},
|
||||
{
|
||||
"name": "spatie/laravel-fractal",
|
||||
"version": "5.4.3",
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
<ul>
|
||||
<li>
|
||||
Add this string to your feed URL to allow NZB downloads without logging in: <span
|
||||
style="font-family:courier;">&i={$userdata.id}
|
||||
&r={$userdata.api_token}</span>
|
||||
style="font-family:courier;">
|
||||
&api_token={$userdata.api_token}</span>
|
||||
</li>
|
||||
<li>
|
||||
To remove the nzb from your cart after download add this string to your feed URL: <span
|
||||
@@ -39,24 +39,24 @@
|
||||
<ul style="text-align: left;">
|
||||
<li>
|
||||
Full site feed<br/>
|
||||
<a href="{$smarty.const.WWW_TOP}/rss?t=0&dl=1&i={$userdata.id}&r={$userdata.api_token}">{$smarty.const.WWW_TOP}
|
||||
/rss?t=0&dl=1&i={$userdata.id}&r={$userdata.api_token}</a>
|
||||
<a href="{$smarty.const.WWW_TOP}/rss?t=0&dl=1&api_token={$userdata.api_token}">{$smarty.const.WWW_TOP}
|
||||
/rss?t=0&dl=1$amp;api_token={$userdata.api_token}</a>
|
||||
<br>You can define limit and num parameters, which will decide how much items to show and what offset to use (default values: limit 100 and offset 0).
|
||||
</li>
|
||||
<li>
|
||||
<a href="{$smarty.const.WWW_TOP}/cart/index">My cart</a> feed<br/>
|
||||
<a href="{$smarty.const.WWW_TOP}/rss?t=-2&dl=1&i={$userdata.id}&r={$userdata.api_token}&del=1">{$smarty.const.WWW_TOP}
|
||||
/rss?t=-2&dl=1&i={$userdata.id}&r={$userdata.api_token}&del=1</a>
|
||||
<a href="{$smarty.const.WWW_TOP}/rss?t=-2&dl=1&api_token={$userdata.api_token}&del=1">{$smarty.const.WWW_TOP}
|
||||
/rss?t=-2&dl=1$amp;api_token={$userdata.api_token}&del=1</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{$smarty.const.WWW_TOP}/myshows">My shows</a> feed<br/>
|
||||
<a href="{$smarty.const.WWW_TOP}/rss?t=-3&dl=1&i={$userdata.id}&r={$userdata.api_token}&del=1">{$smarty.const.WWW_TOP}
|
||||
/rss?t=-3&dl=1&i={$userdata.id}&r={$userdata.api_token}&del=1</a>
|
||||
<a href="{$smarty.const.WWW_TOP}/rss?t=-3&dl=1&api_token={$userdata.api_token}&del=1">{$smarty.const.WWW_TOP}
|
||||
/rss?t=-3&dl=1$amp;api_token={$userdata.api_token}&del=1</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{$smarty.const.WWW_TOP}/mymovies">My movies</a> feed<br/>
|
||||
<a href="{$smarty.const.WWW_TOP}/rss?t=-4&dl=1&i={$userdata.id}&r={$userdata.api_token}&del=1">{$smarty.const.WWW_TOP}
|
||||
/rss?t=-4&dl=1&i={$userdata.id}&r={$userdata.api_token}&del=1</a>
|
||||
<a href="{$smarty.const.WWW_TOP}/rss?t=-4&dl=1$amp;api_token={$userdata.api_token}&del=1">{$smarty.const.WWW_TOP}
|
||||
/rss?t=-4&dl=1$amp;api_token={$userdata.api_token}&del=1</a>
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Parent Category</h3>
|
||||
@@ -64,8 +64,8 @@
|
||||
{foreach $parentcategorylist as $category}
|
||||
<li>
|
||||
{$category.title} feed <br/>
|
||||
<a href="{$smarty.const.WWW_TOP}/rss?t={$category.id}&dl=1&i={$userdata.id}&r={$userdata.api_token}">{$smarty.const.WWW_TOP}
|
||||
/rss?t={$category.id}&dl=1&i={$userdata.id}&r={$userdata.api_token}</a>
|
||||
<a href="{$smarty.const.WWW_TOP}/rss?t={$category.id}&dl=1$amp;api_token={$userdata.api_token}">{$smarty.const.WWW_TOP}
|
||||
/rss?t={$category.id}&dl=1$amp;api_token={$userdata.api_token}</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
@@ -75,8 +75,8 @@
|
||||
{if !empty($category.title)}
|
||||
<li>
|
||||
{$category.title} feed <br/>
|
||||
<a href="{$smarty.const.WWW_TOP}/rss?t={$category.id}&dl=1&i={$userdata.id}&r={$userdata.api_token}">{$smarty.const.WWW_TOP}
|
||||
/rss?t={$category.id}&dl=1&i={$userdata.id}&r={$userdata.api_token}</a>
|
||||
<a href="{$smarty.const.WWW_TOP}/rss?t={$category.id}&dl=1$amp;api_token={$userdata.api_token}">{$smarty.const.WWW_TOP}
|
||||
/rss?t={$category.id}&dl=1$amp;api_token={$userdata.api_token}</a>
|
||||
</li>
|
||||
{/if}
|
||||
{/foreach}
|
||||
@@ -85,27 +85,27 @@
|
||||
<ul style="text-align: left;">
|
||||
<li>
|
||||
Multiple categories separated by comma.<br/>
|
||||
<a href="{$smarty.const.WWW_TOP}/rss?t={$catClass::MOVIE_ROOT},{$catClass::MUSIC_MP3}&dl=1&i={$userdata.id}&r={$userdata.api_token}">{$smarty.const.WWW_TOP}
|
||||
/rss?t={$catClass::MOVIE_ROOT},{$catClass::MUSIC_MP3}&dl=1&i={$userdata.id}
|
||||
&r={$userdata.api_token}</a>
|
||||
<a href="{$smarty.const.WWW_TOP}/rss?t={$catClass::MOVIE_ROOT},{$catClass::MUSIC_MP3}&dl=1$amp;api_token={$userdata.api_token}">{$smarty.const.WWW_TOP}
|
||||
/rss?t={$catClass::MOVIE_ROOT},{$catClass::MUSIC_MP3}&dl=1
|
||||
&api_token={$userdata.api_token}</a>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>Additional Feeds</h2>
|
||||
<ul style="text-align: left;">
|
||||
<li>
|
||||
Tv Series (Use the TVRage ID)<br/>
|
||||
<a href="{$smarty.const.WWW_TOP}/rss?show={$show}&dl=1&i={$userdata.id}&r={$userdata.api_token}">{$smarty.const.WWW_TOP}
|
||||
/rss?show={$show}&dl=1&i={$userdata.id}&r={$userdata.api_token}</a>
|
||||
<a href="{$smarty.const.WWW_TOP}/rss?show={$show}&dl=1&api_token={$userdata.api_token}">{$smarty.const.WWW_TOP}
|
||||
/rss?show={$show}&dl=1$amp;api_token={$userdata.api_token}</a>
|
||||
</li>
|
||||
<li>
|
||||
Tv Series aired in last seven days (Using the Video ID and airdate)<br/>
|
||||
<a href="{$smarty.const.WWW_TOP}/rss?show={$show}&airdate=7&dl=1&i={$userdata.id}&r={$userdata.api_token}">{$smarty.const.WWW_TOP}
|
||||
/rss?show={$show}&airdate=7&dl=1&i={$userdata.id}&r={$userdata.api_token}</a>
|
||||
<a href="{$smarty.const.WWW_TOP}/rss?show={$show}&airdate=7&dl=1$amp;api_token={$userdata.api_token}">{$smarty.const.WWW_TOP}
|
||||
/rss?show={$show}&airdate=7&dl=1$amp;api_token={$userdata.api_token}</a>
|
||||
</li>
|
||||
<li>
|
||||
Anime Feed (Use the AniDB ID)<br/>
|
||||
<a href="{$smarty.const.WWW_TOP}/rss?anidb={$anidb}&dl=1&i={$userdata.id}&r={$userdata.api_token}">{$smarty.const.WWW_TOP}
|
||||
/rss?anidb={$anidb}&dl=1&i={$userdata.id}&r={$userdata.api_token}</a>
|
||||
<a href="{$smarty.const.WWW_TOP}/rss?anidb={$anidb}&dl=1&api_token={$userdata.api_token}">{$smarty.const.WWW_TOP}
|
||||
/rss?anidb={$anidb}&dl=1&api_token={$userdata.api_token}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| RSS Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| RSS feed routes
|
||||
|
|
||||
*/
|
||||
|
||||
Route::get('rss', 'RssController@rss');
|
||||
Route::post('rss', 'RssController@rss');
|
||||
Reference in New Issue
Block a user