Replace to URL Freedom

This commit is contained in:
Jesús 2019-12-04 15:09:32 -05:00
parent 58a8f99398
commit 6037dccec8
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766
2 changed files with 9 additions and 2 deletions

View File

@ -47,7 +47,7 @@
:group 'livie
:type 'string)
(defvar livie-youtube-regexp "https://www.youtube.com/watch\\?v=[A-Za-z0-9_\\-]\\{11\\}")
(defvar livie-youtube-regexp "https://invidio.us/watch\\?v=[A-Za-z0-9_\\-]\\{11\\}")
(define-derived-mode livie-mode
special-mode "livie"

View File

@ -20,9 +20,16 @@ def replace(string):
string = string.replace(' views', '')
return string
def urlFreedom(string):
"""Replace to URL freedom"""
string = string.replace(
'https://www.youtube.com',
'https://invidio.us')
return string
for vid in SOUP.find_all(class_='yt-lockup-content'):
try:
link = URL + vid.h3.a['href']
link = urlFreedom(URL + vid.h3.a['href'])
title = vid.h3.a.text
description = vid.h3.span.text
author = vid.find(class_='yt-lockup-byline').a.text