From 8f802ed046465e7909e590a9381ff41525ee91bb Mon Sep 17 00:00:00 2001 From: fedir Date: Tue, 18 Feb 2025 17:46:37 +0100 Subject: [PATCH 1/3] Added license headers. --- examples/inner_test.py | 16 ++++++++++++++++ examples/tkinter_preview.py | 16 ++++++++++++++++ shadowtube/__init__.py | 16 ++++++++++++++++ shadowtube/preprocess.py | 16 ++++++++++++++++ shadowtube/recommend.py | 16 ++++++++++++++++ 5 files changed, 80 insertions(+) diff --git a/examples/inner_test.py b/examples/inner_test.py index d5e0f6b..d0de7e3 100644 --- a/examples/inner_test.py +++ b/examples/inner_test.py @@ -1,3 +1,19 @@ +# +# Copyright (c) 2025 Fedir Kovalov. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3. +# +# 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 . +# + import shadowtube.preprocess as prep import shadowtube.recommend as rec diff --git a/examples/tkinter_preview.py b/examples/tkinter_preview.py index cda311d..0147246 100644 --- a/examples/tkinter_preview.py +++ b/examples/tkinter_preview.py @@ -1,3 +1,19 @@ +# +# Copyright (c) 2025 Fedir Kovalov. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3. +# +# 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 . +# + import requests from io import BytesIO from PIL import Image, ImageTk diff --git a/shadowtube/__init__.py b/shadowtube/__init__.py index 4607170..51027ac 100644 --- a/shadowtube/__init__.py +++ b/shadowtube/__init__.py @@ -1,2 +1,18 @@ +# +# Copyright (c) 2025 Fedir Kovalov. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3. +# +# 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 . +# + from .preprocess import * from .recommend import * diff --git a/shadowtube/preprocess.py b/shadowtube/preprocess.py index 5f2cd88..59a132e 100644 --- a/shadowtube/preprocess.py +++ b/shadowtube/preprocess.py @@ -1,3 +1,19 @@ +# +# Copyright (c) 2025 Fedir Kovalov. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3. +# +# 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 . +# + import json import math from typing import List diff --git a/shadowtube/recommend.py b/shadowtube/recommend.py index 7fcdbed..543bd67 100644 --- a/shadowtube/recommend.py +++ b/shadowtube/recommend.py @@ -1,3 +1,19 @@ +# +# Copyright (c) 2025 Fedir Kovalov. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3. +# +# 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 . +# + import sqlite3 from random import sample From 172b29e56ae91a463dd5daefc28f4acea06b3e39 Mon Sep 17 00:00:00 2001 From: DjMaestr0 Date: Tue, 18 Feb 2025 18:23:24 +0100 Subject: [PATCH 2/3] history-class e Please enter the commit message for your changes. Lines starting here is the history class --- shadowtube/history.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 shadowtube/history.py diff --git a/shadowtube/history.py b/shadowtube/history.py new file mode 100644 index 0000000..a60141c --- /dev/null +++ b/shadowtube/history.py @@ -0,0 +1 @@ +"" From 7abf7a939f064bce4e7777eb49293d2815ec77ff Mon Sep 17 00:00:00 2001 From: DjMaestr0 Date: Tue, 18 Feb 2025 18:29:29 +0100 Subject: [PATCH 3/3] Adding history class --- shadowtube/history.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/shadowtube/history.py b/shadowtube/history.py index a60141c..fbc2766 100644 --- a/shadowtube/history.py +++ b/shadowtube/history.py @@ -1 +1,18 @@ -"" +class History: #Abstract class + def __init__(self, filename): + self.history = list() + + def __size__(self): + return len(history) + + def parse_history(self, filename): + return history + + def is_this_type(self, filename): # bool function, + return false # returns false if Youtube history + + def get_video(self, index): + return history[index] + + def __iter__(self): + return iter(history)