Replace to URL Freedom
This commit is contained in:
parent
58a8f99398
commit
6037dccec8
2
livie.el
2
livie.el
@ -47,7 +47,7 @@
|
|||||||
:group 'livie
|
:group 'livie
|
||||||
:type 'string)
|
: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
|
(define-derived-mode livie-mode
|
||||||
special-mode "livie"
|
special-mode "livie"
|
||||||
|
9
livie.py
9
livie.py
@ -20,9 +20,16 @@ def replace(string):
|
|||||||
string = string.replace(' views', '')
|
string = string.replace(' views', '')
|
||||||
return string
|
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'):
|
for vid in SOUP.find_all(class_='yt-lockup-content'):
|
||||||
try:
|
try:
|
||||||
link = URL + vid.h3.a['href']
|
link = urlFreedom(URL + vid.h3.a['href'])
|
||||||
title = vid.h3.a.text
|
title = vid.h3.a.text
|
||||||
description = vid.h3.span.text
|
description = vid.h3.span.text
|
||||||
author = vid.find(class_='yt-lockup-byline').a.text
|
author = vid.find(class_='yt-lockup-byline').a.text
|
||||||
|
Loading…
x
Reference in New Issue
Block a user