summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorA Farzat <a@farzat.xyz>2025-10-06 13:35:53 +0300
committerA Farzat <a@farzat.xyz>2025-10-06 13:35:53 +0300
commitc9205f0fc12a357a45b9ade1dd4077d4c37acd01 (patch)
tree29e94f2196cede50b098d68f9f6acdff18b1a756
parentfcb1db604306c2e09a03617dd42473bb400cef43 (diff)
downloadcsca5028-c9205f0fc12a357a45b9ade1dd4077d4c37acd01.tar.gz
csca5028-c9205f0fc12a357a45b9ade1dd4077d4c37acd01.zip
Add a helper script to reset the database
-rwxr-xr-xreset_database.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/reset_database.py b/reset_database.py
new file mode 100755
index 0000000..075e408
--- /dev/null
+++ b/reset_database.py
@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+
+from time import sleep
+from components.database import subscriptions
+from components.subscriptions.main import Subscription
+from components.videos import VideoTuple
+
+subscriptions.delete_many({})
+for short_id in ['fiwzLy-8yKzIbsmZTzxDgw', 'Ef0-WZoqYFzLZtx43KPvag',
+ 'PF-oYb2-xN5FbCXy0167Gg', 'hlgI3UHCOnwUGzWzbJ3H5w', ]:
+ sub = Subscription(
+ _id='yt:channel:'+short_id,
+ link='http://www.youtube.com/feeds/videos.xml?channel_id=UC'+short_id,
+ time_between_fetches=300,
+ )
+ sub.insert()