{"record":{"id":"5d82662e52d4a745","repo":"soimort/you-get","slug":"unknown-url-pattern","errorCode":null,"errorMessage":"Unknown url pattern","messagePattern":"Unknown url pattern","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/you_get/extractors/icourses.py","lineNumber":113,"sourceCode":"        playlist = public_course_playlist(url)\n        for video in playlist:\n            icourses_download(video[0], output_dir=output_dir, **kwargs)\n        return\n    elif 'coursestatic' in url:\n        course_page = get_content(url)\n        page_navi_vars = re.search(page_type_patt, course_page)\n\n        if page_navi_vars is None:  # type 2 shared course\n            video_list = icourses_playlist_new(url, course_page)\n        else:  # type 1 shared course\n            sec_page = get_content(ep.format(page_navi_vars.group(2), page_navi_vars.group(1)))\n            video_list = re.findall(resid_courseid_patt, sec_page)\n    elif 'viewCharacterDetail.action' in url or 'changeforVideo.action' in url:\n        page = get_content(url)\n        video_list = re.findall(resid_courseid_patt, page)\n\n    if not video_list:\n        raise Exception('Unknown url pattern')\n\n    for video in video_list:\n        video_url = change_for_video_ip.format(video[0], video[1])\n        sleep(random.Random().randint(0, 5))  # Prevent from blockage\n        icourses_download(video_url, output_dir=output_dir, **kwargs)\n\n\ndef icourses_playlist_new(url, page=None):\n    # 2 helpers using same interface in the js code\n    def to_chap(course_id, chap_id, mod):\n        ep = 'http://www.icourses.cn/jpk/viewCharacterDetail2.action?courseId={}&characId={}&mod={}'\n        req = post_content(ep.format(course_id, chap_id, mod), post_data={})\n        return req\n\n    def to_sec(course_id, chap_id, mod):\n        ep = 'http://www.icourses.cn/jpk/viewCharacterDetail2.action?courseId={}&characId={}&mod={}'\n        req = post_content(ep.format(course_id, chap_id, mod), post_data={})\n        return req","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/soimort/you-get/blob/049548f3f3f35e67ba8d3181c71fdc71d11cf260/src/you_get/extractors/icourses.py#L95-L131","documentation":"Raised as plain Exception in icourses_playlist_download (src/you_get/extractors/icourses.py:113). After routing the URL through its known branches (course listing pages with pagination, viewCharacterDetail.action, changeforVideo.action), none of them produced any (resId, courseId) video entries — video_list is empty — so the URL layout is unrecognized.","triggerScenarios":"Passing an icourses.cn URL whose path contains none of the known markers ('coursestatic'/'course_' listing, 'viewCharacterDetail.action', 'changeforVideo.action'), OR one of those pages whose HTML changed so re.findall(resid_courseid_patt, ...) returns nothing and the pagination regex also fails to match (page_navi_vars None AND the type-2 fallback yields no videos).","commonSituations":"icourses.cn site redesign breaking the regexes; new course page types; URLs with parameters/redirects landing on an unexpected page.","solutions":["Confirm the URL is one of the three known icourses page kinds and opens correctly in a browser.","Log course_page and check whether resid_courseid_patt still matches the HTML; if not, update the regexes for the new markup.","Upgrade you-get — icourses extractors are maintained against the live site."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"KNOWN_MARKERS = ('coursestatic', 'viewCharacterDetail.action', 'changeforVideo.action', 'showResDetail.action')\n\ndef icourses_url_plausibly_supported(url):\n    return any(m in url for m in KNOWN_MARKERS) or re.match(\n        r'http://www\\.icourses\\.cn/coursestatic/course_\\d+\\.html', url) is not None","typeGuard":null,"tryCatchPattern":"try:\n    icourses_playlist_download(url, output_dir)\nexcept Exception as e:\n    if str(e) == 'Unknown url pattern':\n        flag_extractor_stale(url)  # markup changed; needs human/regex update\n    else:\n        raise","preventionTips":["Only pass icourses URLs of the three known page kinds.","When this fires on valid URLs, dump the fetched HTML and re-check the regexes rather than retrying."],"tags":["you-get","icourses","url-pattern","playlist","extractor"],"backgroundTag":null,"analyzedSha":"049548f3f3f35e67ba8d3181c71fdc71d11cf260","analyzedAt":"2026-08-15T03:58:15.069Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}