QTube 2.4.0__py3-none-any.whl → 2.5.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
QTube/scripts/qtube.py CHANGED
@@ -308,6 +308,7 @@ def main():
308
308
  wanted_channels_upload_playlists.update(partial_dict)
309
309
 
310
310
  ## Dictionnary of the latest videos from selected channels
311
+ vid_nb = user_params_dict["video_history_limit"]
311
312
  recent_videos = {}
312
313
  for ch_name, playlist_Id in wanted_channels_upload_playlists.items():
313
314
  latest_partial = QTube.utils.helpers.handle_http_errors(
@@ -316,6 +317,7 @@ def main():
316
317
  QTube.utils.youtube.playlists.get_recent_videos,
317
318
  youtube,
318
319
  playlist_Id,
320
+ vid_nb,
319
321
  )
320
322
 
321
323
  if latest_partial == "ignore":
QTube/utils/checks.py CHANGED
@@ -351,6 +351,9 @@ def check_user_params(params_dict: dict) -> bool:
351
351
  and 0 <= params_dict.get("comments_to_views_ratio") <= 1,
352
352
  # Paid promotions
353
353
  isinstance(params_dict.get("allow_paid_promotions"), bool),
354
+ # Vid number
355
+ isinstance(params_dict.get("video_history_limit"), int)
356
+ and 1 <= params_dict.get("video_history_limit") <= 50,
354
357
  ]
355
358
 
356
359
  ok = all(checks)
QTube/utils/parsing.py CHANGED
@@ -257,6 +257,15 @@ def parse_arguments() -> dict:
257
257
  help="Minimum ratio of comments to views. Default: 0",
258
258
  )
259
259
 
260
+ parser.add_argument(
261
+ "-vhl",
262
+ "--video_history_limit",
263
+ metavar="",
264
+ type=int,
265
+ default=5,
266
+ help="How far back videos are checked in creators' upload playlist. Default: 5",
267
+ )
268
+
260
269
  parser.add_argument(
261
270
  "-rf",
262
271
  "--run_frequency",
@@ -274,17 +283,17 @@ def parse_arguments() -> dict:
274
283
  )
275
284
 
276
285
  parser.add_argument(
277
- "-app",
278
- "--allow_paid_promotions",
279
- action="store_false",
280
- help="Allow videos containing paid advertising. Default: True",
286
+ "-app",
287
+ "--allow_paid_promotions",
288
+ action="store_false",
289
+ help="Allow videos containing paid advertising. Default: True",
281
290
  )
282
291
 
283
292
  parser.add_argument(
284
- "-mfk",
285
- "--only_made_for_kids",
286
- action="store_true",
287
- help="Determines whether to only add videos that are made for kids, based on Youtube and FTC guidelines. Default: False",
293
+ "-mfk",
294
+ "--only_made_for_kids",
295
+ action="store_true",
296
+ help="Determines whether to only add videos that are made for kids, based on Youtube and FTC guidelines. Default: False",
288
297
  )
289
298
 
290
299
  parser.add_argument(
@@ -1,19 +1,20 @@
1
1
  import datetime as dt
2
2
 
3
3
 
4
- def get_recent_videos(youtube, playlist_ID: str) -> dict:
5
- """Retrieves the last 5 videos of a YT playlist.
4
+ def get_recent_videos(youtube, playlist_ID: str, vid_nb: int) -> dict:
5
+ """Retrieves the last videos added in a YT playlist.
6
6
 
7
7
  Args:
8
8
  youtube (Resource): YT API resource.
9
9
  playlist_ID (str): ID of the playlist.
10
+ vid_nb (int): Number of videos to retrieve.
10
11
 
11
12
  Returns:
12
- recent_vids (dict): Dictionary containing the ID (keys) and upload date (values) of the last 5 videos in the playlist.
13
+ recent_vids (dict): Dictionary containing the ID (keys) and upload date (values) of the last videos added in the playlist.
13
14
  """
14
15
  response = (
15
16
  youtube.playlistItems()
16
- .list(part="contentDetails", playlistId=playlist_ID, maxResults=5)
17
+ .list(part="contentDetails", playlistId=playlist_ID, maxResults=vid_nb)
17
18
  .execute(num_retries=5)
18
19
  )
19
20
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: QTube
3
- Version: 2.4.0
3
+ Version: 2.5.0
4
4
  Summary: Automatically add Youtube videos to a playlist.
5
5
  Home-page: https://github.com/Killian42/QTube
6
6
  Author: Killian Lebreton
@@ -153,6 +153,7 @@ For more versatile uses, you can also use command line arguments with the [qtube
153
153
  |`comments_threshold`|No|Minimum number of times videos have been commented on.|Positive integer|
154
154
  |`likes_to_views_ratio`|No|Minimum likes to views ratio.|Positive float between 0 & 1|
155
155
  |`comments_to_views_ratio`|No|Minimum comments to views ratio.|Positive float between 0 & 1|
156
+ |`video_history_limit`|No|How far back videos are checked in creators' upload playlist.|Positive integer between 1 & 50|
156
157
  |`run_frequency`|No|Defines the duration, in days, of the timeframe considered by the software. Can be interpreted as the frequency the program should be run.|*daily*, *weekly*, *monthly* or any positive integer|
157
158
  |`keep_shorts`|No|Determines whether to add shorts.|boolean|
158
159
  |`allow_paid_promotions`|No|Determines whether to add videos containing paid advertisement.|boolean|
@@ -208,6 +209,7 @@ The following *user_params.json* file would add every new videos from channels y
208
209
  "comments_threshold": 0,
209
210
  "likes_to_views_ratio": 0,
210
211
  "comments_to_views_ratio": 0,
212
+ "video_history_limit": 5,
211
213
  "run_frequency":"daily",
212
214
  "keep_shorts": true,
213
215
  "allow_paid_promotions": true,
@@ -252,6 +254,7 @@ The following *user_params.json* file would only add videos with good quality.
252
254
  "comments_threshold": 0,
253
255
  "likes_to_views_ratio": 0,
254
256
  "comments_to_views_ratio": 0,
257
+ "video_history_limit": 5,
255
258
  "run_frequency":"daily",
256
259
  "keep_shorts": true,
257
260
  "allow_paid_promotions": true,
@@ -296,6 +299,7 @@ The following *user_params.json* file would only add the *$1 vs.* MrBeast videos
296
299
  "comments_threshold": 0,
297
300
  "likes_to_views_ratio": 0,
298
301
  "comments_to_views_ratio": 0,
302
+ "video_history_limit": 5,
299
303
  "run_frequency":"daily",
300
304
  "keep_shorts": false,
301
305
  "allow_paid_promotions": true,
@@ -0,0 +1,17 @@
1
+ QTube/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ QTube/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ QTube/scripts/qtube.py,sha256=x-kzqfB54hzFTT7oolaTTn3Y-Jy9cM7W7L-fIlrj7Ls,35183
4
+ QTube/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ QTube/utils/checks.py,sha256=w6_Mwhh1lpxYEQ6cusKtiOTtvrhDHFjNU5Yx43V3Ee0,13310
6
+ QTube/utils/helpers.py,sha256=fl1_fePwy7ot-KRFB9Ieq7fMFtD8Q4TriK8cW17qPy0,9187
7
+ QTube/utils/parsing.py,sha256=H1uVtevbDF-6JWy42--pDvkBBHzAvxBgujIErQk54AI,11057
8
+ QTube/utils/youtube/captions.py,sha256=0jUs8SH4L4d2RTS4QHJ5J2Zd9qe3SOHf9VZW966NuY8,1591
9
+ QTube/utils/youtube/channels.py,sha256=_IITSU3tZJLqrJkdQOLGAwTyrrsZb-WywRq2LyqXVBQ,3331
10
+ QTube/utils/youtube/playlists.py,sha256=tjfY-ohrQvk1BznbsdwQUcnX0Wq7rlBK43C-ZWOE4iY,3953
11
+ QTube/utils/youtube/videos.py,sha256=YWhpLQVADr95lp1XMgnkg5z05YOxtBgpEauUz95zMeQ,20607
12
+ QTube-2.5.0.dist-info/LICENSE.txt,sha256=cIZNbD-BZYZPzWYHhtE-iUCasUxQIwWzALL9nZh32pQ,1098
13
+ QTube-2.5.0.dist-info/METADATA,sha256=5onw-FEmuyBiM62nsxA_iTUJCXSP8vc2j2ncI2Tjvkc,18001
14
+ QTube-2.5.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
15
+ QTube-2.5.0.dist-info/entry_points.txt,sha256=Q3SLDyRahuzrNnHC3UOkMH5gM_Um3eCLiLG4vSTPjqE,51
16
+ QTube-2.5.0.dist-info/top_level.txt,sha256=z6oXrT8BiTTZuygjsbfe-NE4rmkHlDK8euAL9m6BT4A,6
17
+ QTube-2.5.0.dist-info/RECORD,,
@@ -1,17 +0,0 @@
1
- QTube/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- QTube/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- QTube/scripts/qtube.py,sha256=7sr4UnaNtxjUAK_cxW9_fgLzW3jMD-kCkBKJXmXh0_o,35108
4
- QTube/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- QTube/utils/checks.py,sha256=EV-oV89Ufd02fAzsT68wyVCziSMlnbo1NR1XiNqGa0k,13159
6
- QTube/utils/helpers.py,sha256=fl1_fePwy7ot-KRFB9Ieq7fMFtD8Q4TriK8cW17qPy0,9187
7
- QTube/utils/parsing.py,sha256=LQ7onVUyqef9bQOS54YNixOHdJGkfydsazP7ijQQoNA,10789
8
- QTube/utils/youtube/captions.py,sha256=0jUs8SH4L4d2RTS4QHJ5J2Zd9qe3SOHf9VZW966NuY8,1591
9
- QTube/utils/youtube/channels.py,sha256=_IITSU3tZJLqrJkdQOLGAwTyrrsZb-WywRq2LyqXVBQ,3331
10
- QTube/utils/youtube/playlists.py,sha256=kMWeaxGp09J3IY6UWpB7qKY7peTpIBlJkMUDb7CDIpM,3874
11
- QTube/utils/youtube/videos.py,sha256=YWhpLQVADr95lp1XMgnkg5z05YOxtBgpEauUz95zMeQ,20607
12
- QTube-2.4.0.dist-info/LICENSE.txt,sha256=cIZNbD-BZYZPzWYHhtE-iUCasUxQIwWzALL9nZh32pQ,1098
13
- QTube-2.4.0.dist-info/METADATA,sha256=SyyF5njBo11yORDL9_UBmRSGlni982O2ZNgyXiP-G28,17798
14
- QTube-2.4.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
15
- QTube-2.4.0.dist-info/entry_points.txt,sha256=Q3SLDyRahuzrNnHC3UOkMH5gM_Um3eCLiLG4vSTPjqE,51
16
- QTube-2.4.0.dist-info/top_level.txt,sha256=z6oXrT8BiTTZuygjsbfe-NE4rmkHlDK8euAL9m6BT4A,6
17
- QTube-2.4.0.dist-info/RECORD,,
File without changes