mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-23 19:50:40 -05:00
(Update) TorrentController
Fix the encoding routine to encode with rsskey authenticated user. Tested in real clients rss feeds.
This commit is contained in:
@@ -872,11 +872,13 @@ class TorrentController extends Controller
|
||||
*/
|
||||
public function download($slug, $id, $rsskey = null)
|
||||
{
|
||||
|
||||
$user = auth()->user();
|
||||
if (! $user && $rsskey) {
|
||||
if (!$user && $rsskey) {
|
||||
$user = User::where('rsskey', '=', $rsskey)->firstOrFail();
|
||||
}
|
||||
|
||||
|
||||
$torrent = Torrent::withAnyStatus()->findOrFail($id);
|
||||
|
||||
// User's ratio is too low
|
||||
@@ -912,7 +914,7 @@ class TorrentController extends Controller
|
||||
}
|
||||
// Get the content of the torrent
|
||||
$dict = Bencode::bdecode(file_get_contents(getcwd().'/files/torrents/'.$torrent->file_name));
|
||||
if (auth()->check()) {
|
||||
if (auth()->check() || ($rsskey && $user)) {
|
||||
// Set the announce key and add the user passkey
|
||||
$dict['announce'] = route('announce', ['passkey' => $user->passkey]);
|
||||
// Remove Other announce url
|
||||
|
||||
Reference in New Issue
Block a user