Alan News
Accueil > Technique > Synology Simple Host File

Synology Simple Host File

lundi 15 décembre 2014, par alan

Let’s say you like syology diskstations and particularly the DownloadStation application.
That you subscribe to a third-party download site, that permits the http SIMPLE authentication
(the form
You can write a custom host file in :
/usr/syno/synoman/webman/3rdparty/DownloadStation/hostscript/hosts/mysupersite directory.

"name" : "mysupersite",
"hostprefix" : "",
"displayname" :
"My Super Site",
"version" : "1.0",
"authentication" : "yes",
"module" : "mysupersite.php",
"class" : "SynoFileHostingMySuperSite",
"description" : "Premium or free account supported."

mysupersite.php :
/* Copyright (c) 2014 Alan Guegan. All rights reserved. */
class SynoFileHostingMySuperSite {
        public function 
__construct($Url$Username$Password$HostInfo) {
$this->Url $Url;
$this->Username $Username;
$this->Password $Password;
$this->HostInfo $HostInfo;
//This function returns download url.
public function GetDownloadInfo() {
$ret FALSE;
$ret $this->DownloadPremium($this->CookieValue);
//This function verifies and returns a ccount type.
public function Verify($ClearCookie)
//This function get premium download url.
private function DownloadPremium($CookieValue) {

        if (!empty(
$DownloadID[1])) {
$returl $DownloadID[1] . $this->Username ":" $this->Password "@" $DownloadID[2];
$DownloadInfo = array();
$DownloadInfo[DOWNLOAD_URL] = trim($returl);

Then you access the synology DSM, the DownloadStation application, ’configure’ in the lower bar, then ’File Hosting’. Your entry for ’mysupersite’ should be present in that list. Click on modify then enter your username & password.

Of course the official packaging method for those host files is the tar
go to your directory then

tar cvf INFO mysupersite.php

Then that is uploadable into your synology via your ’Add File Hosting site’ button



Répondre à cet article

SPIP | squelette | | Plan du site | Suivre la vie du site RSS 2.0