Skip to content

Commit

Permalink
Update hmf.py
Browse files Browse the repository at this point in the history
The check valid url method is doign a GET request which is causing large files to be downloaded in the background. Kodiplayer is also downloading the same file to diaplay, so end up with two processes pulling the same large file causing wasted bandwidth.
Doing a HEAD request achieves the valid file check while not downloading the entire file
  • Loading branch information
Gujal00 committed Aug 26, 2019
1 parent 0c292ec commit a686c82
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/resolveurl/hmf.py
Expand Up @@ -256,6 +256,8 @@ def __test_stream(self, stream_url):
try:
msg = ''
request = urllib2.Request(stream_url.split('|')[0], headers=headers)
# only do a HEAD request. gujal
request.get_method = lambda : 'HEAD'
# set urlopen timeout to 15 seconds
http_code = urllib2.urlopen(request, timeout=15).getcode()
except urllib2.URLError as e:
Expand Down

0 comments on commit a686c82

Please sign in to comment.