[Galaxy S 4 Mini General] BioGenX:
When this project reaches it's final form. We should ask for a volunteer to host the server files because i can't run my wget script on my free host to get androidfilehost direct links.

For now i patched together a way to do this on my OPENWRT router and pass directdownload links to the ota server.

Still implementing this so androidfilehost ota is not online for now. ETA ~6 hours.

How i get links from androidfilehost.com. Example:

1. download as html> https://www.androidfilehost.com/?w=files&flid=26595

2. get file name and MD5 from source.

3. get latest build link > https://www.androidfilehost.com/?fid=23991606952615320

4. get fid from link > 23991606952615320

5. run >

wget "https://www.androidfilehost.com/libs/otf/mirrors.otf.php" --referer="https://www.androidfilehost.com" --post-data="submit=submit&action=getdownloadmirrors&fid=""$p" -O "raw.json" --no-check-certificate -q

6. get response with mirror links >

{"STATUS":"1","CODE":"200","MESSAGE":"success, #winning","MIRRORS":[{"mid":"99","name":"Quebec, Canada #4","abbrev":"QC4","address":"http:\/\/qc4.androidfilehost.com","path":"","mirror_status":"1","selectable":"1","archive":"1","weight":"7","type":"1","url":"http:\/\/qc4.androidfilehost.com\/dl\/gATuBpVoGPRx9xOIXw78Ng\/1433800405\/23991606952615320\/aicp_serranodsdd_lp-9.0-UNOFFICIAL-20150606.zip"},{"mid":"89","name":"California, USA","abbrev":"CA1","address":"http:\/\/ca1.androidfilehost.com","path":"","mirror_status":"1","selectable":"1","archive":"1","weight":"1","type":"1","url":"http:\/\/ca1.androidfilehost.com\/dl\/gATuBpVoGPRx9xOIXw78Ng\/1433800405\/23991606952615320\/aicp_serranodsdd_lp-9.0-UNOFFICIAL-20150606.zip"},{"mid":"90","name":"Quebec, Canada #1","abbrev":"QC1","address":"http:\/\/qc1.androidfilehost.com","path":"","mirror_status":"1","selectable":"1","archive":"1","weight":"9","type":"1","url":"http:\/\/qc1.androidfilehost.com\/dl\/gATuBpVoGPRx9xOIXw78Ng\/1433800405\/23991606952615320\/aicp_serranodsdd_lp-9.0-UNOFFICIAL-20150606.zip"},{"mid":"97","name":"Quebec, Canada #2","abbrev":"QC2","address":"http:\/\/qc2.androidfilehost.com","path":"","mirror_status":"1","selectable":"1","archive":"1","weight":"7","type":"1","url":"http:\/\/qc2.androidfilehost.com\/dl\/gATuBpVoGPRx9xOIXw78Ng\/1433800405\/23991606952615320\/aicp_serranodsdd_lp-9.0-UNOFFICIAL-20150606.zip"},{"mid":"98","name":"Quebec, Canada #3","abbrev":"QC3","address":"http:\/\/qc3.androidfilehost.com","path":"","mirror_status":"1","selectable":"1","archive":"1","weight":"7","type":"1","url":"http:\/\/qc3.androidfilehost.com\/dl\/gATuBpVoGPRx9xOIXw78Ng\/1433800405\/23991606952615320\/aicp_serranodsdd_lp-9.0-UNOFFICIAL-20150606.zip"},{"mid":"71","name":"Texas, USA #1","abbrev":"TX1","address":"http:\/\/tx1.androidfilehost.com","path":"","mirror_status":"1","selectable":"1","archive":"1","weight":"3","type":"1","url":"http:\/\/tx1.androidfilehost.com\/dl\/gATuBpVoGPRx9xOIXw78Ng\/1433800405\/23991606952615320\/aicp_serranodsdd_lp-9.0-UNOFFICIAL-20150606.zip"},{"mid":"70","name":"Texas, USA #2","abbrev":"TX2","address":"http:\/\/tx2.androidfilehost.com","path":"","mirror_status":"1","selectable":"1","archive":"1","weight":"3","type":"1","url":"http:\/\/tx2.androidfilehost.com\/dl\/YYiUi_e3kUOf5UJ2yt9wWg\/1433800406\/23991606952615320\/aicp_serranodsdd_lp-9.0-UNOFFICIAL-20150606.zip"},{"mid":"96","name":"(Europe) France","abbrev":"FR1","address":"http:\/\/fr1.androidfilehost.com","path":"","mirror_status":"1","selectable":"0","archive":"1","weight":"1","type":"1","url":"http:\/\/fr1.androidfilehost.com\/dl\/XdL3x5eH4dW8YEgFnzzknA\/1433800404\/23991606952615320\/aicp_serranodsdd_lp-9.0-UNOFFICIAL-20150606.zip"},{"mid":"100","name":"(Europe) Germany","abbrev":"DE1","address":"https:\/\/de1.androidfilehost.com","path":"","mirror_status":"1","selectable":"0","archive":"1","weight":"1","type":"1","url":"https:\/\/de1.androidfilehost.com\/dl\/gATuBpVoGPRx9xOIXw78Ng\/1433800405\/23991606952615320\/aicp_serranodsdd_lp-9.0-UNOFFICIAL-20150606.zip"}]}

7. Get direct download link from first mirror as it is the primary one (extra dashes are removed by OTA app) >

http:\/\/qc4.androidfilehost.com\/dl\/gATuBpVoGPRx9xOIXw78Ng\/1433800405\/23991606952615320\/aicp_serranodsdd_lp-9.0-UNOFFICIAL-20150606.zip

8. Pass info to OTA app as I explained in the first post.

As far as I researched you can't implement a similar function to wget's --referer in PHP or java.

The mirror generator from androidfilehost.com listens for file id request and outputs mirrors but ONLY if the request comes from androidfilehost.com (user clicks Get mirror on androidfilehost.com > the website sends request, gets and shows response).

The --referer flag gets androidfilehost.com's headers and passes them with the request.

Cheers!