KA Lite Video Download Error

I have been unsuccessful downloading any videos in KA Lite. I’m running the KA Lite server on Windows Server 2012 standard. The application of KA Lite is in a prison environment and the computer I’m using to download the videos to is called the Update Server and it will only be used to download the videos online and transport them into the prison where they will be copied over to another server that will serve KA Lite to student workstations.

When I try to download videos, the progress display shows downloading is occurring but after its complete, there are no videos on the hard drive and when I click on a video link in the download window, an error message like “Download error: Forbidden 403” is displayed. Any ideas on what is wrong? Thanks, Neil

Hi Neil,

Thanks for reaching out! Sounds like a really good project!! :slight_smile:

I can’t say that our services are down – they’re working for me.

One possible cause would be if you are somehow not downloading from the content server. For instance, if some network device is stopping you. Try investigating if you can access video contents directly?

http://s3.amazonaws.com/KA-youtube-converted/tJrSILRXOUc.mp4/tJrSILRXOUc.mp4

Benjamin,

Thanks for the response. I copied your link into the browser and the video did play. I am on a school district network that does restrict some downloads - is it possible that such a restriction would not show up immediately on starting a download but cause a failure at the end of the download? The browser URL on the download window is http://127.0.0.1:8008/update/videos/.

If you can visit the link at the exact same time using the exact same computer as you’re downloading it from with KA Lite, it’s strange.

You wouldn’t happen to be running some customized local settings.py file? (if you don’t know what I’m talking about, you’re probably not)

Also, what version of KA Lite are you using?

I wonder if the school district is using a proxy that is looking for a standard user agent string in the request. I just tested from a pi install and see that there is no user agent passed when the backend kalite process downloads the videos. A 403 would be a standard response from a squid proxy.

kalite backend request:
GET /download/videos/PEeUTQ0Gri8.mp4/PEeUTQ0Gri8.mp4 HTTP/1.1
Host: kalite.learningequality.org
Connection: keep-alive
Accept-Encoding: gzip, deflate
Accept: /

firefox request:
GET /download/videos/PEeUTQ0Gri8.mp4/PEeUTQ0Gri8.mp4 HTTP/1.1
Host: kalite.learningequality.org
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Connection: keep-alive
Upgrade-Insecure-Requests: 1

Thanks for that, @jskiba99 - if this is indeed the case, we should open up an issue on Github. Adding a header to the download request is easily done!

That first example was from a pi. Here is a sample request from a new install on a 2k12 windows box. There’s a unique user agent from that request.

GET /download/videos/y2-uaPiyoxc.mp4/y2-uaPiyoxc.mp4 HTTP/1.1
Host: kalite.learningequality.org
Content-Length: 0
Accept-Encoding: gzip, deflate, compress
Accept: /
User-Agent: ka-lite/0.16.9 python-requests/1.1.0 CPython/2.7.10 Windows/2012Server

Looked at the code: We use requests.get in order to download and we explicitly set the user-agent since 0.16.6 at least:

It’s quite strange that you can sniff out an HTTP request where the header is removed, is it an older version of KA Lite or could there be other things at play?

I’m not sure of the KA Lite version number but it was downloaded within the last two weeks; however I am finally having some success downloading the videos.

I contacted the school district administrator and she gave me a browser login that was not filtered and so far, the videos are downloading as they should.

Thanks to all for the help.

1 Like

Ah yes, sorry I still have 0.16.6post1 on the pi 3 which didn’t yet include the user agent fix.

@jskiba99 - is your issue related, it sounds like a separate issue? Is your problem downloading due to a missing user-agent header?

@benjamin - I didn’t have a problem download, I was just trying to help troubleshoot for gallag99. On my pi install the version.py was still the old one that didn’t have the return statement

I may try a pi re-install today to just to confirm the latest pi installer works as expected.

Thanks

Thanks for clarifying, I guess we can now consider this resolved :slight_smile: