-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix #1 Comply with pylint #3
base: main
Are you sure you want to change the base?
Conversation
Added timeout handling for requests.get.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! It looks fine to me except for the extra comments of which I'm not a fan.
It gives me some ideas to handle more exceptions, too.
Actually, you're wrapping the def get_movies_and_schedules():
url = "https://cine-aalst.be/nl/movies/today"
timeout = 10
try:
response = requests.get(url, timeout=timeout)
except requests.exceptions.Timeout:
print("Request timed out. Please check the internet connection.")
sys.exit(1)
except requests.exceptions.RequestException as e:
print(f"Request failed: {e}")
sys.exit(1)
content = response.text
pattern = r'<script id="storeData">window.storeData =(.+?);<\/script>'
match = re.search(pattern, content)
... It improves the readability, at least to me. |
I have seen the revised text. Approved. Co-authored-by: Kenny Van de Maele <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw it. It looks fine.
fix #1
Added timeout handling for requests.get.
And fixed error messages when ValueError occurs.