|
4 | 4 | Typically, when moving from a local architecture to the |
5 | 5 | French Ministry of Higher Education and Research (ESR) BBB architecture. |
6 | 6 |
|
7 | | -More information on this module at: https://www.esup-portail.org/wiki/x/C4CFUQ |
| 7 | +This script can also be used to backup BBB recordings. For example, in the case of a |
| 8 | +backup of the BBB records of the ESR infrastructure, as they are only kept for one year. |
| 9 | +
|
| 10 | +More information on this module at: https://esupportail.github.io/Esup-Pod/4.x/Installation/optional/bbb-infrastructure-migration-install_fr |
8 | 11 |
|
9 | 12 | Reminder of constraints: |
10 | 13 | - no use of Pod's old BBB module (this module will be phased out in the near future) |
|
99 | 102 | from django.core.management.base import BaseCommand |
100 | 103 | from django.template.defaultfilters import slugify |
101 | 104 | from pod.import_video.utils import manage_download, parse_remote_file |
102 | | -from pod.import_video.utils import manage_recording_url, check_url_exists |
103 | 105 | from pod.import_video.models import ExternalRecording |
104 | 106 | from pod.import_video.views import start_bbb_encode_presentation_and_move_to_destination |
105 | 107 | from pod.meeting.models import Meeting |
|
110 | 112 | # Moodle database engine (postgresql, mysql or None) |
111 | 113 | MOODLE_DB_TYPE = None |
112 | 114 |
|
113 | | -MOODLE_DB_TYPE = "postgresql" |
114 | | - |
115 | 115 | if MOODLE_DB_TYPE == "postgresql": |
116 | 116 | # For PostgreSQL database # |
117 | 117 | # Don't forget to run the following command the 1st time |
@@ -487,7 +487,7 @@ def get_recording(recording) -> Generic_recording: |
487 | 487 | # Not other format like "screenshare" or "podcast" |
488 | 488 |
|
489 | 489 | # Check playback data |
490 | | - presentation_url, video_url = get_recording_urls() |
| 490 | + presentation_url, video_url = get_recording_urls(recording, internal_meeting_id) |
491 | 491 |
|
492 | 492 | # Define the result with the Generic_recording class |
493 | 493 | generic_recording = Generic_recording( |
@@ -556,13 +556,13 @@ def download_bbb_video_file(source_url: str, dest_file: str) -> None: |
556 | 556 | session = requests.Session() |
557 | 557 | # Download and parse the remote HTML file (BBB specific) |
558 | 558 | video_file_add = parse_remote_file(session, source_url) |
559 | | - # Verify that video exists |
560 | | - source_video_url = manage_recording_url(source_url, video_file_add) |
561 | | - if check_url_exists(source_video_url): |
| 559 | + try: |
562 | 560 | # Download the video file |
563 | 561 | source_video_url = manage_download(session, source_url, video_file_add, dest_file) |
564 | | - else: |
565 | | - print("Unable to download %s: video file doesn't exist." % source_url) |
| 562 | + print(" > Video %s downloaded." % source_video_url) |
| 563 | + except Exception as e: |
| 564 | + err = ("Unable to download %s: %s. %s " % (source_url, str(e), traceback.format_exc())) |
| 565 | + print(err) |
566 | 566 |
|
567 | 567 |
|
568 | 568 | def process_recording_to_claim(options, generic_recording) -> None: |
|
0 commit comments