From fbe671aff76a6adb6c589f2b974d2e0fbab426c5 Mon Sep 17 00:00:00 2001 From: iamkroot Date: Sat, 18 Apr 2020 09:01:25 +0530 Subject: [PATCH] Enable downloading HTTPS links --- README.md | 3 --- downloader.py | 5 ++--- pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4f675b8..1351093 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,3 @@ The range pattern follows the format of Python Slices. You can also specify multiple ranges using commas. `12, 4:6, 15:, :2` will download lectures 1, 4, 5, 12, 15, 16, 17, ... until the latest one. - -## Authors -* [Krut Patel](https://github.com/iamkroot) diff --git a/downloader.py b/downloader.py index 928b0e4..268e29e 100644 --- a/downloader.py +++ b/downloader.py @@ -5,7 +5,7 @@ from http.server import HTTPServer, SimpleHTTPRequestHandler from multiprocessing.dummy import Process from pathlib import Path -from urllib.parse import quote, parse_qsl, urlparse +from urllib.parse import quote import requests from utils import find_startswith, sp_args @@ -114,7 +114,6 @@ def extract_enc_keys(angle_pls: list, token): if not line.startswith("#EXT-X-KEY"): continue key_url = PAT.search(line)["key_url"] - key_info = dict(parse_qsl(urlparse(key_url).query)) orig_key = sess.get(key_url).content real_key = orig_key[::-1][:16] path_uri = DirServer.get_url(real_key, ".key", "wb") @@ -127,7 +126,7 @@ def add_inputs(token, cmd, angle_playlists, angle): "-allowed_extensions", "key,m3u8,ts", "-protocol_whitelist", - "file,http,tcp,tls,crypto", + "file,http,https,tcp,tls,crypto", ) if angle > len(angle_playlists): print( diff --git a/pyproject.toml b/pyproject.toml index 3548d2c..6efdbc3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "ilc-scraper" -version = "0.6.3" +version = "0.6.4" description = "A scraper for Impartus Lecture Capture videos for BITS Hyderabad" authors = ["iamkroot "] readme = "README.md"