Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dl_coursera/Crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@ def _get_uid(s: str):
break

if not self._uid:
raise UserIDNotFoundException()
logging.warning("UserID not found in cookies, but ignoring as it seems unused.")
# raise UserIDNotFoundException()

def crawl(self, *, slug, is_spec):
if not self._loggedin:
Expand Down
7 changes: 6 additions & 1 deletion dl_coursera/DLTaskGatherer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import zipfile
import io
import logging
import re

from .lib.ExploringTree import ExploringTree

Expand All @@ -10,6 +11,8 @@
from .resource import load_resource
from .define import *

def _sanitize_filename(s):
return re.sub(r'[<>:"/\\|?*]', '_', s)

def _shorten_slug(x):
if len(x['slug']) > 40:
Expand Down Expand Up @@ -191,4 +194,6 @@ def _gather_cml(self, cml, i, supplement):
self._gather_asset(asset)

def _gather_asset(self, asset):
self._add_dl_task(asset['url'], self._see(asset['name']))
self._add_dl_task(
asset['url'], self._see(_sanitize_filename(asset['name']))
)