The Lesson Stuff Tab
From this tab you can
- download dialogue and expansion sentences audio without typing one letter
- open the transcript html by entering the lesson's level and id (if you like typing)
- fetch a dialogue transcript to a text file using freely definable field and record separators
- fetch the expansion sentences a text file using freely definable field and record separators. (Still lacks Pinyin, though.)
Open a lesson's transcript HTML by Level and Id
- Enter level and lesson id (containing the leading zero) into the fields Lesson Level + Id
The Level has to be in Upper Chars (A, B, C..). a, b, c won't work. - Press the small square button in the top right corner.
The transcript HTML for the entered Level and Lesson will open in your webbrowser.
Scrape lesson details
You don't have to enter the lesson level, title, id and mp3-link manually. Getting the lesson details is easy: Just open a dialogue or expansion page in Firefox or Safari and press the Scrape... button.
The scrape panel provides three options for fetching the lesson details
- Sourcefile: From your browser save the page's HTML source to a file on your disk. Choose that file here in CPodTools. The small square button will open the file for preview.
- Safari: CPodTools will save the HTML source of the current, topmost Safari window to a temporary file.
- URL: Just click on from Firefox or from Safari to
get the current URL into the field. You can also paste or type it in, just take care it's really a CPod
fully qualified dialogue or expansion link, including http:// at the beginning. The small square button
will open the entered Url for preview.
If you scrape from an Url, you have to enter your CPod-Logindata to access the page.
If Terminal is running, make sure to have a Terminal window open. Click Run. CPodTools will fetch the needed infos and automatically fill the lesson details field on the Lesson Stuff tab.
Auto-update on scraping:
- Set filenames to Lesson Id: If on the Lesson tab you already have set the target files for the text, checking this option will update the filenames to Lesson Level + Lesson Id + Lesson Title + - dialogue/expansion.txt.
- Auto add Lesson Id field: This will add the Lesson Level and Id as an extra field to each entry of your converted text output. If you already have added an extra field, that will be updated to the Lesson Id. See Conversion Options for more about additional fields.
Download dialog and expansion sentences audio
When Download audio is checked, pressing Run will download the audio files from the the first (0) to Last Mp3-Link to the folder Downloadfolder . The Last Mp3-Link is the the link to the mp3 file with the highest number found in the page. The numbering starts with the dialogue sentences. So if you scrape from an expansion page, the dialogue and expansion sentences will be downloaded. If you scrape from a dialogue page, only the dialogue sentences will be downloaded.
The downloaded files will be named Lesson Level + Lesson Id + Lesson Title + " - " + Sentence number + ".mp3"
Python Scripts
The python scripts involved are:
- lessonInfos.py
- sentenceNumberFromLink.py
- downloader.py
- convertTranscript.py
- scrapeExpansion.py
- changeAddfieldsOption.py
Run scriptname --help in the terminal to get more info about the standalone usage of those scripts.