/General-Conference-Downloader

Download LDS General Conference text, html and MP3's.

Primary LanguagePHP

General Conference Downloader

Introduction

Do you ever wish you could easily listen to General Conference on your device?

This set of scripts will allow you to download and organize General Conference in MP3 format, organized in various ways.

These scripts will search the LDS.org website General Conference pages and download all of them which are listed.

Prerequisites

You will need a functional install of PHP which can be obtained from https://www.php.net/. The scripts have been tested on PHP 5.6 and 7.x. They can be run on Windows, OS X, or Linux.

Recognize that you are downloading a large amount of MP3 files, which will require quite a bit of space. The scripts are small but the MP3 files they download range from 20+ GB per script.

Instructions

To use these scripts, open a console, such as Command Prompt in Windows or Terminal in OS X or Linux. Change to the directory containing the PHP scripts. Execute them by running: php scriptname.php where scriptname should be replaced with the name of the script.

Scripts

1. From a list of urls of speaker name, download corresponding MP3's

If you only want to listen to certain speakers, you can browse https://www.lds.org/general-conference/speakers and right-click on the name of a speaker you'd like to listen to and select Copy link location or Copy link address.

Then paste it into a file called 1_gen_conf_pages.txt. Repeat this for each additional speaker. An example file would look like this:

https://www.lds.org/general-conference/speakers/Boyd-K.-Packer?lang=eng&encoded=true
https://www.lds.org/general-conference/speakers/Bruce-R.-McConkie?lang=eng&encoded=true
https://www.lds.org/general-conference/speakers/Dallin-H.-Oaks?lang=eng&encoded=true

When the list is complete, save the file and in the terminal, execute: php 1_gen_conf_download.php

2. Get html for all conferences and put them into the database

This script will fetch the text of each talk of each conference and organize them into a MySQL database allowing you to write SQL queries for searching for specific words. This requires you have write access to a MySQL database. Start by running the following SQL to create the table:

CREATE DATABASE conference;
USE conference;
CREATE TABLE `conference_articles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `conference_date` date DEFAULT NULL,
  `article_title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `article_subtitle` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `article_author_title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `article_author_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `article_body` longtext COLLATE utf8_unicode_ci,
  PRIMARY KEY (`id`),
  FULLTEXT KEY `body_ft` (`article_body`)
) ENGINE=InnoDB AUTO_INCREMENT=29475729 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

Then from a terminal just execute: php 2_gen_conf_talks.php

Note: You may need to edit the script and set up the username/password if it is not the default.

3. Download MP3's for every speaker into directories by speaker name

This script will find and download MP3 files for each speaker by name. It will organize them like this:

by-Speaker/A. Roger Merrill/A. Roger Merrill - 2006-10 - Receiving by the Spirit.mp3
by-Speaker/A. Theodore Tuttle/A. Theodore Tuttle - 1977-10 - Service Saves.mp3
by-Speaker/A. Theodore Tuttle/A. Theodore Tuttle - 1978-04 - Welfare Services Begins with You.mp3
by-Speaker/A. Theodore Tuttle/A. Theodore Tuttle - 1979-10 - Therefore I Was Taught.mp3
by-Speaker/A. Theodore Tuttle/A. Theodore Tuttle - 1980-04 - Eternal Links that Bind.mp3
by-Speaker/A. Theodore Tuttle/A. Theodore Tuttle - 1982-04 - The First and the Last Words.mp3
by-Speaker/A. Theodore Tuttle/A. Theodore Tuttle - 1984-04 - Covenants, Ordinances, and Service.mp3
by-Speaker/A. Theodore Tuttle/A. Theodore Tuttle - 1986-10 - Developing Faith.mp3
by-Speaker/Adhemar Damiani/Adhemar Damiani - 1999-10 - Serving the Lord.mp3
by-Speaker/Adhemar Damiani/Adhemar Damiani - 2005-04 - Be of Good Cheer and Faithful in Adversity.mp3

From a terminal run: php 3_gen_conf_download_mp3_all.php

4. Download MP3's by conference and into directories by conference date

This script will find and download MP3 files for each speaker by conference date. It will organize them like this:

by-Conference/1980-04/01 - Spencer W. Kimball - No Unhallowed Hand Can Stop the Work.mp3
by-Conference/1980-04/02 - David B. Haight - He Is Not Here. He Is Risen.mp3
by-Conference/1980-04/03 - James E. Faust - Communion with the Holy Spirit.mp3
by-Conference/1980-04/04 - Howard W. Hunter - God Will Have a Tried People.mp3
by-Conference/1980-04/05 - F. Enzio Busche - Do We All Believe in the Same God.mp3
by-Conference/1980-04/06 - Marion D. Hanks - Willing to Receive
by-Conference/1980-04/07 - Ezra Taft Benson - A Marvelous Work and a Wonder.mp3
by-Conference/1980-04/08 - Marvin J. Ashton - The Prophet and the Prison.mp3
by-Conference/1980-04/09 - Paul H. Dunn - Time-Out!.mp3
by-Conference/1980-04/10 - A. Theodore Tuttle - Eternal Links that Bind.mp3

From a terminal run: php 4_gen_conf_download_input.php to download all conferences. Or you can pass in an argument of the conference you wish the script to download. To do this run: php 4_gen_conf_download_input.php 2016-10. Replace 2016-10 with the year and month you wish to download.