|Build Status| |Coverage Status| |Code Climate|

Description
===========

``edx-dl`` is a simple tool to download videos and lecture materials
from Open edX-based sites. It requires a
`Python <https://www.python.org/>`__ interpreter (>= 2.7) and very few
other dependencies. It is platform independent, and should work fine
under Unix (Linux, BSDs etc.), Windows or Mac OS X.

We strongly recommend that, if you don't already have a Python
interpreter installed, that you `install Python >=
3.4 <https://www.python.org/downloads/>`__, if possible, since it has
better security than Python 2.

Installation (recommended)
==========================

To install edx-dl run:

::

    pip install edx-dl

Manual Installation
===================

To install all the dependencies please do:

::

    pip install -r requirements.txt

youtube-dl
----------

One of the most important dependencies of ``edx-dl`` is ``youtube-dl``.
The installation step listed above already pulls in the most recent
version of ``youtube-dl`` for you.

Unfortunately, since many Open edX sites store their videos on Youtube
and Youtube changes their layout from time to time, it may be necessary
to upgrade your copy of ``youtube-dl``. There are many ways to proceed
here, but the simplest is to simply use:

::

    pip install --upgrade youtube-dl

Quick Start
===========

Once you have installed everything, to use ``edx-dl.py``, let it
discover the courses in which you are enrolled, by issuing:

::

    edx-dl -u user@user.com --list-courses

From there, choose the course you are interested in, copy its URL and
use it in the following command:

::

    edx-dl -u user@user.com COURSE_URL

replacing ``COURSE_URL`` with the URL that you just copied in the first
step. It should look something like:
https://courses.edx.org/courses/edX/DemoX.1/2014/info

Your downloaded videos will be placed in a new directory called
``Downloaded``, inside your current directory, but you can also choose
another destination with the ``-o`` argument.

To see all available options and a brief description of what they do,
simply execute:

::

    edx-dl --help

*Important Note:* To use sites other than edx.org, you have to specify
the site along with the ``-x`` option. For example, ``-x stanford``, if
the course that you want to get is hosted on Stanford's site.

Docker container
================

You can run this application via `Docker <https://docker.com>`__ if you
want. Just install docker and run

::

    docker run --rm -it \
           -v "$(pwd)/edx/:/Downloaded" \
           strm/edx-dl -u <USER> -p <PASSWORD>

Reporting issues
================

Before reporting any issue please follow the steps below:

1. Verify that you are running the latest version of all the programs
   (both of ``edx-dl`` and of ``youtube-dl``). Use the following command
   if in doubt:

   ::

       pip install --upgrade edx-dl

2. If the problem persists, feel free to `open an
   issue <https://github.com/coursera-dl/edx-dl/issues>`__ in our
   bugtracker, please fill the issue template with *as much information
   as possible*.

Supported sites
===============

These are the current supported sites:

-  `edX <http://edx.org>`__
-  `Stanford <http://lagunita.stanford.edu/>`__
-  `University of Sydney <http://online.it.usyd.edu.au>`__
-  `France Université
   Numérique <https://www.france-universite-numerique-mooc.fr/>`__
-  `GW Online SEAS <http://openedx.seas.gwu.edu/>`__ - George Washington
   University
-  `GW Online Open <http://mooc.online.gwu.edu/>`__ - George Washington
   University

This is the full `list of sites powered by Open
edX <https://github.com/edx/edx-platform/wiki/Sites-powered-by-Open-edX>`__.
Not all of them are supported at the moment, we welcome you to
contribute support for them and send a pull request also via our `issue
tracker <https://github.com/coursera-dl/edx-dl/issues>`__.

Authors
=======

See the contributors to the project in the
`AUTHORS.md <https://github.com/coursera-dl/edx-dl/blob/master/AUTHORS.md>`__
file. If you have contributed to the project, we would like to gladly
credit you for your work. Just send us a note to be added to that list.

.. |Build Status| image:: https://travis-ci.org/coursera-dl/edx-dl.svg?branch=master
   :target: https://travis-ci.org/coursera-dl/edx-dl
.. |Coverage Status| image:: https://coveralls.io/repos/coursera-dl/edx-dl/badge.svg?branch=master&service=github
   :target: https://coveralls.io/github/coursera-dl/edx-dl?branch=master
.. |Code Climate| image:: https://codeclimate.com/github/coursera-dl/edx-dl/badges/gpa.svg
   :target: https://codeclimate.com/github/coursera-dl/edx-dl
