<!DOCTYPE html>
<html id="html">
<head>
	<meta charset="UTF-8">
	<title>404 | Latviešu video portāls</title>
	<meta name="title" content="404 | Latviešu video portāls">
	<meta name="description" content="PlayTube is a PHP Video Sharing Script, PlayTube is the best way to start your own video sharing script!">
	<meta name="keywords" content="playtube,video sharing">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta property="fb:app_id" content="1643990952546825" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    
    <link rel="shortcut icon" type="image/png" href="https://yep.lv/themes/default/img/icon.png"/>
    <link rel="stylesheet" href="https://yep.lv/themes/default/css/jquery-ui.min.css">
    <link rel="stylesheet" href="https://yep.lv/themes/default/css/jquery.tagit.css">
    <link rel="stylesheet" href="https://yep.lv/themes/default/css/font-awesome-4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="https://yep.lv/themes/default/css/twemoji-awesome.css">
    <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css">
    <link rel="stylesheet" href="https://yep.lv/themes/default/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://yep.lv/themes/default/js/lib/sweetalert2/dist/sweetalert2.min.css">
    <link rel="stylesheet" href="https://yep.lv/themes/default/js/lib/notifIt/notifIt/css/notifIt.min.css">
    <link rel="stylesheet" href="https://yep.lv/themes/default/css/style.css" id="style-css">
        <link rel="stylesheet" href="https://yep.lv/themes/default/css/night-mode.css" class="night-mode-css">      
      
    <link rel="stylesheet" href="https://yep.lv/themes/default/css/custom.style.css">
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Open+Sans|Laila" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Roboto+Condensed" rel="stylesheet">
    <script src="https://yep.lv/themes/default/js/jquery-3.min.js"></script>
    <script src="https://yep.lv/themes/default/js/jquery-ui.min.js"></script>
    <script type="text/javascript" src="https://yep.lv/themes/default/js/jquery.form.min.js"></script>
    <script type="text/javascript" src="https://yep.lv/themes/default/js/tag-it.min.js"></script>
    <link rel="stylesheet" href="https://yep.lv/themes/default/player/css/mediaelementplayer.min.css" />
    <script src="https://yep.lv/themes/default/player/js/mediaelement-and-player.min.js"></script>
    <script src="https://yep.lv/themes/default/js/lib/sweetalert2/dist/sweetalert2.js"></script>
    <script src="https://yep.lv/themes/default/js/lib/notifIt/notifIt/js/notifIt.min.js"></script>
    <link href="https://gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css" rel="stylesheet">
        
            <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.4/socket.io.js"></script>
         <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
      ga('create', 'UA-110088139-1', 'auto');
      ga('send', 'pageview');
    </script> 
        <script>
                var site_url = 'https://yep.lv';
        function PT_Ajax_Requests_File() {
          return site_url + '/';
        }
        function OpenShareWindow(url, windowName) {
           newwindow = window.open(url, windowName, 'height=600,width=800');
           if (window.focus) {
              newwindow.focus();
           }
           return false;
        }
    </script>
    <script src="https://yep.lv/themes/default/js/header.js"></script>
</head>
<body itemscope itemtype="http://schema.org/Organization" id="pt-body">
  <input type="hidden" class="main_session" value="83f5ed72b8e6c092e084175a178fce939e1544a2">
	<header>
		<nav class="navbar navbar-findcond navbar-fixed-top header-layout">
    <div class="container ">
		<div class="navbar-header pull-left-mobile">
			<a class="navbar-brand logo-img" href="https://yep.lv/" itemprop="url"><img itemprop="logo" src="https://yep.lv/themes/default/img/logo.png" alt="Latviešu video portāls"></a>
			<form class="navbar-form navbar-left search-header" role="search" action="https://yep.lv/search" method="GET">
                <div class="form-group">
                    <input type="text" class="form-control" id="search-bar" name="keyword" placeholder="Search for videos" autocomplete="off" value=""> 
                    <i class="fa fa-search" onclick="javascript:$('.search-header input').focus();"></i>
                </div>
                <div class="search-dropdown hidden"></div>
            </form>
		</div>
		<div class="pull-right-mobile">
			<ul class="nav navbar-nav navbar-right">
				<li class="show-in-mobile">
				   <a href="#" class="search-icon"><i class="fa fa-search fa-fw"></i> </a>
				</li>
			     
			    <li class="hide-from-mobile">
				   <a href="https://yep.lv/upload-video" class="upload-button"><i class="fa fa-upload fa-fw"></i> <span class="hide-in-mobile">Upload</span></a>
				</li>
								 
			    <li class="hide-from-mobile">
				   <a href="https://yep.lv/import-video" class="import-button"><i class="fa fa-cloud-download fa-fw"></i> <span class="hide-in-mobile">Import</span></a>
				</li>
												<li class="dropdown hide-from-mobile profile-nav">
   <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
   	<i class="fa fa-user"></i> <span class="caret"></span>
   </a>
   <ul class="dropdown-menu" role="menu">
		<li>
			<a href="https://yep.lv/login">Login</a>
		</li>

				<li>
			<a href="https://yep.lv/register">Register</a>
		</li>
				<li class="divider hidden-lg hidden-md hidden-sm"></li>
		 
   </ul>
</li>
			</ul>
		</div>
	</div>
</nav>

<nav class="navbar navbar-findcond navbar-fixed-top header-layout hidden search-bar" style="margin-top: 49px;">
    <div class="container ">
		<div class="navbar-header">
			<form class="search-header-mobile" role="search" action="https://yep.lv/search" method="GET">
                <div class="form-group">
                    <input type="text" class="form-control" id="search-bar-mobile" name="keyword" placeholder="Search for videos" autocomplete="off" value=""> 
                </div>
                <div class="search-dropdown hidden"></div>
            </form>
		</div>
	</div>
</nav>
<nav class="navbar navbar-findcond navbar-default second-header-layout">
    <div class="container ">
		<div class="navbar-inner" id="navbar">
			<ul class="nav navbar-nav">
			    <li class="hide-from-mobile ">
					<a href="https://yep.lv/"> Home</a>
				</li>
				<li class="hide-from-mobile ">
					<a href="https://yep.lv/videos/latest">Latest videos</a>
				</li>
				<li class="hide-from-mobile ">
					<a href="https://yep.lv/videos/top">Top videos</a>
				</li>
				<li class="hide-from-mobile ">
					<a href="https://yep.lv/videos/trending">Trending</a>
				</li>
				<li class="dropdown hide-from-mobile ">
				   <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Categories <span class="caret"></span></a>
				   <ul class="dropdown-menu categories-drop-down" role="menu">
				    					    <li class="hide-from-mobile">
						   <a class="category" href="https://yep.lv/videos/category/1">Filmas & Animācijas</a>
						</li>
										    <li class="hide-from-mobile">
						   <a class="category" href="https://yep.lv/videos/category/2">Auto & Moto</a>
						</li>
										    <li class="hide-from-mobile">
						   <a class="category" href="https://yep.lv/videos/category/3">Mūzika</a>
						</li>
										    <li class="hide-from-mobile">
						   <a class="category" href="https://yep.lv/videos/category/4">Dzīvnieki</a>
						</li>
										    <li class="hide-from-mobile">
						   <a class="category" href="https://yep.lv/videos/category/5">Sports</a>
						</li>
										    <li class="hide-from-mobile">
						   <a class="category" href="https://yep.lv/videos/category/6">Ceļošana</a>
						</li>
										    <li class="hide-from-mobile">
						   <a class="category" href="https://yep.lv/videos/category/7">Spēles</a>
						</li>
										    <li class="hide-from-mobile">
						   <a class="category" href="https://yep.lv/videos/category/8">Cilvēki</a>
						</li>
										    <li class="hide-from-mobile">
						   <a class="category" href="https://yep.lv/videos/category/9">Komēdija</a>
						</li>
										    <li class="hide-from-mobile">
						   <a class="category" href="https://yep.lv/videos/category/10">Izklaide</a>
						</li>
										    <li class="hide-from-mobile">
						   <a class="category" href="https://yep.lv/videos/category/11">Politika</a>
						</li>
									   </ul>
				</li>
				<!---<li class="dropdown hide-from-mobile ">
				   <a href="https://yep.lv/articles">Articles</a>
				</li>--->
			</ul>
		</div>
	</div>
</nav>


<script>



$('.search-icon').on('click', function(event) {
	event.preventDefault();
	$('.search-bar').toggleClass('hidden');
});
$('#search-bar').keyup(function(event) {
	var search_value = $(this).val();
	var search_dropdown = $('.search-dropdown');
	if (search_value == '') {
		search_dropdown.addClass('hidden');
		search_dropdown.empty();
		return false;
	} else {
		search_dropdown.removeClass('hidden');
	}
    $.post('https://yep.lv/aj/search', {search_value: search_value}, function(data, textStatus, xhr) {
    	if (data.status == 200) {
    		search_dropdown.html(data.html);
    	} else {
	       search_dropdown.addClass('hidden');
		   search_dropdown.empty();
		   return false;
    	}
    });
});
</script>
    <div class="clear"></div>
	</header>
	<div id="main-container" class="container  main-content" >
        <div class="ads-placment"></div>
        <div class="announcement-renderer">
            
        </div>
		<div class="page-margin">
	<div class="content">
		<div class="top-video">
			<div class="row">
				<div class="col-md-12">
					<div class="text-center">
						<h2>404, page not found</h2>
						<p>The page you were looking for doesn't exist.</p>
					</div>
				</div>
				<div class="clear"></div>
			</div>
		</div>
	</div>
</div>
        <input type="hidden" id="main-url" value="https://yep.lv%2Frss">
        <div class="ads-placment"></div>
	</div>
     
	<footer class="">
		<div class="container phone-container ">
	<div class="footer-container">
		<div class="footer-links pull-left">
			<ul>
				<!---<li><a href="https://yep.lv/terms/terms">Terms of use</a></li>
				<li><a href="https://yep.lv/terms/privacy-policy">Privacy Policy</a></li>
				<li><a href="https://yep.lv/terms/about-us">About us</a></li>
				<li><a href="https://yep.lv/contact-us">Contact us</a></li>--->
								<li class="dropdown dropup ">
				   <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Language <span class="caret"></span></a>
				   <ul class="dropdown-menu" role="menu">
				      <li><a href="?lang=english" rel="nofollow">English</a></li><li><a href="?lang=arabic" rel="nofollow">Arabic</a></li><li><a href="?lang=dutch" rel="nofollow">Dutch</a></li><li><a href="?lang=french" rel="nofollow">French</a></li><li><a href="?lang=german" rel="nofollow">German</a></li><li><a href="?lang=russian" rel="nofollow">Russian</a></li><li><a href="?lang=spanish" rel="nofollow">Spanish</a></li><li><a href="?lang=turkish" rel="nofollow">Turkish</a></li>
				   </ul>
				</li>
			</ul>
		</div>
		<div class="footer-copyright pull-right">
			Copyright © 2018 YEP.LV - Latviešu video portāls. All rights reserved.
		</div>
		<div class="clear"></div>
	</div>
</div>
	</footer>
	<!-- JS FILES -->
        <script>
function PT_Subscribe(user_id, type) {
  if (!user_id || !type) { return false; }
  if (!$('#main-container').attr('data-logged') && $('#main-url').val()) {
      window.location.href = PT_Ajax_Requests_File() + 'login?to=' + $('#main-url').val();
      return false;
  }
  var subscribe_button = $('.subscribe-id-' + user_id);
  if (type == 'subscribe') {
    subscribe_button.removeClass('btn-subscribe').addClass('btn-subscribed');
    subscribe_button.html('<i class="fa fa-check fa-fw"></i> Subscribed');
    subscribe_button.attr('onclick', 'PT_Subscribe(' + user_id + ', "subscribed")');
  } else {
    subscribe_button.removeClass('btn-subscribed').addClass('btn-subscribe');
    subscribe_button.html('<i class="fa fa-plus-square fa-fw"></i> Subscribe');
    subscribe_button.attr('onclick', 'PT_Subscribe(' + user_id + ', "subscribe")');
  }
  $.post('https://yep.lv/aj/subscribe', {user_id: user_id});
}

function PT_Reply(comm_id, name = '',reply_id = 0) {
  if (!comm_id) { return false;}
  var logged = $('#main-container').attr('data-logged');
  var name   = (name) ? "@"+name+": " : '';
  if(!logged){
    window.location.href = "https://yep.lv/login?to=https://yep.lv%2Frss";
    return false;
  }
  else{
    var reply_form = $('#comm-reply-' + comm_id);

    reply_form.removeClass('hidden').find('input').val(name).focus().scrollTo();

    if (reply_id) {
      reply_form.attr('data-reply-id',reply_id); 
    }
    
  }
}

$(function () {
  $('.load-more').on('click' , function(event) {
    event.preventDefault();
    var $type = $(this).attr('data-type');
    var keyword = '';
    if ($(this).attr('data-keyword')) {
      keyword = $(this).attr('data-keyword');
    }
    var last_id = $('.video-wrapper:last').attr('data-id');
    if ($(this).attr('data-category')) {
      var $category_id = $(this).attr('data-category');
      $type = 'category?c_id=' + $category_id;
    }
    views = 0;
    if ($('.video-wrapper:last').attr('data-views')) {
      var views = $('.video-wrapper:last').attr('data-views');
      $type = $type + '?views=' + views;
    }
    user_id = 0;
    if ($('#profile-id').val()) {
      var user_id = $('#profile-id').val();
    }
    
    data1 = {};
    if (views) {
      var asdf = $('div[data-views=' + views + ']').each(function(index, el) {
        data1[index] = $(this).attr('data-id')
      });
    }

    $('.load-more').text("Please wait..");
    $.post('https://yep.lv/aj/load-more/' + $type + '', {last_id: last_id, ids: data1, keyword:keyword, user_id: user_id}, function(data, textStatus, xhr) {
       if (data.status == 200) {
          if ($type == 'subscriptions' || $type == 'history' || $type == 'saved_videos' || $type == 'liked_videos' || $type == 'my_videos' || $type == 'search') {
             $('.author-list').append(data.videos);
          } else {
            $('.videos-latest-list').append(data.videos);
          }
          $('.load-more').text("Show more");
       } else {
          $('.load-more').text('No more videos to show');
       }
       scrolled = 0;
    });
  });
});


function PT_LoadPost(category, self){
  if (!self) { return false;}

  var last_id = ($('.article-wrapper').length > 0) ? $('.article-wrapper:last').attr('data-id') : 0;
  if (last_id && last_id > 0) {
    $.post('https://yep.lv/aj/load-more/articles', {last_id: last_id,cat:category}, function(data, textStatus, xhr) {
       if (data.status == 200) {
          $('.articles-container').append(data.posts);
          $(self).text("Show more");
       }

       else {
          $(self).text("No more Articles");
       }
    });
  }
}

function PT_DeleteVideo(id, type) {
  if (!id) {
    return false;
  }
  if (!confirm("Are you sure you want to delete this video? This action can't be undo")) {
    return false;
  }
  if (type == 'edit-page') {
    $('.btn-delete').attr('disabled', true);
    $('.btn-delete').val("Please wait..");
  } else if (type == 'manage-page') {
    $('#video-' + id).slideUp('200', function () {
      $(this).remove();
    });
  }
  $.post('https://yep.lv/aj/delete-video', {id: id}, function(data, textStatus, xhr) {
    if (data.status == 200) {
      if (type == 'edit-page') {
        window.location.href = 'https://yep.lv/manage-videos';
      } 
    }
  });
}

function PT_DeleteHistory(id) {
  if (!id) {
    return false;
  }
  $('#video-' + id).slideUp('200', function () {
    $(this).remove();
  });
  $.post('https://yep.lv/aj/delete-history', {id: id});
}

function PT_DeleteSaved(id) {
  if (!id) {
    return false;
  }
  $('#video-' + id).slideUp('200', function () {
    $(this).remove();
  });
  $.post('https://yep.lv/aj/delete-saved', {id: id});
}

function PT_AddToList(video_id){
  if (!video_id) {
    return false;
  }

  var name = '';
  var desc = '';
  var id   = video_id;

  $.ajax({
    url: 'https://yep.lv/aj/lists',
    type: 'GET',
    dataType: 'json',
    data: {type: 'list',a:'add',id:id},
  })
  .done(function(data) {
    if (data.status == 200) {
      swal({
        title: "",
        type: "",
        html:data.html,
        showCancelButton: true,
        cancelButtonText: "Close",
        customClass: 'sweetalert-lg',
        confirmButtonText:'<i class="fa fa-plus" aria-hidden="true"></i> Create new'
      }).then(function(){
          PT_NewList();
        },function(){
      });
    }
    else{
      swal(
        'Error!',
        'Something went wrong.Please try again later!',
        'error'
      );
    }
  })
  .fail(function() {
    console.log("error");
  })
  .always(function() {
    console.log("complete");
  });
}

function PT_ReportVideo(video_id,self){
  if (!video_id || !self) { return false;}

    var message = "";
    self = $(self);
    if (self.attr('data-rep') == 1) {
      swal({
        title: '<i class="fa fa-flag fa-fw"></i> Report this video',
        html: $('<form>').add($('<p>',{
          text:'Please write a summary of what this video was about',
          class:'report-message-label'
        })).add($('<textarea>',{
          id:'report-message',
          rows: 4,
          placeholder:'Message'
        })),
        showCancelButton: true,
        confirmButtonText: 'Submit',
        cancelButtonText: 'Cancel',
        customClass:'report-video-popup',
        animation: false,
        preConfirm: function(name){
          return new Promise(function(resolve,reject){
              message = $('#report-message').val();
              if (message.length < 1) {
                swal.showValidationError(
                  'Please check the details'
                );
                reject();
              }
              else{
                resolve();
              }
          });
        },
        allowOutsideClick: false
      }).then(function(){
        $.ajax({
          url: 'https://yep.lv/aj/report/video/report',
          type: 'POST',
          dataType: 'json',
          data: {id: video_id,text:message},
        })
        .done(function(data) {
          if (data.status == 200) {
            swal({
              title: 'Thank you',
              html: 'We have received your report!'
            });
            self.find('span').text('Cancel Report');
            self.attr('data-rep', '0');
            self.addClass('active');
          }
          else if(data.status == 304){
            self.find('span').text('Report');
            self.attr('data-rep', '1');
            self.removeClass('active');
            notif({
              msg: "Your report has been canceled!",
              type: "default",
              fade:0,
              timeout:1500
            });
          }
        });
      });
    }
    else{
      $.ajax({
        url: 'https://yep.lv/aj/report/video/cancel',
        type: 'POST',
        dataType: 'json',
        data: {id: video_id},
      })
      .done(function(data) {
        if(data.status == 304){
          self.find('span').text('Report');
          self.attr('data-rep', '1');
          self.removeClass('active');
          notif({
            msg: "Your report has been canceled!",
            type: "default",
            fade:0,
            timeout:1500
          });
        }
      });
    }  
}

function PT_PLVToggle(id,self){
  if (!id || !self) {
    return false;
  }
  var self = $(self);
  var list = self.attr('id');
  $.ajax({
    url: 'https://yep.lv/aj/lists',
    type: 'GET',
    dataType: 'json',
    data: {type: 'list',a:'tg',id:id,list:list},
  })
  .done(function(data) {
    if (data.status == 200 && data.code == 1) {
      self.find('button').html('<i class="fa fa-check-square-o"></i>');
      notif({
        msg: "Added to " + data.name,
        type: "default",
        fade:0,
        timeout:1500
      });
    }

    else if(data.status == 200 && data.code == 0){
      self.find('button').html('<i class="fa fa-square-o"></i>');
      notif({
        msg: "Removed from " + data.name,
        type: "default",
        fade:0,
        timeout:1500
      });
    }

    else{
      swal(
        'Error!',
        'Something went wrong.Please try again later!',
        'error'
      );
    }
  })
  .fail(function() {
    console.log("error");
  })  
}

function PT_WLToggle(id,self){
  if (!id || !self) {
    return false;
  }
  var self = $(self);
  $.ajax({
    url: 'https://yep.lv/aj/lists',
    type: 'GET',
    dataType: 'json',
    data: {type: 'list',a:'wl-tg',id:id},
  })
  .done(function(data) {
    if (data.status == 200 && data.code == 1) {
      self.find('button').html('<i class="fa fa-check-square-o"></i>');
      notif({
        msg: "Added to \"Watch later\"",
        type: "default",
        fade:0,
        timeout:1500
      });
    }

    else if(data.status == 200 && data.code == 0){
      self.find('button').html('<i class="fa fa-square-o"></i>');
      notif({
        msg: "Removed from \"Watch later\"",
        type: "default",
        fade:0,
        timeout:1500
      });
    }

    else{
      swal(
        'Error!',
        'Something went wrong.Please try again later!',
        'error'
      );
    }
  })
  .fail(function() {
    console.log("error");
  })  
}

function PT_NewList(){
  swal({
    title: '',
    type: "",
    html:'<form class="form create-new-list"><div class="create-new-list-head"><p><i class="fa fa-plus"></i> Create new playlist</p></div><div class="sa-create-list-alert"></div><div class="form-group"><input type="text" class="form-control" placeholder="Playlist name 0 / 30"></div><div class="form-group"><select class="form-control"><option value="1" selected="selected">Privacy</option><option value="1">Public</option><option value="0">Private</option></select></div><div class="form-group"><textarea name="" id="" rows="3" class="form-control optional-field" placeholder="Description.."></textarea></div></form>',
    showCancelButton: true,
    allowOutsideClick:false,
    confirmButtonText:'<i class="fa fa-plus-circle"></i> Create',
    cancelButtonText:'Cancel',
    preConfirm: function (email) {
    return new Promise(function (resolve, reject) {
        name     = $(".create-new-list").find('input').val();
        desc     = $(".create-new-list").find('textarea').val();
        privacy  = $(".create-new-list").find('select').val();
        setTimeout(function() {
          if (name == '') {
            reject('Play list name is required.');
          }
          else if(privacy < 0 || privacy > 1){
            reject('Please check the details');
          }
          else {
            resolve();
          }
        }, 100)
      })
    }
  }).then(function(){
    if (!name){ return;}
    $.ajax({
      url: 'https://yep.lv/aj/lists?type=list&a=new',
      type: 'POST',
      dataType: 'json',
      data: {name:name,desc:desc,pr:privacy},
    })
    .done(function(data) {
      if (data.status == 200) {
        swal({
          title:name,
          text:"PlayList was successful added!",
          type:'success'
        });

        PT_Delay(function(){
          swal.close();
        },2000);
      }
      else if(data.status == 200){
        swal(
          'Error!',
          'Something went wrong.Please try again later!',
          'error'
        );
      }
    })
    .fail(function() {
      swal.close();
      console.log("error");
    })
  },
  function(){
    //Error
  })
}

function PT_EditList(id){
  if (!id) {
    return false;
  }
  $.ajax({
    url: 'https://yep.lv/aj/lists',
    type: 'GET',
    dataType: 'json',
    data: {type: 'list',a:'edit',id:id},
  })
  .done(function(data) {
    if (data.status == 200) {
      swal({
        title: '',
        type: "",
        html:data.html,
        showCancelButton: true,
        allowOutsideClick:false,
        confirmButtonText:'<i class="fa fa-floppy-o"></i> Save',
        cancelButtonText:'Cancel',
        preConfirm: function (email) {
        return new Promise(function (resolve, reject) {
            name     = $(".edit-list-form").find('input').val();
            desc     = $(".edit-list-form").find('textarea').val();
            privacy  = $(".edit-list-form").find('select').val();
            setTimeout(function() {
              if (name == '') {
                reject('');
              }
              else if(privacy < 0 || privacy > 1){
                reject('Please check the details');
              }
              else {
                resolve();
              }
            }, 100)
          })
        }
      }).then(function(){
        if (!name){ return;}
        $.ajax({
          url: 'https://yep.lv/aj/lists?type=list&a=update',
          type: 'POST',
          dataType: 'json',
          data: {name:name,desc:desc,pr:privacy,id:id},
        })
        .done(function(data) {
          if (data.status == 200) {
            swal({
              title:name,
              text:"PlayList was successful saved!",
              type:'success'
            });

            PT_Delay(function(){
              swal.close();
            },2000);
          }
          else if(data.status == 200){
            swal(
              'Error!',
              'Something went wrong.Please try again later!',
              'error'
            );
          }
        })
        .fail(function() {
          swal.close();
          console.log("error");
        })
      },
      function(){
        //Error
      })
    }
  })
  .fail(function() {
    console.log("error");
  })
}

function PT_DeleteList(id){
  if (!id) { return false;}
  swal({
    title: 'Confirmation!',
    text: "Are you sure you want to delete this PlayList?",
    type: 'warning',
    showCancelButton: true,
    confirmButtonColor: '#3085d6',
    cancelButtonColor: '#d33',
    confirmButtonText: 'Yes,delete it!'
  }).then(function(){
    $.ajax({
      url: 'https://yep.lv/aj/lists',
      type: 'GET',
      dataType: 'json',
      data: {type: 'list',a:'delist',id:id},
    })
    .done(function(data) {
      if (data.status == 200) {
        $("[data-playlist='"+id+"']").slideUp(function(){
          $(this).remove();
        });
        
        swal({
          title:"Deleted!",
          text:data.name +  " has been deleted!",
          type:"success"
        });
      }
      else{
        swal(
          'Error!',
          'Something went wrong.Please try again later!',
          'error'
        );
      }
    })
    .fail(function() {
      console.log("error");
    })
    
  })
}

function PT_DelFromList(list_id,video_id){
  if (!list_id || !video_id) {
    return false;
  }

  $.ajax({
    url: 'https://yep.lv/aj/lists',
    type: 'GET',
    dataType: 'json',
    data: {type: 'list',a:'delvid',video_id:video_id,list_id:list_id},
  })
  .done(function(data) {
    if (data.status == 200) {
      $("[data-video-id='"+video_id+"']").slideUp(function(){
        $(this).remove();
      })
    }
    else{
      swal(
        'Error!',
        'Something went wrong.Please try again later!',
        'error'
      );
    }
  })
  .fail(function() {
    swal(
      'Error!',
      'Something went wrong.Please try again later!',
      'error'
    );
  })
}

function PT_RemoveFromWL(video_id){
  if (!video_id) {
    return false;
  }

  $.ajax({
    url: 'https://yep.lv/aj/lists',
    type: 'GET',
    dataType: 'json',
    data: {type: 'list',a:'delwl',video_id:video_id},
  })
  .done(function(data) {
    if (data.status == 200) {
      $("[data-video-id='"+video_id+"']").slideUp(function(){
        $(this).remove();
      })
    }
    else{
      swal(
        'Error!',
        'Something went wrong.Please try again later!',
        'error'
      );
    }
  })
  .fail(function() {
    swal(
      'Error!',
      'Something went wrong.Please try again later!',
      'error'
    );
  })
}

function PT_RVReply(text,comm_id,event,video_id){
  
  if (!text || !comm_id || !event || !video_id) {
    return false;
  }
  else if(event.keyCode == 13 && event.shiftKey == 0){
    let reply_id = 0;
    if($("#comm-reply-"+comm_id).attr('data-reply-id')){
      reply_id = $("#comm-reply-"+comm_id).attr('data-reply-id');
    }

    $.ajax({
      url: "https://yep.lv/aj/add-reply/video",
      type: 'POST',
      dataType: 'json',
      data: {text:text,id:comm_id,video_id:video_id,reply:reply_id},
    })
    .done(function(data) {
      if (data.status == 200) {
        $("#pt-comment-replies-cont-" + comm_id).append(data.html)
        $("#comm-reply-"+comm_id).find('input').val('').blur();

      }
      $("#comment-reply-loading-renderer-"+comm_id).addClass('hidden');
    })
    .fail(function() {
      alert('Sorry, something went wrong: Please try again later ...');
    })
  }
}

function PT_RPReply(text,comm_id,event,post_id){
  
  if (!text || !comm_id || !event || !post_id) {
    return false;
  }
  else if(event.keyCode == 13 && event.shiftKey == 0){
    let reply_id = 0;
    if($("#comm-reply-"+comm_id).attr('data-reply-id')){
      reply_id = $("#comm-reply-"+comm_id).attr('data-reply-id');
    }

    $.ajax({
      url: "https://yep.lv/aj/add-reply/article",
      type: 'POST',
      dataType: 'json',
      data: {text:text,id:comm_id,post_id:post_id,reply:reply_id},
    })
    .done(function(data) {
      if (data.status == 200) {
        $("#pt-comment-replies-cont-" + comm_id).append(data.html)
        $("#comm-reply-"+comm_id).find('input').val('').blur();
      }
      $("#comment-reply-loading-renderer-"+comm_id).addClass('hidden');
    })
    .fail(function() {
      alert('Sorry, something went wrong: Please try again later ...');
    })
  }
}

function PT_DeleteReply(id) {
  if (!id) { return false; }
  if (!confirm('Are you sure you want to delete your comment?')) { return false; }
  $('#reply-' + id).slideUp('fast');
  $.post('https://yep.lv/aj/delete-reply', {id: id});
}

function PT_LikeComments(self,type,comment_id){
  if (!self || (type != 'up' && type != 'down') || !comment_id){
    return false;
  }

  else if (!$('#main-container').attr('data-logged') && $('#main-url').val()) {
    window.location.href = PT_Ajax_Requests_File() + 'login?to=' + $('#main-url').val();
    return false;
  }

  var self = $(self);
  $.ajax({
    url: 'https://yep.lv/aj/comment-like-system/' + type,
    type: 'POST',
    dataType: 'json',
    data: {id:comment_id}
  })
  .done(function(data) {
    if (data.status == 200 && type == 'up' && data.type == 'added_like'){
      self.find('span').text((data.up));
      $('[data-comment-dislikes="'+comment_id+'"]').find('span').text((data.down));
      self.find('i').addClass('active');
      self.siblings().find('i').removeClass('active');
      
    }

    else if (data.status == 200 && type == 'up' && data.type == 'deleted_like'){
      self.find('span').text((data.up));
      $('[data-comment-dislikes="'+comment_id+'"]').find('span').text((data.down));
      self.find('i').removeClass('active');
      self.siblings().find('i').removeClass('active');
    }

    else if (data.status == 200 && type == 'down' && data.type == 'added_dislike'){
      self.find('span').text((data.down));
      self.find('i').addClass('active');
      $('[data-comment-likes="'+comment_id+'"]').find('span').text((data.up));
      self.siblings().find('i').removeClass('active');
    }

    else if (data.status == 200 && type == 'down' && data.type == 'deleted_dislike'){
      self.find('span').text((data.down));
      self.find('i').removeClass('active');
      $('[data-comment-likes="'+comment_id+'"]').find('span').text((data.up));
      self.siblings().find('i').removeClass('active');
    }

    else{
      swal(
         'Error!',
         'Something went wrong.Please try again later!',
         'error'
       );
    }
  })
  .fail(function() {
    console.log("error");
  })
}

function PT_LikeReplies(self,type,reply_id){
  if (!self || (type != 'up' && type != 'down') || !reply_id){
    return false;
  }

  else if (!$('#main-container').attr('data-logged') && $('#main-url').val()) {
    window.location.href = PT_Ajax_Requests_File() + 'login?to=' + $('#main-url').val();
    return false;
  }

  var self = $(self);
  $.ajax({
    url: 'https://yep.lv/aj/reply-like-system/' + type,
    type: 'POST',
    dataType: 'json',
    data: {id:reply_id}
  })
  .done(function(data) {
    if (data.status == 200 && type == 'up' && data.type == 'added_like'){
      self.find('span').text((data.up));
      $('[data-reply-dislikes="'+reply_id+'"]').find('span').text((data.down));
      self.find('i').addClass('active');
      self.siblings().find('i').removeClass('active');
      
    }

    else if (data.status == 200 && type == 'up' && data.type == 'deleted_like'){
      self.find('span').text((data.up));
      $('[data-reply-dislikes="'+reply_id+'"]').find('span').text((data.down));
      self.find('i').removeClass('active');
      self.siblings().find('i').removeClass('active');
    }

    else if (data.status == 200 && type == 'down' && data.type == 'added_dislike'){
      self.find('span').text((data.down));
      self.find('i').addClass('active');
      $('[data-reply-likes="'+reply_id+'"]').find('span').text((data.up));
      self.siblings().find('i').removeClass('active');
    }

    else if (data.status == 200 && type == 'down' && data.type == 'deleted_dislike'){
      self.find('span').text((data.down));
      self.find('i').removeClass('active');
      $('[data-reply-likes="'+reply_id+'"]').find('span').text((data.up));
      self.siblings().find('i').removeClass('active');
    }

    else{
      swal(
         'Error!',
         'Something went wrong.Please try again later!',
         'error'
       );
    }
  })
  .fail(function() {
    console.log("error");
  })
}

function pt_hide_announcement(id){
  if (!id) { return false; }
  $("#announcement-"+id).slideUp('fast',function(){
    $(this).remove();
    $.post('https://yep.lv/aj/main/hide-announcement', {id: id}, function(data, textStatus, xhr) { /* pass */ });
  })  
}

</script>

	<script type="text/javascript" src="https://yep.lv/themes/default/js/script.js"></script>
    <script type="text/javascript" src="https://yep.lv/themes/default/js/bootstrap.min.js"></script>
    <script src="https://gitcdn.github.io/bootstrap-toggle/2.2.2/js/bootstrap-toggle.min.js"></script>
    <script src="https://yep.lv/themes/default/js/footer.js"></script>
    <link rel="" ="">
    <script>
    $(document).ready(function(){
        $('.share-video a').click(function (e) {
            e.preventDefault();
        });
        $('.dropdown-toggle').dropdown()

        $("#toggle-mode").change(function(event) {
            var mode = 'day';

            if ($(this).prop( "checked" ) === true) {
              mode = 'night';
              $('<link>',{
                rel:'stylesheet',
                href:'https://yep.lv/themes/default/css/night-mode.css',
                class:'night-mode-css'
              }).insertAfter('link#style-css');
              $('.logo-img img').attr('src', 'https://yep.lv/themes/default/img/logo-light.png');
            }
            else{
              $(".night-mode-css").remove();
              $('.logo-img img').attr('src', 'https://yep.lv/themes/default/img/logo.png');
            }


            $.post('https://yep.lv/', {mode: mode}, function(data, textStatus, xhr) { /* pass */ });
        });

        $("li.toggle-mobile-mode").click(function(event) {
            var mode = $(this).attr('data-mode');

            $.post('https://yep.lv/', {mode: mode}, function(data, textStatus, xhr) {
              location.reload();
            });
        });
    });
   </script>
    
</body>
</html>