From 76e41ad78d6b7cedc397528773ce7450a960c751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=BF=E3=81=A6=E3=82=8B=E3=81=9E?= Date: Fri, 9 Jan 2026 03:48:50 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BE=8B=E5=A4=96=E5=87=BA=E5=8A=9B?= =?UTF-8?q?=EF=BC=88#3=EF=BC=89=20(#5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #3 Co-authored-by: miteruzo Reviewed-on: https://git.miteruzo.com/miteruzo/nicolib/pulls/5 --- module.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/module.py b/module.py index f9c7b05..0a5f55b 100644 --- a/module.py +++ b/module.py @@ -44,7 +44,8 @@ def fetch_video_info ( description = (bs.find ('meta', attrs = { 'name': 'description' }) .get ('content')) # type: ignore - except (AttributeError, TypeError): + except (AttributeError, TypeError) as ex: + print (ex) return None return { 'contentId': video_code, @@ -86,15 +87,15 @@ def fetch_embed_info ( if tmp is not None and hasattr (tmp, 'get'): try: description = str (tmp.get ('content')) - except (AttributeError, TypeError): - pass + except (AttributeError, TypeError) as ex: + print (ex) tmp = bs.find ('meta', attrs = { 'name': 'thumbnail' }) if tmp is not None and hasattr (tmp, 'get'): try: thumbnail = str (tmp.get ('content')) - except (AttributeError, TypeError): - pass + except (AttributeError, TypeError) as ex: + print (ex) return (title, description, thumbnail) @@ -133,7 +134,8 @@ def fetch_latest_video ( .find ('li', class_ = 'item')) video_info['contentId'] = video['data-video-id'] - except (AttributeError, IndexError, KeyError, TypeError): + except (AttributeError, IndexError, KeyError, TypeError) as ex: + print (ex) return None return fetch_video_info (video_info['contentId']) @@ -164,7 +166,8 @@ def _create_bs_from_url ( try: req = requests.get (url, params = params, timeout = 60) - except Timeout: + except Timeout as ex: + print (ex) return None if req.status_code != 200: