Skip to content

Commit

Permalink
- updated region blocked regex #69
Browse files Browse the repository at this point in the history
  • Loading branch information
EchterAlsFake committed Nov 17, 2024
1 parent 3739c0b commit cb0234e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/phub/modules/parser.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import annotations

import re

import json
import logging
from typing import TYPE_CHECKING
Expand Down Expand Up @@ -30,6 +32,10 @@ def resolve(video: Video) -> dict:
# more obfuscation stuff

logger.info('Resolving %s page', video)
region_blocked_regex = re.compile(r'<div\s+id=["\']js-player["\']\s+class=["\']videoGeoUnavailable["\']\s*>')
if re.search(region_blocked_regex, video.page):
raise errors.RegionBlocked

flash, ctx = consts.re.get_flash(video.page)

try:
Expand Down

0 comments on commit cb0234e

Please sign in to comment.