Commit 0576d708 authored by Lysander Trischler's avatar Lysander Trischler

Use HTTPS URLs instead of HTTP

Old URLs are still HTTP to be compatible.
parent 0dc88091
......@@ -23,12 +23,12 @@ Usage: yfav [ VIDEO_ID ... ]
"""
__author = "Lysander Trischler"
__copyright__ = "Copyright 2012-2014, Lysander Trischler"
__copyright__ = "Copyright 2012-2015, Lysander Trischler"
__license__ = "WTFPL"
__maintainer__ = "Lysander Trischler"
__email__ = "software@lyse.isobeef.org"
__version__ = "0.4"
__version_info__ = (0, 4)
__version__ = "0.4.1"
__version_info__ = (0, 4, 1)
import os.path
import os
......@@ -61,7 +61,7 @@ ATOM_FILE = path(CONFIG.get("atom", "path", "~/srv/yfav.atom"))
ATOM_42_FILE = path(CONFIG.get("atom", "path_42", "~/srv/yfav.42.atom"))
VIDEO_ID_LEN = 11
VIDEO_ID_URL = "http://youtube.com/watch?v="
VIDEO_ID_URL = "https://youtube.com/watch?v="
def now():
return time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime())
......@@ -123,7 +123,7 @@ class Video(object):
@classmethod
def get_info(cls, video_id):
info = urllib.request.urlopen('http://youtube.com/get_video_info?video_id=%s&el=vevo' % video_id)
info = urllib.request.urlopen('https://youtube.com/get_video_info?video_id=%s&el=vevo' % video_id)
data = urllib.parse.parse_qs(str(info.read()))
info.close()
return data
......@@ -138,7 +138,18 @@ class Video(object):
@property
def url(self):
return "http://youtube.com/watch?v=%s" % self.id
"""
The URL for this video. The URL is used not just in the ``<item>``'s
``<url>`` of the Atom feed but also in its ``<id>``. Previously we
only had HTTP URLs everywhere but now we want HTTP**S** instead. To
not break the compatibility by having marked *all* videos as unread
(remember new ID means new article) we use HTTP for all videos older
than 2015-03-28 14:00:00 UTC. Videos newer than this point in time
are HTTPS.
"""
return "%s://youtube.com/watch?v=%s" % (
"https" if self.updated > '2015-03-28T14' else "http", self.id)
@property
def line(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment