[rmll] do not crash when videoob try to enter in a directory not available on rmll website
This commit is contained in:
parent
f0a3575926
commit
0c4405b4c3
2 changed files with 14 additions and 8 deletions
|
|
@ -18,7 +18,7 @@
|
||||||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from weboob.browser import PagesBrowser, URL
|
from weboob.browser import PagesBrowser, URL
|
||||||
|
from weboob.browser.exceptions import HTTPNotFound
|
||||||
from .pages import RmllCollectionPage, RmllVideoPage, RmllChannelsPage, RmllSearchPage, RmllLatestPage
|
from .pages import RmllCollectionPage, RmllVideoPage, RmllChannelsPage, RmllSearchPage, RmllLatestPage
|
||||||
|
|
||||||
__all__ = ['RmllBrowser']
|
__all__ = ['RmllBrowser']
|
||||||
|
|
@ -59,9 +59,13 @@ class RmllBrowser(PagesBrowser):
|
||||||
oid = ''
|
oid = ''
|
||||||
if len(split_path) > 0:
|
if len(split_path) > 0:
|
||||||
oid = split_path[-1]
|
oid = split_path[-1]
|
||||||
url = self.channels_page.build(oid=oid)
|
try:
|
||||||
self.location(url)
|
url = self.channels_page.build(oid=oid)
|
||||||
assert self.channels_page.is_here()
|
self.location(url)
|
||||||
for video in self.page.iter_resources(split_path):
|
assert self.channels_page.is_here()
|
||||||
yield video
|
for video in self.page.iter_resources(split_path):
|
||||||
|
yield video
|
||||||
|
|
||||||
|
except HTTPNotFound:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,9 @@ class RmllModule(Module, CapVideo, CapCollection):
|
||||||
for video in self.browser.get_latest_videos():
|
for video in self.browser.get_latest_videos():
|
||||||
yield video
|
yield video
|
||||||
else:
|
else:
|
||||||
for content in self.browser.get_channel_videos(split_path):
|
channel_videos = self.browser.get_channel_videos(split_path)
|
||||||
yield content
|
if channel_videos:
|
||||||
|
for content in channel_videos:
|
||||||
|
yield content
|
||||||
|
|
||||||
OBJECTS = {RmllVideo: fill_video}
|
OBJECTS = {RmllVideo: fill_video}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue