# Path: epymc/extapi/onlinevideo.py
# ACT_DEFAULT = 0
# ACT_NONE = 1
# ACT_FOLDER = 2
# ACT_MORE = 3
# ACT_PLAY = 4
# ACT_SEARCH = 5
# def state_get():
# def language_get():
# def item_add(next_state, label, url, info=None, icon=None, poster=None, action=ACT_DEFAULT):
# def play_url(url):
# def report_error(msg):
# def local_resource(_file_, res):
# def fetch_url(url, headers=None, parser=None):
# def ydl_executable():
# def call_ydl(url):
# def url_encode(params):
# def seconds_to_duration(seconds):
# def relative_date(date):
# def format_date(date):


import os
from epymc.extapi.onlinevideo import api_version, state_get, fetch_url, \
    play_url, item_add, call_ydl, local_resource, seconds_to_duration, \
    relative_date, url_encode, \
    ACT_NONE, ACT_FOLDER, ACT_MORE, ACT_PLAY, ACT_SEARCH
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

from __future__ import absolute_import, print_function, unicode_literals, division



ytb_base = 'https://www.youtube.com'
ytb_icon = local_resource(__file__, 'youtube.png')

ST_HOME = 0
ST_PLAY = 1
ST_SEARCH = 3
ST_CHN_CATEGORIES = 10
ST_CHN_CHANNELS = 11
ST_CHN_VIDEOS = 12

STATE, URL = state_get()

# this is the first page, show fixed categories
if STATE == ST_HOME:
    item_add(ST_SEARCH, _('Search videos'), 'search', None, action=ACT_SEARCH)
    item_add(ST_CHN_CATEGORIES, _('Browse channels'),

# Path: epymc/extapi/onlinevideo.py
# ACT_DEFAULT = 0
# ACT_NONE = 1
# ACT_FOLDER = 2
# ACT_MORE = 3
# ACT_PLAY = 4
# ACT_SEARCH = 5
# def state_get():
# def language_get():
# def item_add(next_state, label, url, info=None, icon=None, poster=None, action=ACT_DEFAULT):
# def play_url(url):
# def report_error(msg):
# def local_resource(_file_, res):
# def fetch_url(url, headers=None, parser=None):
# def ydl_executable():
# def call_ydl(url):
# def url_encode(params):
# def seconds_to_duration(seconds):
# def relative_date(date):
# def format_date(date):


# Path: epymc/plugins/onlinevideo/youtube/youtube.py
import os
from epymc.extapi.onlinevideo import api_version, state_get, fetch_url, \
    play_url, item_add, call_ydl, local_resource, seconds_to_duration, \
    relative_date, url_encode, \
    ACT_NONE, ACT_FOLDER, ACT_MORE, ACT_PLAY, ACT_SEARCH

# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

from __future__ import absolute_import, print_function, unicode_literals, division



ytb_base = 'https://www.youtube.com'
ytb_icon = local_resource(__file__, 'youtube.png')

ST_HOME = 0
ST_PLAY = 1
ST_SEARCH = 3
ST_CHN_CATEGORIES = 10
ST_CHN_CHANNELS = 11
ST_CHN_VIDEOS = 12

STATE, URL = state_get()

# this is the first page, show fixed categories
if STATE == ST_HOME:
    item_add(ST_SEARCH, _('Search videos'), 'search', None, action=ACT_SEARCH)
    item_add(ST_CHN_CATEGORIES, _('Browse channels'),

             ytb_base + '/channels', None, action=ACT_FOLDER)