help in getting working link
#1
hi.
i am trying to download files from www.myabandonware.com but i cant i down understand how to do it?
here is alink for example:
https://www.myabandonware.com/game/comma...7#download
in there there is download i understand that i need to post the correct header in order to download the file but i cant make it work.
please help.
thanks.
Reply
#2
(2017-09-27, 23:24)Ebs_1 Wrote: hi.
i am trying to download files from www.myabandonware.com but i cant i down understand how to do it?
here is alink for example:
https://www.myabandonware.com/game/comma...7#download
in there there is download i understand that i need to post the correct header in order to download the file but i cant make it work.
please help.
thanks.

Code:
<a href="/download/1d4-commander-keen-keen-dreams" class="button download" rel="nofollow">Download<span><img src="/media/img/lang/en.gif" alt="English version">  285 KiB</span></a>
http://www.pythonforbeginners.com/python...tifulsoup/
https://stackoverflow.com/questions/2267...ing-python
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#3
hi thanks for the replay.
but that direct link gives 404 error.
but if i press the button in the site the file downloads.
thanks for your help
Reply
#4
(2017-09-27, 23:33)Lunatixz Wrote:
(2017-09-27, 23:24)Ebs_1 Wrote: hi.
i am trying to download files from www.myabandonware.com but i cant i down understand how to do it?
here is alink for example:
https://www.myabandonware.com/game/comma...7#download
in there there is download i understand that i need to post the correct header in order to download the file but i cant make it work.
please help.
thanks.

Code:
<a href="/download/1d4-commander-keen-keen-dreams" class="button download" rel="nofollow">Download<span><img src="/media/img/lang/en.gif" alt="English version">  285 KiB</span></a>
http://www.pythonforbeginners.com/python...tifulsoup/
https://stackoverflow.com/questions/2267...ing-python

hi thanks for the replay.
but that direct link gives 404 error.
but if i press the button in the site the file downloads.
thanks for your help
Reply
#5
(2017-09-28, 00:04)Ebs_1 Wrote:
(2017-09-27, 23:33)Lunatixz Wrote:
(2017-09-27, 23:24)Ebs_1 Wrote: hi.
i am trying to download files from www.myabandonware.com but i cant i down understand how to do it?
here is alink for example:
https://www.myabandonware.com/game/comma...7#download
in there there is download i understand that i need to post the correct header in order to download the file but i cant make it work.
please help.
thanks.

Code:
<a href="/download/1d4-commander-keen-keen-dreams" class="button download" rel="nofollow">Download<span><img src="/media/img/lang/en.gif" alt="English version">  285 KiB</span></a>
http://www.pythonforbeginners.com/python...tifulsoup/
https://stackoverflow.com/questions/2267...ing-python

hi thanks for the replay.
but that direct link gives 404 error.
but if i press the button in the site the file downloads.
thanks for your help

because its a internal uri, not a url... you would need to attach the domain name to the link, ie
Code:
/download/1d4-commander-keen-keen-dreams
become
Code:
www.myabandonware.com/download/1d4-commander-keen-keen-dreams
then you need to try retrieving the redirected url not opening the page... I believe the command is urllib2.geturl(url) then download the returning url
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#6
(2017-09-28, 00:12)Lunatixz Wrote:
(2017-09-28, 00:04)Ebs_1 Wrote:
(2017-09-27, 23:33)Lunatixz Wrote:
Code:
<a href="/download/1d4-commander-keen-keen-dreams" class="button download" rel="nofollow">Download<span><img src="/media/img/lang/en.gif" alt="English version">  285 KiB</span></a>
http://www.pythonforbeginners.com/python...tifulsoup/
https://stackoverflow.com/questions/2267...ing-python

hi thanks for the replay.
but that direct link gives 404 error.
but if i press the button in the site the file downloads.
thanks for your help

because its a internal uri, not a url... you would need to attach the domain name to the link, ie
Code:
/download/1d4-commander-keen-keen-dreams
become
Code:
www.myabandonware.com/download/1d4-commander-keen-keen-dreams
then you need to try retrieving the redirected url not opening the page... I believe the command is urllib2.geturl(url) then download the returning url
no still nogo 404 error
import urllib,urllib2

print urllib2.urlopen("https://www.myabandonware.com/download/1d4-commander-keen-keen-dreams").geturl()
Reply
#7
(2017-09-28, 00:37)Ebs_1 Wrote:
(2017-09-28, 00:12)Lunatixz Wrote:
(2017-09-28, 00:04)Ebs_1 Wrote: hi thanks for the replay.
but that direct link gives 404 error.
but if i press the button in the site the file downloads.
thanks for your help

because its a internal uri, not a url... you would need to attach the domain name to the link, ie
Code:
/download/1d4-commander-keen-keen-dreams
become
Code:
www.myabandonware.com/download/1d4-commander-keen-keen-dreams
then you need to try retrieving the redirected url not opening the page... I believe the command is urllib2.geturl(url) then download the returning url
no still nogo 404 error
import urllib,urllib2

print urllib2.urlopen("https://www.myabandonware.com/download/1d4-commander-keen-keen-dreams").geturl()
Hm that's odd, I didn't notice any special handlers to aquire a redirect.

Requires further studies...

Sent from my SM-G935T
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#8
yup there is a block, its bypassable;however I don't' feel comfortable providing that data. There must be a reason they block direct access so you should probably respect the domains wishes. You could always reach out to them, explain your project and request access.
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#9
(2017-09-28, 00:37)Ebs_1 Wrote: no still nogo 404 error
import urllib,urllib2

print urllib2.urlopen("https://www.myabandonware.com/download/1d4-commander-keen-keen-dreams").geturl()

As this is a learning forum, here's a tip:
try add 'Http Header Referer', like this:
Code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib, urllib2, re, HTMLParser, os
import html5lib
from bs4 import BeautifulSoup

def msg(text):
    print(text)

def log(text):
    print(text)

def open_url(url, H=''):
    pg_source = ''
    req = urllib2.Request(url)
    req.add_header('User-Agent', 'Mozilla/5.0 (Windows NT 6.3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36')
    if H != '': req.add_header('Referer', H)
    try:
        response = urllib2.urlopen(req)
        pg_source = response.read().decode('utf-8' , 'ignore')
        #pg_source = response.read()
        response.close()
    except urllib2.URLError, e:
        if hasattr(e, 'code'):
            try:
                msg('HTTP error nº: ' + str(e.code) + ' \n' + str(e.reason) + '\n' + e.url)
                log('HTTP error nº: ' + str(e.code) + ' \n' + str(e.reason) + '\n' + e.url)
            except:
                msg('HTTP error nº: ' + str(e.code) + '\n' + e.url)
                log('HTTP error nº: ' + str(e.code) + '\n' + e.url)
        elif hasattr(e, 'reason'):
            msg(str(e.reason))
            log(str(e.reason))
    return pg_source

url = 'https://www.myabandonware.com/game/commander-keen-keen-dreams-1d7'
print open_url(url, H=url)
In my example, I set the header equal to url



But by looking at the urls in question, you can see that there is a pattern in the zip files:
Code:
--------- example 01
Url: https://www.myabandonware.com/game/commander-keen-keen-dreams-1d7
DOS Version
Button link: https://www.myabandonware.com/download/1d4-commander-keen-keen-dreams
Zip link: https://www.myabandonware.com/media/files/games/c/commander-keen-keen-dreams.zip

--------- example 02
Url: https://www.myabandonware.com/game/get-dexter-703
Atari ST ROM
Button link: https://www.myabandonware.com/download/i7q-get-dexter
Zip link: https://www.myabandonware.com/media/files/games/g/get-dexter_atari-st_0i7q.zip


--------- example 03
Url: https://www.myabandonware.com/game/007-licence-to-kill-kq
DOS Version
Button link: https://www.myabandonware.com/download/kp-007-licence-to-kill
Zip link: https://www.myabandonware.com/media/files/games/0-9/007-licence-to-kill.zip

Atari ST ROM
Button link: https://www.myabandonware.com/download/ikv-007-licence-to-kill
Zip link: https://www.myabandonware.com/media/files/games/0-9/007-licence-to-kill_atari-st_0ikv.zip

pattern:
DOS Version
Button link: https://www.myabandonware.com/download/kp-007-licence-to-kill
Zip link: https://www.myabandonware.com/media/files/games/0-9/007-licence-to-kill.zip

Atari ST ROM
Button link: https://www.myabandonware.com/download/ikv-007-licence-to-kill
Zip link: https://www.myabandonware.com/media/files/games/0-9/007-licence-to-kill_atari-st_0ikv.zip
Reply

Logout Mark Read Team Forum Stats Members Help
help in getting working link0