Help:VOD script
When a new Critical Role episode is released on YouTube, there are a number of wiki updates that need to performed. Most of these are done semi-automatically by running a pywikibot script.
Tasks performed, in order[edit source]
Checklist for when new VOD is uploaded to YouTube
Script command | Editing task | |
---|---|---|
-update_page |
Add thumbnail, VOD URL, and runtime to article infobox. | |
-move |
Move article from its placeholder generic title to the actual title. | |
-upload |
Upload YouTube VOD thumbnail. | |
-ep_array |
Update episode name in Module:Ep/Array and make sure the relevant "latest" code (e.g., c3 latest ) is in altCodes
| |
-yt_switcher |
Add VOD URL to Module:Ep/YTURLSwitcher/URLs. | |
-ep_list |
Add VOD URL and runtime to applicable list article, such as List of Campaign 3 episodes or One-shots. | |
-redirects |
Create/update redirects from valid episode codes to the new episode name | |
-navbox |
Add episode to appropriate navigation template, such as {{Nav-C3Arc1}}, {{Nav-OneShots}}, or {{Nav-Bitsnbobs}}. | |
-cite_cat |
Create maintenance category for the episode, such as Category:Articles needing citations/4SDx21. | |
-airdate_order |
Add airdate to Module:AirdateOrder/Array. | |
-4SD |
For new 4-Sided Dive episodes only. For the Campaign 3 episodes that aired since the previous 4SD, add the current 4SD episode code to the 4SD infobox parameter.
| |
-transcript |
Generate a transcript on a Transcript: episode page (automatically skips shows like 4-Sided Dive). | |
-ignore_break |
Manually override break checking for campaign episodes. | |
-transcript_list |
Add link to transcript page on Transcripts. | |
-long_short |
Checks whether the episode belongs on Longest and shortest episodes. | |
-appendix |
Interactive prompt for creating Module:Midst appendices/Array entry. | |
-all |
Performs every tasks above that hasn't been completed yet. | |
Download/update data | ||
-decoder |
Forces a local re-download of Module:Ep/Decoder (placed in a /data/ subfolder). | |
-actor_data |
Forces a local re-download of Module:ActorData (placed in a /data/ subfolder). | |
-download_data |
Forces a local re-download of both Module:Ep/Decoder and Module:ActorData. |
You can run any subset of these tasks as well. For every potential change, you will be shown a diff of the edit and asked to accept or reject it. No changes will be made automatically. Actions are skipped if change is not needed (e.g., an entry for the episode already exists on the module page). Use global -simulate
option for testing, where no changes to the live wiki will be done, but it will do everything else other than save the changes (e.g., download the thumbnail).
Episode data to pass to script[edit source]
Only two of these fields are required. If you run a task above that requires one of these fields below that isn't entered, you will be prompted to enter that value.
Script command | Data type | Required? |
---|---|---|
-ep: |
The CxNN code of the episode | Required |
-page: |
The pagename to be edited, usually current episode page | Required |
-yt: |
The 11-character unique identifier or full URL for the YouTube video. Can include multiple (yt1, yt2, vod, vod2, etc) | Optional |
-airdate: |
YYYY-MM-DD of the date episode aired. Can be inferred from episode page if filled in. Also accepts MM-DD-YYYY. | Optional |
-airtime: |
Time of day the episode aired. Can be inferred from episode page if filled in. | Optional |
-runtime: |
HH:MM:SS vod length. If multiple vods, place each runtime in same order; values automatically summed | Optional |
-actors: |
L-R of actors in thumbnail. Separate with ','. First names ok (from ACTORS list) | Optional |
-episode_summary: |
The 1-2 line summary of the episode from the YouTube video. | Optional |
-old_ep_name: |
If different from -page: , the current name of the episode (mostly for testing) |
Optional |
-new_ep_name: |
The new title of the episode, if changed | Optional |
-new_page_name: |
Only needed if page name differs from new_ep_name (usually 'A' vs 'A (episode)')
| |
-image_name: |
Only needed if not using default thumbnail name | Optional |
-host: |
Actor who is the 4SD host or running one-shot (DM, GM also work here) | Optional |
-game_system: |
For one-shots, game system if not Dungeons & Dragons | Optional |
-file_desc: |
When uploading image, the file description to use instead of the generated one | Optional |
-caption: |
When uploading image, the infobox caption to use instead of the generated one | Optional |
-airsub: |
The earlier date the episode released to subscribers | Midst only |
-transcript_link: |
The url of the transcript | Midst only |
-icon_url: |
The url of the .png episode icon | Midst only |
-illustrator: |
The illustrator of the thumbnail/icon art | Midst only |
-logline: |
Used as quote in the first quotebox | Midst only |
Module data to be maintained[edit source]
Some modules contain data that the script uses that may need to be updated from time to time. These should be edited on-wiki if their information changes. The next time running the script add the appropriate flags (e.g., -decoder
) to make sure the updated data is downloaded locally and replaces any existing file. Any editor can make these changes and you don't need to know Python or Lua.
Module | Usage | When to update |
---|---|---|
Module:ActorData | The full list of potential cast members of a new episode, plus their speaker tags | New guest stars or cast members appear. |
Module:Ep/Decoder | 'noTranscript' parameter for shows to skip for transcript creation (currently 4SD, LVM2 ) |
A new campaign airs that should not have transcripts downloaded. |
Setting up pywikibot[edit source]
Generate a bot password[edit source]
You can create a special password just for pywikibot at Special:BotPasswords. You should use a unique bot password for every method you use to programmatically access the wiki. You may also want to create a special wiki account for automated editing with a bot flag.
Install Python 3 and pywikibot[edit source]
You will need at least Python 3.9 to run this script. To see if you have python 3 installed, open your command line interface (CLI) and type python --version
. If it's not 3.9 you can download it here and install it. Once you've verified that python --version
is at least 3.9, run pip install pywikibot nltk youtube_transcript_api
. If you have a Windows machine, you will also need to run pip install tzdata
.
Set up pywikibot[edit source]
Follow the installation instructions here to clone the script repository. Make sure the pywikibot folder/directory is somewhere easily accessible. In your CLI, navigate to the pywikibot directory. Generate the wiki-specific files you need for logging in by following the configuration guide for third-party wikis; miraheze_family.py
does not exist by default and must be created. Your login credentials will be stored in user-config.py
and user-password.py
.
Update your user-config.py
file in pywikibot to include:
user_script_paths = ['scripts.userscripts.cr_miraheze_scripts']
Updating the script[edit source]
To get the latest pywikibot updates, go into the pywikibot folder and run git pull
. To update the miraheze scripts, run git -C scripts/userscripts/cr_miraheze_scripts pull
. Git updates will not overwrite any user files.
Updating local data[edit source]
This code base depends on the data stored in Module:Ep/Decoder and Module:ActorData. The module data is downloaded automatically the first time it is accessed, but will not update unless manually prompted by the user. There are two ways you can update it:
- While running the VOD script, pass in the parameter
-download_data
- Separately run
python pwb.py download_data
Running the script[edit source]
To run the script on the command line, make sure you are in the pywikibot top-level folder. Here's what it looked like for episode 3x26:
python pwb.py vod -all -ep:3x26 -page:"Campaign 3, Episode 26" -yt:"UOWp-b9aoWQ" -new_ep_name:"Hidden Truths" -runtime:4:10:24 -episode_summary:"Bells Hells seek out allies and options in their evolving plan to infiltrate Paragon’s Call…" -actors:"Marisha, Sam, Laura"
More documentation about vod.py
can be found on its page.
Notes: