[Release] Simple downloader

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
gargamon Offline
Junior Member
Posts: 20
Joined: Jun 2013
Reputation: 0
Post: #76
Is there any any way to set the linux file permissions when downloading media from youtube? The files I get are readable by owner and group but not globally. This makes it cumbersome to access the files later. I'm downloading to a NAS via NFS. The umask of the user that is running XBMC is 022 so should be readable globally.
find quote
JUL1EN094 Offline
Junior Member
Posts: 2
Joined: Mar 2013
Reputation: 0
Post: #77
Hi,

I implemented simple.downloader in one of my addon and it's working well Big Grin

Do you know if is it possible to send specific cookie header to the downloader ? Ever by sending this kind of url (http://.....mp4|Cookie=) or by sending it in params ?

For testing, I modified _downloadURL code to send it in params and it's working well

Code:
def _downloadURL(self, filename, item):
        self.common.log(filename)

        url = urllib2.Request(item["url"])
        if "useragent" in item:
            url.add_header("User-Agent", item["useragent"])
        else:
            url.add_header("User-Agent", self.common.USERAGENT)
        if "cookie" in item:
            if item["cookie"]!=False  :
                url.add_header("Cookie", item["cookie"])

        file = self.common.openFile(item["path_incomplete"], "wb")
        con = urllib2.urlopen(url)

Thank you
find quote
Post Reply