Checkpoint: Platform Anatomy and Project Skeleton
Quiz
- A Facebook image URL that downloaded fine yesterday now returns 403. According to the lesson on how the platforms serve media, what is the correct response?
- Store the URL permanently and treat the 403 as a temporary outage.
- Retry the same URL a few more times with backoff, since CDN hosts fail intermittently.
- Strip the query string from the URL and retry, because the signature is optional.
- Re-resolve the media from the payload to get a fresh signed URL, then download.
- In the capstone blueprint, which stage is the only one allowed to hold platform-specific knowledge?
- Download
- Parse
- Storage
- Fetch
- Why does the storage layout require streaming downloads into a tmp/ directory and then renaming into the final path?
- It is required so the sidecar JSON can be written before the media bytes.
- It makes downloads faster by avoiding disk writes to the media tree.
- Rename is atomic, so a crash leaves a .part file instead of a truncated file that looks complete.
- It lets the parser read the file while it is still downloading.
- In the normalization step, a Bilibili post contains one video and one cover image. How many MediaRecords are produced and what distinguishes them?
- Two records, distinguished by different post_id values.
- Zero records, because a post with mixed media types is malformed.
- One record, with both URLs stored in the url field.
- Two records, same source, post_id and capture_time, distinguished by media_index (0 and 1) and media_type.
- Which of the following are fields the crawler must preserve in its internal media record, according to the platform anatomy lesson? Select all that apply.
- A stable media id derived from platform ids, never from the URL
- The rendered HTML of the page the media appeared on
- Fixup metadata such as expiry timestamp, required referrer or headers, and host family
- The raw cookie used to authenticate the request
- The primary URL plus every backup or alternate variant
- Which statements about the capstone config file are correct? Select all that apply.
- Platform differences should be handled with if/else branches in the download module.
- Secrets are referenced by file path or environment variable name, never stored inline.
- Values identical for every source (timeouts, retries, user agent, storage root) belong in the defaults block.
- A subdir that escapes the storage root should be accepted so power users can write anywhere.
- Each source id must be unique and stable because it becomes part of the storage path.
- On Bilibili, the field that identifies one specific stream or part inside a multi-part video item, needed to request playback data, is the ____.
- In the MediaRecord dataclass, key() returns the stable identity of one asset in the form source:post_id:____.
- Explain the three-stage pipeline contract (fetch, parse, download) and why the MediaRecord boundary matters. In your answer, state the input and output of each stage and what each stage must not do.
- Describe how you would build and verify the normalization slice of the capstone: the MediaRecord dataclass, the per-platform adapters, and the definition of done for the CLI.
Sign in to submit answers.