osangni commited on
Commit
37fa5ce
·
1 Parent(s): 5e7b8b3

Upload 16 files

Browse files
.gitignore ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ config.env
2
+ *.pyc
3
+ data*
4
+ .vscode
5
+ .idea
6
+ *.json
7
+ *.pickle
8
+ .netrc
9
+ log.txt
10
+ accounts/*
11
+ Thumbnails/*
12
+ MediaInfo/*
13
+ Images/*
14
+ rclone/*
15
+ list_drives.txt
16
+ cookies.txt
17
+ downloads
18
+ bot.session
19
+ user.session
20
+ terabox.txt
21
+ rclone.conf
Dockerfile ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM mysterysd/wzmlx:latest
2
+
3
+ WORKDIR /usr/src/app
4
+ RUN chmod 777 /usr/src/app
5
+
6
+ COPY requirements.txt .
7
+ RUN pip3 install --no-cache-dir -r requirements.txt
8
+
9
+ COPY . .
10
+
11
+ CMD ["bash", "start.sh"]
LICENSE ADDED
@@ -0,0 +1,674 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+ Preamble
9
+
10
+ The GNU General Public License is a free, copyleft license for
11
+ software and other kinds of works.
12
+
13
+ The licenses for most software and other practical works are designed
14
+ to take away your freedom to share and change the works. By contrast,
15
+ the GNU General Public License is intended to guarantee your freedom to
16
+ share and change all versions of a program--to make sure it remains free
17
+ software for all its users. We, the Free Software Foundation, use the
18
+ GNU General Public License for most of our software; it applies also to
19
+ any other work released this way by its authors. You can apply it to
20
+ your programs, too.
21
+
22
+ When we speak of free software, we are referring to freedom, not
23
+ price. Our General Public Licenses are designed to make sure that you
24
+ have the freedom to distribute copies of free software (and charge for
25
+ them if you wish), that you receive source code or can get it if you
26
+ want it, that you can change the software or use pieces of it in new
27
+ free programs, and that you know you can do these things.
28
+
29
+ To protect your rights, we need to prevent others from denying you
30
+ these rights or asking you to surrender the rights. Therefore, you have
31
+ certain responsibilities if you distribute copies of the software, or if
32
+ you modify it: responsibilities to respect the freedom of others.
33
+
34
+ For example, if you distribute copies of such a program, whether
35
+ gratis or for a fee, you must pass on to the recipients the same
36
+ freedoms that you received. You must make sure that they, too, receive
37
+ or can get the source code. And you must show them these terms so they
38
+ know their rights.
39
+
40
+ Developers that use the GNU GPL protect your rights with two steps:
41
+ (1) assert copyright on the software, and (2) offer you this License
42
+ giving you legal permission to copy, distribute and/or modify it.
43
+
44
+ For the developers' and authors' protection, the GPL clearly explains
45
+ that there is no warranty for this free software. For both users' and
46
+ authors' sake, the GPL requires that modified versions be marked as
47
+ changed, so that their problems will not be attributed erroneously to
48
+ authors of previous versions.
49
+
50
+ Some devices are designed to deny users access to install or run
51
+ modified versions of the software inside them, although the manufacturer
52
+ can do so. This is fundamentally incompatible with the aim of
53
+ protecting users' freedom to change the software. The systematic
54
+ pattern of such abuse occurs in the area of products for individuals to
55
+ use, which is precisely where it is most unacceptable. Therefore, we
56
+ have designed this version of the GPL to prohibit the practice for those
57
+ products. If such problems arise substantially in other domains, we
58
+ stand ready to extend this provision to those domains in future versions
59
+ of the GPL, as needed to protect the freedom of users.
60
+
61
+ Finally, every program is threatened constantly by software patents.
62
+ States should not allow patents to restrict development and use of
63
+ software on general-purpose computers, but in those that do, we wish to
64
+ avoid the special danger that patents applied to a free program could
65
+ make it effectively proprietary. To prevent this, the GPL assures that
66
+ patents cannot be used to render the program non-free.
67
+
68
+ The precise terms and conditions for copying, distribution and
69
+ modification follow.
70
+
71
+ TERMS AND CONDITIONS
72
+
73
+ 0. Definitions.
74
+
75
+ "This License" refers to version 3 of the GNU General Public License.
76
+
77
+ "Copyright" also means copyright-like laws that apply to other kinds of
78
+ works, such as semiconductor masks.
79
+
80
+ "The Program" refers to any copyrightable work licensed under this
81
+ License. Each licensee is addressed as "you". "Licensees" and
82
+ "recipients" may be individuals or organizations.
83
+
84
+ To "modify" a work means to copy from or adapt all or part of the work
85
+ in a fashion requiring copyright permission, other than the making of an
86
+ exact copy. The resulting work is called a "modified version" of the
87
+ earlier work or a work "based on" the earlier work.
88
+
89
+ A "covered work" means either the unmodified Program or a work based
90
+ on the Program.
91
+
92
+ To "propagate" a work means to do anything with it that, without
93
+ permission, would make you directly or secondarily liable for
94
+ infringement under applicable copyright law, except executing it on a
95
+ computer or modifying a private copy. Propagation includes copying,
96
+ distribution (with or without modification), making available to the
97
+ public, and in some countries other activities as well.
98
+
99
+ To "convey" a work means any kind of propagation that enables other
100
+ parties to make or receive copies. Mere interaction with a user through
101
+ a computer network, with no transfer of a copy, is not conveying.
102
+
103
+ An interactive user interface displays "Appropriate Legal Notices"
104
+ to the extent that it includes a convenient and prominently visible
105
+ feature that (1) displays an appropriate copyright notice, and (2)
106
+ tells the user that there is no warranty for the work (except to the
107
+ extent that warranties are provided), that licensees may convey the
108
+ work under this License, and how to view a copy of this License. If
109
+ the interface presents a list of user commands or options, such as a
110
+ menu, a prominent item in the list meets this criterion.
111
+
112
+ 1. Source Code.
113
+
114
+ The "source code" for a work means the preferred form of the work
115
+ for making modifications to it. "Object code" means any non-source
116
+ form of a work.
117
+
118
+ A "Standard Interface" means an interface that either is an official
119
+ standard defined by a recognized standards body, or, in the case of
120
+ interfaces specified for a particular programming language, one that
121
+ is widely used among developers working in that language.
122
+
123
+ The "System Libraries" of an executable work include anything, other
124
+ than the work as a whole, that (a) is included in the normal form of
125
+ packaging a Major Component, but which is not part of that Major
126
+ Component, and (b) serves only to enable use of the work with that
127
+ Major Component, or to implement a Standard Interface for which an
128
+ implementation is available to the public in source code form. A
129
+ "Major Component", in this context, means a major essential component
130
+ (kernel, window system, and so on) of the specific operating system
131
+ (if any) on which the executable work runs, or a compiler used to
132
+ produce the work, or an object code interpreter used to run it.
133
+
134
+ The "Corresponding Source" for a work in object code form means all
135
+ the source code needed to generate, install, and (for an executable
136
+ work) run the object code and to modify the work, including scripts to
137
+ control those activities. However, it does not include the work's
138
+ System Libraries, or general-purpose tools or generally available free
139
+ programs which are used unmodified in performing those activities but
140
+ which are not part of the work. For example, Corresponding Source
141
+ includes interface definition files associated with source files for
142
+ the work, and the source code for shared libraries and dynamically
143
+ linked subprograms that the work is specifically designed to require,
144
+ such as by intimate data communication or control flow between those
145
+ subprograms and other parts of the work.
146
+
147
+ The Corresponding Source need not include anything that users
148
+ can regenerate automatically from other parts of the Corresponding
149
+ Source.
150
+
151
+ The Corresponding Source for a work in source code form is that
152
+ same work.
153
+
154
+ 2. Basic Permissions.
155
+
156
+ All rights granted under this License are granted for the term of
157
+ copyright on the Program, and are irrevocable provided the stated
158
+ conditions are met. This License explicitly affirms your unlimited
159
+ permission to run the unmodified Program. The output from running a
160
+ covered work is covered by this License only if the output, given its
161
+ content, constitutes a covered work. This License acknowledges your
162
+ rights of fair use or other equivalent, as provided by copyright law.
163
+
164
+ You may make, run and propagate covered works that you do not
165
+ convey, without conditions so long as your license otherwise remains
166
+ in force. You may convey covered works to others for the sole purpose
167
+ of having them make modifications exclusively for you, or provide you
168
+ with facilities for running those works, provided that you comply with
169
+ the terms of this License in conveying all material for which you do
170
+ not control copyright. Those thus making or running the covered works
171
+ for you must do so exclusively on your behalf, under your direction
172
+ and control, on terms that prohibit them from making any copies of
173
+ your copyrighted material outside their relationship with you.
174
+
175
+ Conveying under any other circumstances is permitted solely under
176
+ the conditions stated below. Sublicensing is not allowed; section 10
177
+ makes it unnecessary.
178
+
179
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
+
181
+ No covered work shall be deemed part of an effective technological
182
+ measure under any applicable law fulfilling obligations under article
183
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
+ similar laws prohibiting or restricting circumvention of such
185
+ measures.
186
+
187
+ When you convey a covered work, you waive any legal power to forbid
188
+ circumvention of technological measures to the extent such circumvention
189
+ is effected by exercising rights under this License with respect to
190
+ the covered work, and you disclaim any intention to limit operation or
191
+ modification of the work as a means of enforcing, against the work's
192
+ users, your or third parties' legal rights to forbid circumvention of
193
+ technological measures.
194
+
195
+ 4. Conveying Verbatim Copies.
196
+
197
+ You may convey verbatim copies of the Program's source code as you
198
+ receive it, in any medium, provided that you conspicuously and
199
+ appropriately publish on each copy an appropriate copyright notice;
200
+ keep intact all notices stating that this License and any
201
+ non-permissive terms added in accord with section 7 apply to the code;
202
+ keep intact all notices of the absence of any warranty; and give all
203
+ recipients a copy of this License along with the Program.
204
+
205
+ You may charge any price or no price for each copy that you convey,
206
+ and you may offer support or warranty protection for a fee.
207
+
208
+ 5. Conveying Modified Source Versions.
209
+
210
+ You may convey a work based on the Program, or the modifications to
211
+ produce it from the Program, in the form of source code under the
212
+ terms of section 4, provided that you also meet all of these conditions:
213
+
214
+ a) The work must carry prominent notices stating that you modified
215
+ it, and giving a relevant date.
216
+
217
+ b) The work must carry prominent notices stating that it is
218
+ released under this License and any conditions added under section
219
+ 7. This requirement modifies the requirement in section 4 to
220
+ "keep intact all notices".
221
+
222
+ c) You must license the entire work, as a whole, under this
223
+ License to anyone who comes into possession of a copy. This
224
+ License will therefore apply, along with any applicable section 7
225
+ additional terms, to the whole of the work, and all its parts,
226
+ regardless of how they are packaged. This License gives no
227
+ permission to license the work in any other way, but it does not
228
+ invalidate such permission if you have separately received it.
229
+
230
+ d) If the work has interactive user interfaces, each must display
231
+ Appropriate Legal Notices; however, if the Program has interactive
232
+ interfaces that do not display Appropriate Legal Notices, your
233
+ work need not make them do so.
234
+
235
+ A compilation of a covered work with other separate and independent
236
+ works, which are not by their nature extensions of the covered work,
237
+ and which are not combined with it such as to form a larger program,
238
+ in or on a volume of a storage or distribution medium, is called an
239
+ "aggregate" if the compilation and its resulting copyright are not
240
+ used to limit the access or legal rights of the compilation's users
241
+ beyond what the individual works permit. Inclusion of a covered work
242
+ in an aggregate does not cause this License to apply to the other
243
+ parts of the aggregate.
244
+
245
+ 6. Conveying Non-Source Forms.
246
+
247
+ You may convey a covered work in object code form under the terms
248
+ of sections 4 and 5, provided that you also convey the
249
+ machine-readable Corresponding Source under the terms of this License,
250
+ in one of these ways:
251
+
252
+ a) Convey the object code in, or embodied in, a physical product
253
+ (including a physical distribution medium), accompanied by the
254
+ Corresponding Source fixed on a durable physical medium
255
+ customarily used for software interchange.
256
+
257
+ b) Convey the object code in, or embodied in, a physical product
258
+ (including a physical distribution medium), accompanied by a
259
+ written offer, valid for at least three years and valid for as
260
+ long as you offer spare parts or customer support for that product
261
+ model, to give anyone who possesses the object code either (1) a
262
+ copy of the Corresponding Source for all the software in the
263
+ product that is covered by this License, on a durable physical
264
+ medium customarily used for software interchange, for a price no
265
+ more than your reasonable cost of physically performing this
266
+ conveying of source, or (2) access to copy the
267
+ Corresponding Source from a network server at no charge.
268
+
269
+ c) Convey individual copies of the object code with a copy of the
270
+ written offer to provide the Corresponding Source. This
271
+ alternative is allowed only occasionally and noncommercially, and
272
+ only if you received the object code with such an offer, in accord
273
+ with subsection 6b.
274
+
275
+ d) Convey the object code by offering access from a designated
276
+ place (gratis or for a charge), and offer equivalent access to the
277
+ Corresponding Source in the same way through the same place at no
278
+ further charge. You need not require recipients to copy the
279
+ Corresponding Source along with the object code. If the place to
280
+ copy the object code is a network server, the Corresponding Source
281
+ may be on a different server (operated by you or a third party)
282
+ that supports equivalent copying facilities, provided you maintain
283
+ clear directions next to the object code saying where to find the
284
+ Corresponding Source. Regardless of what server hosts the
285
+ Corresponding Source, you remain obligated to ensure that it is
286
+ available for as long as needed to satisfy these requirements.
287
+
288
+ e) Convey the object code using peer-to-peer transmission, provided
289
+ you inform other peers where the object code and Corresponding
290
+ Source of the work are being offered to the general public at no
291
+ charge under subsection 6d.
292
+
293
+ A separable portion of the object code, whose source code is excluded
294
+ from the Corresponding Source as a System Library, need not be
295
+ included in conveying the object code work.
296
+
297
+ A "User Product" is either (1) a "consumer product", which means any
298
+ tangible personal property which is normally used for personal, family,
299
+ or household purposes, or (2) anything designed or sold for incorporation
300
+ into a dwelling. In determining whether a product is a consumer product,
301
+ doubtful cases shall be resolved in favor of coverage. For a particular
302
+ product received by a particular user, "normally used" refers to a
303
+ typical or common use of that class of product, regardless of the status
304
+ of the particular user or of the way in which the particular user
305
+ actually uses, or expects or is expected to use, the product. A product
306
+ is a consumer product regardless of whether the product has substantial
307
+ commercial, industrial or non-consumer uses, unless such uses represent
308
+ the only significant mode of use of the product.
309
+
310
+ "Installation Information" for a User Product means any methods,
311
+ procedures, authorization keys, or other information required to install
312
+ and execute modified versions of a covered work in that User Product from
313
+ a modified version of its Corresponding Source. The information must
314
+ suffice to ensure that the continued functioning of the modified object
315
+ code is in no case prevented or interfered with solely because
316
+ modification has been made.
317
+
318
+ If you convey an object code work under this section in, or with, or
319
+ specifically for use in, a User Product, and the conveying occurs as
320
+ part of a transaction in which the right of possession and use of the
321
+ User Product is transferred to the recipient in perpetuity or for a
322
+ fixed term (regardless of how the transaction is characterized), the
323
+ Corresponding Source conveyed under this section must be accompanied
324
+ by the Installation Information. But this requirement does not apply
325
+ if neither you nor any third party retains the ability to install
326
+ modified object code on the User Product (for example, the work has
327
+ been installed in ROM).
328
+
329
+ The requirement to provide Installation Information does not include a
330
+ requirement to continue to provide support service, warranty, or updates
331
+ for a work that has been modified or installed by the recipient, or for
332
+ the User Product in which it has been modified or installed. Access to a
333
+ network may be denied when the modification itself materially and
334
+ adversely affects the operation of the network or violates the rules and
335
+ protocols for communication across the network.
336
+
337
+ Corresponding Source conveyed, and Installation Information provided,
338
+ in accord with this section must be in a format that is publicly
339
+ documented (and with an implementation available to the public in
340
+ source code form), and must require no special password or key for
341
+ unpacking, reading or copying.
342
+
343
+ 7. Additional Terms.
344
+
345
+ "Additional permissions" are terms that supplement the terms of this
346
+ License by making exceptions from one or more of its conditions.
347
+ Additional permissions that are applicable to the entire Program shall
348
+ be treated as though they were included in this License, to the extent
349
+ that they are valid under applicable law. If additional permissions
350
+ apply only to part of the Program, that part may be used separately
351
+ under those permissions, but the entire Program remains governed by
352
+ this License without regard to the additional permissions.
353
+
354
+ When you convey a copy of a covered work, you may at your option
355
+ remove any additional permissions from that copy, or from any part of
356
+ it. (Additional permissions may be written to require their own
357
+ removal in certain cases when you modify the work.) You may place
358
+ additional permissions on material, added by you to a covered work,
359
+ for which you have or can give appropriate copyright permission.
360
+
361
+ Notwithstanding any other provision of this License, for material you
362
+ add to a covered work, you may (if authorized by the copyright holders of
363
+ that material) supplement the terms of this License with terms:
364
+
365
+ a) Disclaiming warranty or limiting liability differently from the
366
+ terms of sections 15 and 16 of this License; or
367
+
368
+ b) Requiring preservation of specified reasonable legal notices or
369
+ author attributions in that material or in the Appropriate Legal
370
+ Notices displayed by works containing it; or
371
+
372
+ c) Prohibiting misrepresentation of the origin of that material, or
373
+ requiring that modified versions of such material be marked in
374
+ reasonable ways as different from the original version; or
375
+
376
+ d) Limiting the use for publicity purposes of names of licensors or
377
+ authors of the material; or
378
+
379
+ e) Declining to grant rights under trademark law for use of some
380
+ trade names, trademarks, or service marks; or
381
+
382
+ f) Requiring indemnification of licensors and authors of that
383
+ material by anyone who conveys the material (or modified versions of
384
+ it) with contractual assumptions of liability to the recipient, for
385
+ any liability that these contractual assumptions directly impose on
386
+ those licensors and authors.
387
+
388
+ All other non-permissive additional terms are considered "further
389
+ restrictions" within the meaning of section 10. If the Program as you
390
+ received it, or any part of it, contains a notice stating that it is
391
+ governed by this License along with a term that is a further
392
+ restriction, you may remove that term. If a license document contains
393
+ a further restriction but permits relicensing or conveying under this
394
+ License, you may add to a covered work material governed by the terms
395
+ of that license document, provided that the further restriction does
396
+ not survive such relicensing or conveying.
397
+
398
+ If you add terms to a covered work in accord with this section, you
399
+ must place, in the relevant source files, a statement of the
400
+ additional terms that apply to those files, or a notice indicating
401
+ where to find the applicable terms.
402
+
403
+ Additional terms, permissive or non-permissive, may be stated in the
404
+ form of a separately written license, or stated as exceptions;
405
+ the above requirements apply either way.
406
+
407
+ 8. Termination.
408
+
409
+ You may not propagate or modify a covered work except as expressly
410
+ provided under this License. Any attempt otherwise to propagate or
411
+ modify it is void, and will automatically terminate your rights under
412
+ this License (including any patent licenses granted under the third
413
+ paragraph of section 11).
414
+
415
+ However, if you cease all violation of this License, then your
416
+ license from a particular copyright holder is reinstated (a)
417
+ provisionally, unless and until the copyright holder explicitly and
418
+ finally terminates your license, and (b) permanently, if the copyright
419
+ holder fails to notify you of the violation by some reasonable means
420
+ prior to 60 days after the cessation.
421
+
422
+ Moreover, your license from a particular copyright holder is
423
+ reinstated permanently if the copyright holder notifies you of the
424
+ violation by some reasonable means, this is the first time you have
425
+ received notice of violation of this License (for any work) from that
426
+ copyright holder, and you cure the violation prior to 30 days after
427
+ your receipt of the notice.
428
+
429
+ Termination of your rights under this section does not terminate the
430
+ licenses of parties who have received copies or rights from you under
431
+ this License. If your rights have been terminated and not permanently
432
+ reinstated, you do not qualify to receive new licenses for the same
433
+ material under section 10.
434
+
435
+ 9. Acceptance Not Required for Having Copies.
436
+
437
+ You are not required to accept this License in order to receive or
438
+ run a copy of the Program. Ancillary propagation of a covered work
439
+ occurring solely as a consequence of using peer-to-peer transmission
440
+ to receive a copy likewise does not require acceptance. However,
441
+ nothing other than this License grants you permission to propagate or
442
+ modify any covered work. These actions infringe copyright if you do
443
+ not accept this License. Therefore, by modifying or propagating a
444
+ covered work, you indicate your acceptance of this License to do so.
445
+
446
+ 10. Automatic Licensing of Downstream Recipients.
447
+
448
+ Each time you convey a covered work, the recipient automatically
449
+ receives a license from the original licensors, to run, modify and
450
+ propagate that work, subject to this License. You are not responsible
451
+ for enforcing compliance by third parties with this License.
452
+
453
+ An "entity transaction" is a transaction transferring control of an
454
+ organization, or substantially all assets of one, or subdividing an
455
+ organization, or merging organizations. If propagation of a covered
456
+ work results from an entity transaction, each party to that
457
+ transaction who receives a copy of the work also receives whatever
458
+ licenses to the work the party's predecessor in interest had or could
459
+ give under the previous paragraph, plus a right to possession of the
460
+ Corresponding Source of the work from the predecessor in interest, if
461
+ the predecessor has it or can get it with reasonable efforts.
462
+
463
+ You may not impose any further restrictions on the exercise of the
464
+ rights granted or affirmed under this License. For example, you may
465
+ not impose a license fee, royalty, or other charge for exercise of
466
+ rights granted under this License, and you may not initiate litigation
467
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
468
+ any patent claim is infringed by making, using, selling, offering for
469
+ sale, or importing the Program or any portion of it.
470
+
471
+ 11. Patents.
472
+
473
+ A "contributor" is a copyright holder who authorizes use under this
474
+ License of the Program or a work on which the Program is based. The
475
+ work thus licensed is called the contributor's "contributor version".
476
+
477
+ A contributor's "essential patent claims" are all patent claims
478
+ owned or controlled by the contributor, whether already acquired or
479
+ hereafter acquired, that would be infringed by some manner, permitted
480
+ by this License, of making, using, or selling its contributor version,
481
+ but do not include claims that would be infringed only as a
482
+ consequence of further modification of the contributor version. For
483
+ purposes of this definition, "control" includes the right to grant
484
+ patent sublicenses in a manner consistent with the requirements of
485
+ this License.
486
+
487
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
488
+ patent license under the contributor's essential patent claims, to
489
+ make, use, sell, offer for sale, import and otherwise run, modify and
490
+ propagate the contents of its contributor version.
491
+
492
+ In the following three paragraphs, a "patent license" is any express
493
+ agreement or commitment, however denominated, not to enforce a patent
494
+ (such as an express permission to practice a patent or covenant not to
495
+ sue for patent infringement). To "grant" such a patent license to a
496
+ party means to make such an agreement or commitment not to enforce a
497
+ patent against the party.
498
+
499
+ If you convey a covered work, knowingly relying on a patent license,
500
+ and the Corresponding Source of the work is not available for anyone
501
+ to copy, free of charge and under the terms of this License, through a
502
+ publicly available network server or other readily accessible means,
503
+ then you must either (1) cause the Corresponding Source to be so
504
+ available, or (2) arrange to deprive yourself of the benefit of the
505
+ patent license for this particular work, or (3) arrange, in a manner
506
+ consistent with the requirements of this License, to extend the patent
507
+ license to downstream recipients. "Knowingly relying" means you have
508
+ actual knowledge that, but for the patent license, your conveying the
509
+ covered work in a country, or your recipient's use of the covered work
510
+ in a country, would infringe one or more identifiable patents in that
511
+ country that you have reason to believe are valid.
512
+
513
+ If, pursuant to or in connection with a single transaction or
514
+ arrangement, you convey, or propagate by procuring conveyance of, a
515
+ covered work, and grant a patent license to some of the parties
516
+ receiving the covered work authorizing them to use, propagate, modify
517
+ or convey a specific copy of the covered work, then the patent license
518
+ you grant is automatically extended to all recipients of the covered
519
+ work and works based on it.
520
+
521
+ A patent license is "discriminatory" if it does not include within
522
+ the scope of its coverage, prohibits the exercise of, or is
523
+ conditioned on the non-exercise of one or more of the rights that are
524
+ specifically granted under this License. You may not convey a covered
525
+ work if you are a party to an arrangement with a third party that is
526
+ in the business of distributing software, under which you make payment
527
+ to the third party based on the extent of your activity of conveying
528
+ the work, and under which the third party grants, to any of the
529
+ parties who would receive the covered work from you, a discriminatory
530
+ patent license (a) in connection with copies of the covered work
531
+ conveyed by you (or copies made from those copies), or (b) primarily
532
+ for and in connection with specific products or compilations that
533
+ contain the covered work, unless you entered into that arrangement,
534
+ or that patent license was granted, prior to 28 March 2007.
535
+
536
+ Nothing in this License shall be construed as excluding or limiting
537
+ any implied license or other defenses to infringement that may
538
+ otherwise be available to you under applicable patent law.
539
+
540
+ 12. No Surrender of Others' Freedom.
541
+
542
+ If conditions are imposed on you (whether by court order, agreement or
543
+ otherwise) that contradict the conditions of this License, they do not
544
+ excuse you from the conditions of this License. If you cannot convey a
545
+ covered work so as to satisfy simultaneously your obligations under this
546
+ License and any other pertinent obligations, then as a consequence you may
547
+ not convey it at all. For example, if you agree to terms that obligate you
548
+ to collect a royalty for further conveying from those to whom you convey
549
+ the Program, the only way you could satisfy both those terms and this
550
+ License would be to refrain entirely from conveying the Program.
551
+
552
+ 13. Use with the GNU Affero General Public License.
553
+
554
+ Notwithstanding any other provision of this License, you have
555
+ permission to link or combine any covered work with a work licensed
556
+ under version 3 of the GNU Affero General Public License into a single
557
+ combined work, and to convey the resulting work. The terms of this
558
+ License will continue to apply to the part which is the covered work,
559
+ but the special requirements of the GNU Affero General Public License,
560
+ section 13, concerning interaction through a network will apply to the
561
+ combination as such.
562
+
563
+ 14. Revised Versions of this License.
564
+
565
+ The Free Software Foundation may publish revised and/or new versions of
566
+ the GNU General Public License from time to time. Such new versions will
567
+ be similar in spirit to the present version, but may differ in detail to
568
+ address new problems or concerns.
569
+
570
+ Each version is given a distinguishing version number. If the
571
+ Program specifies that a certain numbered version of the GNU General
572
+ Public License "or any later version" applies to it, you have the
573
+ option of following the terms and conditions either of that numbered
574
+ version or of any later version published by the Free Software
575
+ Foundation. If the Program does not specify a version number of the
576
+ GNU General Public License, you may choose any version ever published
577
+ by the Free Software Foundation.
578
+
579
+ If the Program specifies that a proxy can decide which future
580
+ versions of the GNU General Public License can be used, that proxy's
581
+ public statement of acceptance of a version permanently authorizes you
582
+ to choose that version for the Program.
583
+
584
+ Later license versions may give you additional or different
585
+ permissions. However, no additional obligations are imposed on any
586
+ author or copyright holder as a result of your choosing to follow a
587
+ later version.
588
+
589
+ 15. Disclaimer of Warranty.
590
+
591
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
+
600
+ 16. Limitation of Liability.
601
+
602
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
+ SUCH DAMAGES.
611
+
612
+ 17. Interpretation of Sections 15 and 16.
613
+
614
+ If the disclaimer of warranty and limitation of liability provided
615
+ above cannot be given local legal effect according to their terms,
616
+ reviewing courts shall apply local law that most closely approximates
617
+ an absolute waiver of all civil liability in connection with the
618
+ Program, unless a warranty or assumption of liability accompanies a
619
+ copy of the Program in return for a fee.
620
+
621
+ END OF TERMS AND CONDITIONS
622
+
623
+ How to Apply These Terms to Your New Programs
624
+
625
+ If you develop a new program, and you want it to be of the greatest
626
+ possible use to the public, the best way to achieve this is to make it
627
+ free software which everyone can redistribute and change under these terms.
628
+
629
+ To do so, attach the following notices to the program. It is safest
630
+ to attach them to the start of each source file to most effectively
631
+ state the exclusion of warranty; and each file should have at least
632
+ the "copyright" line and a pointer to where the full notice is found.
633
+
634
+ <one line to give the program's name and a brief idea of what it does.>
635
+ Copyright (C) <year> <name of author>
636
+
637
+ This program is free software: you can redistribute it and/or modify
638
+ it under the terms of the GNU General Public License as published by
639
+ the Free Software Foundation, either version 3 of the License, or
640
+ (at your option) any later version.
641
+
642
+ This program is distributed in the hope that it will be useful,
643
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
644
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
+ GNU General Public License for more details.
646
+
647
+ You should have received a copy of the GNU General Public License
648
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
649
+
650
+ Also add information on how to contact you by electronic and paper mail.
651
+
652
+ If the program does terminal interaction, make it output a short
653
+ notice like this when it starts in an interactive mode:
654
+
655
+ <program> Copyright (C) <year> <name of author>
656
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
+ This is free software, and you are welcome to redistribute it
658
+ under certain conditions; type `show c' for details.
659
+
660
+ The hypothetical commands `show w' and `show c' should show the appropriate
661
+ parts of the General Public License. Of course, your program's commands
662
+ might be different; for a GUI interface, you would use an "about box".
663
+
664
+ You should also get your employer (if you work as a programmer) or school,
665
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
666
+ For more information on this, and how to apply and follow the GNU GPL, see
667
+ <https://www.gnu.org/licenses/>.
668
+
669
+ The GNU General Public License does not permit incorporating your program
670
+ into proprietary programs. If your program is a subroutine library, you
671
+ may consider it more useful to permit linking proprietary applications with
672
+ the library. If this is what you want to do, use the GNU Lesser General
673
+ Public License instead of this License. But first, please read
674
+ <https://www.gnu.org/licenses/why-not-lgpl.html>.
README.md CHANGED
@@ -1,10 +1,952 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
- title: Gg
3
- emoji: 🌖
4
- colorFrom: blue
5
- colorTo: red
6
- sdk: docker
7
- pinned: false
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <p align="center">
2
+ <a href="https://github.com/weebzone/WZML">
3
+ <kbd>
4
+ <img width="250" src="https://graph.org/file/639fe4239b78e5862b302.jpg" alt="WZML-X Logo">
5
+ </kbd>
6
+ </a>
7
+
8
+ <i>A Telegram Bot written in Python using Pyrogram Framework for mirroring/cloning online/local files on the Internet to your Google Drive, Telegram or to any RClone supported cloud. Based on [python-aria-mirror-bot](https://github.com/lzzy12/python-aria-mirror-bot). This is Enhanced Version of Base Repo [mirror-leech-telegram-bot](https://github.com/anasty17/mirror-leech-telegram-bot)</i>
9
+
10
+ </p>
11
+
12
+ <div align=center>
13
+
14
+ ----
15
+
16
+ [![](https://img.shields.io/github/repo-size/weebzone/WZML-X?color=green&label=Repo%20Size&labelColor=292c3b)](#) [![](https://img.shields.io/github/commit-activity/m/weebzone/WZML-X?logo=github&labelColor=292c3b&label=Github%20Commits)](#) [![](https://img.shields.io/github/license/weebzone/WZML-X?style=flat&label=License&labelColor=292c3b)](#)|[![](https://img.shields.io/github/issues-raw/weebzone/WZML-X?style=flat&label=Open%20Issues&labelColor=292c3b)](#) [![](https://img.shields.io/github/issues-closed-raw/weebzone/WZML-X?style=flat&label=Closed%20Issues&labelColor=292c3b)](#) [![](https://img.shields.io/github/issues-pr-raw/weebzone/WZML-X?style=flat&label=Open%20Pull%20Requests&labelColor=292c3b)](#) [![](https://img.shields.io/github/issues-pr-closed-raw/weebzone/WZML-X?style=flat&label=Closed%20Pull%20Requests&labelColor=292c3b)](#)
17
+ :---:|:---:|
18
+ [![](https://img.shields.io/github/languages/count/weebzone/WZML-X?style=flat&label=Total%20Languages&labelColor=292c3b&color=blueviolet)](#) [![](https://img.shields.io/github/languages/top/weebzone/WZML-X?style=flat&logo=python&labelColor=292c3b)](#) [![](https://img.shields.io/github/last-commit/weebzone/WZML-X?style=flat&label=Last%20Commit&labelColor=292c3b&color=important)](#) [![](https://badgen.net/github/branches/weebzone/WZML-X?label=Total%20Branches&labelColor=292c3b)](#)|[![](https://img.shields.io/github/forks/weebzone/WZML-X?style=flat&logo=github&label=Forks&labelColor=292c3b&color=critical)](#) [![](https://img.shields.io/github/stars/weebzone/WZML-X?style=flat&logo=github&label=Stars&labelColor=292c3b&color=yellow)](#) [![](https://badgen.net/docker/pulls/codewithweeb/weebzone?icon=docker&label=Pulls&labelColor=292c3b&color=blue)](#)
19
+ [![](https://img.shields.io/badge/Telegram%20Channel-Join-9cf?style=for-the-badge&logo=telegram&logoColor=blue&style=flat&labelColor=292c3b)](https://t.me/WZML_X) |[![](https://img.shields.io/badge/Support%20Group-Join-9cf?style=for-the-badge&logo=telegram&logoColor=blue&style=flat&labelColor=292c3b)](https://t.me/WZML_Support) |
20
+
21
+ </div>
22
+
23
  ---
24
+
25
+ ## 📑 ***Repo Features***
26
+
27
+ <details>
28
+ <summary><b>View All Features <sup><kbd>Click Here</kbd></sup></b></summary>
29
+ <ol><li><details>
30
+ <summary><b>qBittorrent</b></summary>
31
+
32
+ - Qbittorrent support
33
+ - Select files from Torrent before and while downloading
34
+ - Seed torrents to specific ratio and time
35
+ - Edit Global Options while bot running from bot settings
36
+
37
+ </details></li>
38
+ <li><details>
39
+ <summary><b>Aria2c</b></summary>
40
+
41
+ - Select files from Torrent before and while downloading
42
+ - Seed torrents to specific ratio and time
43
+ - Netrc support
44
+ - Direct link authentication for specific link while using the bot (it will work even if only username or password)
45
+ - Improve aria.sh
46
+ - Fix all download listener functions and status
47
+ - Edit Global Options while bot running from bot settings
48
+
49
+ </details></li>
50
+ <li><details>
51
+ <summary><b>TG Upload/Download</b></summary>
52
+
53
+ - Leech (File Upload to TG) support
54
+ - Splitting File with Specific Size
55
+ - Thumbnail for each user
56
+ - Leech prefix, suffic, remname (remove specific words via Regex) for each user.
57
+ - Set upload as document or as media for each user
58
+ - 2GB+ file upload with premium account and lower size with bot
59
+ - Upload all files to specific superGroup/channel.
60
+ - Leech Split size and equal split size settings for each user
61
+ - Ability to leech splitted file parts in media group. Setting for each user
62
+ - Download using premium account if available
63
+ - Download restricted messages (document or link) by tg private/public/super links
64
+
65
+ </details></li>
66
+ <li><details>
67
+ <summary><b>Google Drive</b></summary>
68
+
69
+ - Stop duplicates for all tasks
70
+ - Download from Google Drive
71
+ - Counting Google Drive files/folders
72
+ - Search in multiple Drive folder/TeamDrive
73
+ - Recursive Search (only with `root` or TeamDrive ID, folder ids will be listed with non-recursive method). Based on [Sreeraj](https://github.com/SVR666) searchX-bot.
74
+ - Use `token.pickle` if file not found with Service Account, for all Gdrive functions
75
+ - Random Service Account for each task
76
+
77
+ </details></li>
78
+ <li><details>
79
+ <summary><b>Multiple Status</b></summary>
80
+
81
+ - Clone Status
82
+ - Extract Status
83
+ - Archive Status
84
+ - Seed Status
85
+ - Status Pages for unlimited tasks
86
+ - Ability to cancel upload/clone/archive/extract/split
87
+ - Cancel all buttons for choosing specific tasks status to cancel
88
+ - Fix flooding issues
89
+ - Fix overall upload and download speed
90
+
91
+ </details></li>
92
+ <li><details>
93
+ <summary><b>yt-dlp</b></summary>
94
+
95
+ - Switch from youtube-dl to yt-dlp and fix all conflicts
96
+ - Yt-dlp quality buttons
97
+ - Ability to use specific yt-dlp option for each task
98
+ - Custom default yt-dlp options for each user
99
+ - Fix download progress
100
+ - Embed original thumbnail and add it for leech
101
+ - All supported audio formats
102
+
103
+ </details></li>
104
+ <li><details>
105
+ <summary><b>Database (MongoDb)</b></summary>
106
+
107
+ - Mongo Database support
108
+ - Store bot settings
109
+ - Store user settings including thumbnails and rclone config in database
110
+ - Store private files
111
+ - Store RSS data
112
+ - Store incompleted task messages
113
+
114
+ </details></li>
115
+ <li><details>
116
+ <summary><b>Torrent</b></summary>
117
+
118
+ - Torrent search support
119
+ - Search on torrents with Torrent Search API
120
+ - Search on torrents with variable plugins using qBittorrent search engine
121
+
122
+ </details></li>
123
+ <li><details>
124
+ <summary><b>Archives</b></summary>
125
+
126
+ - Zip instead of tar ( Change Soon to zip, tar, rar, 7z )
127
+ - Using 7-zip tool to extract all supported types
128
+ - Extract rar, zip and 7z within folder or splits with or without password
129
+ - Zip file/folder with or without password
130
+
131
+ </details></li>
132
+ <li><details>
133
+ <summary><b>RSS Feed</b></summary>
134
+
135
+ - Rss feed. Based on this repository [rss-chan](https://github.com/hyPnOtICDo0g/rss-chan)
136
+ - Filters added
137
+ - Edit any feed while running: pause, resume, edit command and edit filters
138
+ - Rss for each user with tag
139
+ - Sudo settings to control users feeds
140
+ - All functions have been improved using buttons from one command.
141
+
142
+ </details></li>
143
+ <li><details>
144
+ <summary><b>RClone</b></summary>
145
+
146
+ - Download and Upload using rclone with and without random service accounts
147
+ - Ability to choose config, remote and path from list with buttons
148
+ - Ability to set rclone flags for each task or globally from config
149
+ - Rclone.conf for each user
150
+ - Clone server-side
151
+ - Rclone serve for combine remote to use it as index from all remotes
152
+
153
+ </details></li></ol>
154
+ </details>
155
+
156
+ <details>
157
+ <summary><b>Overall Features</b></summary>
158
+
159
+ - Docker image support for linux `amd64, arm64/v8, arm/v7`
160
+ - Switch from sync to async
161
+ - Switch from python-telegram-bot to pyrogram
162
+ - Edit variables and overwrite the private files while bot running
163
+ - Update bot at startup and with restart command using `UPSTREAM_REPO`
164
+ - Improve Telegraph. Based on [Sreeraj](https://github.com/SVR666) loaderX-bot
165
+ - Mirror/Leech/Watch/Clone/Count/Del by reply
166
+ - Mirror/Leech/Clone multi links/files with one command
167
+ - Custom name for all links except torrents. For files you should add extension except yt-dlp links
168
+ - Extensions Filter for the files to be uploaded/cloned
169
+ - View Link button. Extra button to open index link in broswer instead of direct download for file
170
+ - Queueing System for all tasks
171
+ - Ability to zip/unzip multi links in same directory. Mostly helpful in unziping tg file parts
172
+ - Bulk download from telegram txt file or text message contains links seperated by new line
173
+ - Join splitted files that have splitted before by split linux pkg
174
+ - Almost all repository functions have been improved and many other details can't mention all of them
175
+ - Many bugs have been fixed
176
+ - Bot Limits for each user
177
+ - View In Brief on WZML_X Tg Channel
178
+
179
+ </details>
180
+ <details>
181
+ <summary><b>From Base and other Repositories</b></summary>
182
+
183
+ - Mirror direct download links, Torrent, Mega.nz and Telegram files to Google Drive
184
+ - Copy files from someone's Drive to your Drive
185
+ - Download/Upload progress, Speeds and ETAs
186
+ - Mirror all youtube-dl supported links
187
+ - Docker support
188
+ - Uploading to Team Drive
189
+ - Index Link support
190
+ - Service Account support
191
+ - Delete files from Drive
192
+ - Multiple Trackers support
193
+ - Shell and Executor
194
+ - Add sudo users
195
+ - Extract password protected files
196
+ - Extract these filetypes
197
+ > ZIP, RAR, TAR, 7z, ISO, WIM, CAB, GZIP, BZIP2, APM, ARJ, CHM, CPIO, CramFS, DEB, DMG, FAT, HFS, LZH, LZMA, LZMA2, MBR, MSI, MSLZ, NSIS, NTFS, RPM, SquashFS, UDF, VHD, XAR, Z, TAR.XZ
198
+ - Direct links Supported:
199
+ > mediafire, letsupload.io, hxfile.co, antfiles, fembed.com, fembed.net, femax20.com, layarkacaxxi.icu, fcdn.stream, sbplay.org, naniplay.com, naniplay.nanime.in, naniplay.nanime.biz, sbembed.com, streamtape.com, streamsb.net, feurl.com, upload.ee, pixeldrain.com, racaty.net, 1fichier.com, 1drv.ms (Only works for file not folder or business account), uptobox.com and solidfiles.com, linkbox.to, shrdsk.me (sharedisk.io), akmfiles.com, wetransfer.com, mdisk.me (with ytdl), terabox.com (you need to add cookies txt with name) [terabox.txt](https://github.com/ytdl-org/youtube-dl#how-do-i-pass-cookies-to-youtube-dl) and almost every anonfiles based sites
200
+
201
+ </details>
202
+
203
  ---
204
 
205
+ ## 🗄 ***Deployment Guide***
206
+
207
+ <details>
208
+ <summary><b>View All Steps</b> <sup><kbd>Click Here</kbd></sup></summary>
209
+ <ol><li><details>
210
+ <summary>Prerequisites</summary>
211
+
212
+ - Tutorial Video from A to Z:</li>
213
+ - Thanks to [Wiszky](https://github.com/vishnoe115)</li>
214
+
215
+ <p><a href="https://youtu.be/IUmq1paCiHI"> <img src="https://img.shields.io/badge/See%20Video-black?style=for-the-badge&logo=YouTube" width="160"/></a></p>
216
+ </details></li>
217
+ <li><details>
218
+ <summary>Installing requirements</summary>
219
+
220
+ - Clone this repo:
221
+
222
+ ```
223
+ git clone https://github.com/weebzone/WZML-X mirrorbot/ && cd mirrorbot
224
+ ```
225
+
226
+ - For Debian based distros
227
+
228
+ ```
229
+ sudo apt install python3 python3-pip
230
+ ```
231
+
232
+ Install Docker by following the [official Docker docs](https://docs.docker.com/engine/install/debian/)
233
+
234
+ - For Arch and it's derivatives:
235
+
236
+ ```
237
+ sudo pacman -S docker python
238
+ ```
239
+
240
+ - Install dependencies for running setup scripts:
241
+
242
+ ```
243
+ pip3 install -r requirements-cli.txt
244
+ ```
245
+
246
+ </details></li>
247
+ <li><details>
248
+ <summary>Setting up config file</summary>
249
+
250
+
251
+ ```
252
+ cp config_sample.env config.env
253
+ ```
254
+
255
+ - Remove the first line saying:
256
+
257
+ ```
258
+ _____REMOVE_THIS_LINE_____=True
259
+ ```
260
+
261
+ Fill up rest of the fields. Meaning of each field is discussed below. **NOTE**: All values must be filled between quotes, even if it's `Int`, `Bool` or `List`.
262
+
263
+ </details></li>
264
+ <li><details>
265
+ <summary>Build And Run the Docker Image</summary>
266
+
267
+ Make sure you still mount the app folder and installed the docker from official documentation.
268
+
269
+ - There are two methods to build and run the docker:
270
+ 1. Using official docker commands.
271
+ 2. Using docker-compose. (Recommended)
272
+
273
+ ------
274
+
275
+ #### Build And Run The Docker Image Using Official Docker Commands
276
+
277
+ - Start Docker daemon (SKIP if already running, mostly you don't need to do this):
278
+
279
+ ```
280
+ sudo dockerd
281
+ ```
282
+
283
+ - Build Docker image:
284
+
285
+ ```
286
+ sudo docker build . -t wzmlx
287
+ ```
288
+
289
+ - Run the image:
290
+
291
+ ```
292
+ sudo docker run -p 80:80 -p 8080:8080 wzmlx
293
+ ```
294
+
295
+ - To stop the running image:
296
+
297
+ ```
298
+ sudo docker ps
299
+ ```
300
+
301
+ ```
302
+ sudo docker stop id
303
+ ```
304
+
305
+ ----
306
+
307
+ #### Build And Run The Docker Image Using docker-compose
308
+
309
+ **NOTE**: If you want to use ports other than 80 and 8080 for torrent file selection and rclone serve respectively, change it in [docker-compose.yml](https://github.com/weebzone/WZML-X/blob/master/docker-compose.yml) also.
310
+
311
+ - Install docker-compose
312
+
313
+ ```
314
+ sudo apt install docker-compose
315
+ ```
316
+
317
+ - Build and run Docker image or to view current running image:
318
+
319
+ ```
320
+ sudo docker-compose up
321
+ ```
322
+
323
+ - After editing files with nano for example (nano start.sh):
324
+
325
+ ```
326
+ sudo docker-compose up --build
327
+ ```
328
+
329
+ - To stop the running image:
330
+
331
+ ```
332
+ sudo docker-compose stop
333
+ ```
334
+
335
+ - To run the image:
336
+
337
+ ```
338
+ sudo docker-compose start
339
+ ```
340
+
341
+ - To get latest log from already running image (after mounting the folder):
342
+
343
+ ```
344
+ sudo docker-compose up
345
+ ```
346
+
347
+ - Tutorial video from Tortoolkit repo for docker-compose and checking ports
348
+
349
+ <p><a href="https://youtu.be/c8_TU1sPK08"> <img src="https://img.shields.io/badge/See%20Video-black?style=for-the-badge&logo=YouTube" width="160"/></a></p>
350
+
351
+ ------
352
+
353
+ #### Docker Notes
354
+
355
+ **IMPORTANT NOTES**:
356
+
357
+ 1. Set `BASE_URL_PORT` and `RCLONE_SERVE_PORT` variables to any port you want to use. Default is `80` and `8080` respectively.
358
+ 2. You should stop the running image before deleting the container and you should delete the container before the image.
359
+ 3. To delete the container (this will not affect on the image):
360
+
361
+ ```
362
+ sudo docker container prune
363
+ ```
364
+
365
+ 4. To delete the images:
366
+
367
+ ```
368
+ sudo docker image prune -a
369
+ ```
370
+
371
+ 5. Check the number of processing units of your machine with `nproc` cmd and times it by 4, then edit `AsyncIOThreadsCount` in qBittorrent.conf.
372
+
373
+ </details></li></ol>
374
+ </details>
375
+
376
+ ------
377
+
378
+ ### 🤖 ***Bot Commands***
379
+
380
+ <details>
381
+ <summary>Bot commands can be automatically set by <code>SET_COMMANDS</code> Var <sup><kbd>View All Commands</kbd></sup></summary>
382
+
383
+ ```
384
+ mirror - or /m Mirror
385
+ qbmirror - or /qm Mirror torrent using qBittorrent
386
+ leech - or /l Leech
387
+ qbleech - or /ql Leech torrent using qBittorrent
388
+ clone - Copy file/folder to Drive
389
+ count - Count file/folder from Drive
390
+ ytdl - or /y Mirror yt-dlp supported link
391
+ ytdlleech - or /yl Leech through yt-dlp supported link
392
+ usetting - User settings
393
+ bsetting - Bot settings
394
+ status - Get Mirror Status message
395
+ btsel - Select files from torrent
396
+ rss - Rss menu
397
+ list - Search files in Drive
398
+ search - Search for torrents with API
399
+ cancel - Cancel a task
400
+ cancelall - Cancel all tasks
401
+ del - Delete file/folder from Drive
402
+ log - Get the Bot Log
403
+ shell - Run commands in Shell
404
+ restart - Restart the Bot
405
+ stats - Bot Usage Stats
406
+ ping - Ping the Bot
407
+ help - All cmds with description
408
+ ```
409
+
410
+ </details>
411
+
412
+
413
+ ### 📝 ***Variables Description:***
414
+
415
+ <details>
416
+ <summary><b>View All Variables </b><sup><kbd>Click Here</kbd></sup></summary>
417
+ <ol><li><details>
418
+ <summary><b>Required Fields</b></summary>
419
+
420
+ - `BOT_TOKEN`: The Telegram Bot Token that you got from [@BotFather](https://t.me/BotFather). `Str`
421
+ - `OWNER_ID`: The Telegram User ID (not username) of the Owner of the bot. `Int`
422
+ - `TELEGRAM_API`: This is to authenticate your Telegram account for downloading Telegram files. You can get this from <https://my.telegram.org>. `Int`
423
+ - `TELEGRAM_HASH`: This is to authenticate your Telegram account for downloading Telegram files. You can get this from <https://my.telegram.org>. `Str`
424
+
425
+ </details></li>
426
+ <li><details>
427
+ <summary><b>Optional Fields</b></summary>
428
+
429
+ - `USER_SESSION_STRING`: To download/upload from your telegram account and to send rss. To generate session string use this command `python3 generate_string_session.py` after mounting repo folder for sure. `Str`. **NOTE**: You can't use bot with private message. Use it with superGroup.
430
+ - `DATABASE_URL`: Your Mongo Database URL (Connection string). Follow this [Generate Database](https://github.com/weebzone/WZML-X/tree/master#generate-database) to generate database. Data will be saved in Database: auth and sudo users, users settings including thumbnails for each user, rss data and incomplete tasks. **NOTE**: You can always edit all settings that saved in database from the official site -> (Browse collections). `Str`
431
+ - `DOWNLOAD_DIR`: The path to the local folder where the downloads should be downloaded to. `Str`
432
+ - `CMD_SUFFIX`: commands index number. This number will added at the end all commands. `Str`|`Int`
433
+ - `AUTHORIZED_CHATS`: Fill user_id and chat_id of groups/users you want to authorize. Separate them by space. `Int`
434
+ - `SUDO_USERS`: Fill user_id of users whom you want to give sudo permission. Separate them by space. `Int`
435
+ - `DEFAULT_UPLOAD`: Whether `rc` to upload to `RCLONE_PATH` or `gd` to upload to `GDRIVE_ID` or `ddl` to upload to `DDL`. Default is `gd`. Read More [HERE](https://github.com/weebzone/WZML-X/tree/master#upload).`Str`
436
+ - `STATUS_UPDATE_INTERVAL`: Time in seconds after which the progress/status message will be updated. Recommended `10` seconds at least. `Int`
437
+ - `AUTO_DELETE_MESSAGE_DURATION`: Interval of time (in seconds), after which the bot deletes it's message and command message which is expected to be viewed instantly. **NOTE**: Set to `-1` to disable auto message deletion. `Int`
438
+ - `STATUS_LIMIT`: Limit the no. of tasks shown in status message with buttons. Default is `10`. **NOTE**: Recommended limit is `4` tasks. `Int`
439
+ - `EXTENSION_FILTER`: File extensions that won't upload/clone. Separate them by space. `Str`
440
+ - `INCOMPLETE_TASK_NOTIFIER`: Get incomplete task messages after restart. Require database and superGroup. Default is `False`. `Bool`
441
+ - `UPTOBOX_TOKEN`: Uptobox token to mirror uptobox links. Get it from [Uptobox Premium Account](https://uptobox.com/my_account). `str`
442
+ - `YT_DLP_OPTIONS`: Default yt-dlp options. Check all possible options [HERE](https://github.com/yt-dlp/yt-dlp/blob/master/yt_dlp/YoutubeDL.py#L184) or use this [script](https://t.me/mltb_official/177) to convert cli arguments to api options. Format: key:value|key:value|key:value. Add `^` before integer or float, some numbers must be numeric and some string. `str`
443
+ - Example: "format:bv*+mergeall[vcodec=none]|nocheckcertificate:True"
444
+ - `USE_SERVICE_ACCOUNTS`: Whether to use Service Accounts or not, with google-api-python-client. For this to work see [Using Service Accounts](https://github.com/weebzone/WZML-X#generate-service-accounts-what-is-service-account) section below. Default is `False`. `Bool`
445
+ - `SAVE_MSG`: Save Button in each file and link so that every user direcly save it without forwarding. Default is `False`. `Bool`
446
+ - `SET_COMMANDS`: Automatically set the Bot Commands no need to set from `@botfather`. Default is `False`. `Bool`
447
+ - `FSUB_IDS`: Fill chat_id(-100xxxxxx) of groups/channel you want to force subscribe. Separate them by space. Int
448
+ - Note: Bot should be added in the filled chat_id as admin
449
+ - `BOT_PM`: File/links send to the BOT PM. Default is `False`. `Bool`
450
+ - `BOT_MAX_TASKS`: Limit the Maximum task for bots of group at a time. `Int`
451
+ </details></li>
452
+ <li><details>
453
+ <summary><b>GDrive Tools</b></summary>
454
+
455
+ - `GDRIVE_ID`: This is the Folder/TeamDrive ID of the Google Drive OR `root` to which you want to upload all the mirrors using google-api-python-client. `Str`
456
+ - `IS_TEAM_DRIVE`: Set `True` if uploading to TeamDrive using google-api-python-client. Default is `False`. `Bool`
457
+ - `INDEX_URL`: Refer to <https://gitlab.com/ParveenBhadooOfficial/Google-Drive-Index>. `Str`
458
+ - `STOP_DUPLICATE`: Bot will check file/folder name in Drive incase uploading to `GDRIVE_ID`. If it's present in Drive then downloading or cloning will be stopped. (**NOTE**: Item will be checked using name and not hash, so this feature is not perfect yet). Default is `False`. `Bool`
459
+ - `DISABLE_DRIVE_LINK`: Disable drive link button. Default is `False`. `Bool`
460
+ - `GD_INFO`: Description of file/folder uploaded to Google Drive.
461
+
462
+ </details></li>
463
+ <li><details>
464
+ <summary><b>RClone</b></summary>
465
+
466
+ - `RCLONE_PATH`: Default rclone path to which you want to upload all the files/folders using rclone. `Str`
467
+ - `RCLONE_FLAGS`: key:value|key|key|key:value . Check here all [RcloneFlags](https://rclone.org/flags/). `Str`
468
+ - `RCLONE_SERVE_URL`: Valid URL where the bot is deployed to use rclone serve. Format of URL should be `http://myip`, where `myip` is the IP/Domain(public) of your bot or if you have chosen port other than `80` so write it in this format `http://myip:port` (`http` and not `https`). `Str`
469
+ - `RCLONE_SERVE_PORT`: Which is the **RCLONE_SERVE_URL** Port. Default is `8080`. `Int`
470
+ - `RCLONE_SERVE_USER`: Username for rclone serve authentication. `Str`
471
+ - `RCLONE_SERVE_PASS`: Password for rclone serve authentication. `Str`
472
+
473
+ </details></li>
474
+ <li><details>
475
+ <summary><b>Update</b></summary>
476
+
477
+ - `UPSTREAM_REPO`: Your github repository link, if your repo is private add `https://username:{githubtoken}@github.com/{username}/{reponame}` format. Get token from [Github settings](https://github.com/settings/tokens). So you can update your bot from filled repository on each restart. `Str`.
478
+ - **NOTE**: Any change in docker or requirements you need to deploy/build again with updated repo to take effect. DON'T delete .gitignore file. For more information read [THIS](https://github.com/weebzone/WZML-X/tree/master#upstream-repo-recommended).
479
+ - `UPSTREAM_BRANCH`: Upstream branch for update. Default is `master`. `Str`
480
+
481
+ </details></li>
482
+ <li><details>
483
+ <summary><b>Telegram Leech & Mirror</b></summary>
484
+
485
+ - `LEECH_SPLIT_SIZE`: Size of split in bytes. Default is `2GB`. Default is `4GB` if your account is premium. `Int`
486
+ - `AS_DOCUMENT`: Default type of Telegram file upload. Default is `False` mean as media. `Bool`
487
+ - `EQUAL_SPLITS`: Split files larger than **LEECH_SPLIT_SIZE** into equal parts size (Not working with zip cmd). Default is `False`. `Bool`
488
+ - `MEDIA_GROUP`: View Uploaded splitted file parts in media group. Default is `False`. `Bool`.
489
+ - `LEECH_FILENAME_PREFIX`: Add custom prefix to leeched file name. `Str`
490
+ - `LEECH_FILENAME_SUFFIX`: Add custom suffix to leeched file name. `Str`
491
+ - `LEECH_FILENAME_CAPTION`: Add custom caption to leeched file. `Str`
492
+ - `LEECH_FILENAME_REMNAME`: Remove custom word from leeched file name. `Str`
493
+ - `MIRROR_FILENAME_PREFIX`: Add custom prefix to mirrored file name. `Str`
494
+ - `MIRROR_FILENAME_SUFFIX`: Add custom suffix to mirrored file name. `Str`
495
+ - `MIRROR_FILENAME_REMNAME`: Remove custom word from mirrored file name. `Str`
496
+
497
+ </details></li>
498
+ <li><details>
499
+ <summary><b>Log Channel</b></summary>
500
+
501
+ - `LEECH_LOG_ID`: Chat ID to where leeched files would be uploaded. `Int`. **NOTE**: Only available for superGroup/channel. Add `-100` before channel/superGroup id. In short don't add bot id or your id!
502
+ - `MIRROR_LOG_ID`: Chat ID to where Mirror files would be Send. `Int`. **NOTE**: Only available for superGroup/channel. Add `-100` before channel/superGroup id. In short don't add bot id or your id!.
503
+ - `LINKS_LOG_ID`: Chat ID to where Link logs would be Send. `Int`. **NOTE**: Only available for superGroup/channel. Add `-100` before channel/superGroup id. In short don't add bot id or your id!.
504
+ - **Note**: LEECH_LOG_ID & MIRROR_LOG_ID it's multiple, For multiple id Separate them by space.
505
+ </details></li>
506
+ <li><details>
507
+ <summary><b>qBittorrent/Aria2c</b></summary>
508
+
509
+ - `TORRENT_TIMEOUT`: Timeout of dead torrents downloading with qBittorrent and Aria2c in seconds. `Int`
510
+ - `BASE_URL`: Valid BASE URL where the bot is deployed to use torrent web files selection. Format of URL should be `http://myip`, where `myip` is the IP/Domain(public) of your bot or if you have chosen port other than `80` so write it in this format `http://myip:port` (`http` and not `https`). `Str`
511
+ - `BASE_URL_PORT`: Which is the **BASE_URL** Port. Default is `80`. `Int`
512
+ - `WEB_PINCODE`: Whether to ask for pincode before selecting files from torrent in web or not. Default is `False`. `Bool`.
513
+ - **Qbittorrent NOTE**: If your facing ram issues then set limit for `MaxConnections`, decrease `AsyncIOThreadsCount`, set limit of `DiskWriteCacheSize` to `32` and decrease `MemoryWorkingSetLimit` from qbittorrent.conf or bsetting command.
514
+
515
+ </details></li>
516
+ <li><details>
517
+ <summary><b>RSS</b></summary>
518
+
519
+ - `RSS_DELAY`: Time in seconds for rss refresh interval. Recommended `900` second at least. Default is `900` in sec. `Int`
520
+ - `RSS_CHAT_ID`: Chat ID where rss links will be sent. If you want message to be sent to the channel then add channel id. Add `-100` before channel id. `Int`
521
+ - **RSS NOTES**: `RSS_CHAT_ID` is required, otherwise monitor will not work. You must use `USER_STRING_SESSION` --OR-- *CHANNEL*. If using channel then bot should be added in both channel and group(linked to channel) and `RSS_CHAT_ID` is the channel id, so messages sent by the bot to channel will be forwarded to group. Otherwise with `USER_STRING_SESSION` add group id for `RSS_CHAT_ID`. If `DATABASE_URL` not added you will miss the feeds while bot offline.
522
+
523
+ </details></li>
524
+ <li><details>
525
+ <summary><b>Mega</b></summary>
526
+
527
+ - `MEGA_EMAIL`: E-Mail used to sign-in on mega.nz for using premium account. `Str`
528
+ - `MEGA_PASSWORD`: Password for mega.nz account. `Str`
529
+
530
+ </details></li>
531
+ <li><details>
532
+ <summary><b>Queue System</b></summary>
533
+
534
+ - `QUEUE_ALL`: Number of parallel tasks of downloads and uploads. For example if 20 task added and `QUEUE_ALL` is `8`, then the summation of uploading and downloading tasks are 8 and the rest in queue. `Int`. **NOTE**: if you want to fill `QUEUE_DOWNLOAD` or `QUEUE_UPLOAD`, then `QUEUE_ALL` value must be greater than or equal to the greatest one and less than or equal to summation of `QUEUE_UPLOAD` and `QUEUE_DOWNLOAD`.
535
+ - `QUEUE_DOWNLOAD`: Number of all parallel downloading tasks. `Int`
536
+ - `QUEUE_UPLOAD`: Number of all parallel uploading tasks. `Int`
537
+
538
+ </details></li>
539
+ <li><details>
540
+ <summary><b>Limits</b></summary>
541
+
542
+ - `DAILY_TASK_LIMIT`: Maximum task a user can do in one day. use the `Int`
543
+ - `DAILY_MIRROR_LIMIT`: Total size upto which user can Mirror in one day. the default unit is `GB`. `Int`
544
+ - `DAILY_LEECH_LIMIT`: Total size upto which user can Leech in one day. the default unit is `GB`. `Int`
545
+ - `USER_MAX_TASKS`: Limit the Maximum task for users of group at a time. `Int`
546
+ - `TORRENT_LIMIT`: To limit the size of torrent download. the default unit is `GB`. `Int`
547
+ - `DIRECT_LIMIT`: To limit the size of direct link download. the default unit is `GB`. `Int`
548
+ - `GDRIVE_LIMIT`: To limit the size of Google Drive folder/file link for leech, Zip, Unzip. the default unit is `GB`. `Int`
549
+ - `CLONE_LIMIT`: To limit the size of Google Drive folder/file which you can clone. the default unit is `GB`. `Int`
550
+ - `YTDLP_LIMIT`: To limit the size of ytdlp download. the default unit is `GB`. `Int`
551
+ - `PLAYLIST_LIMIT`: To limit Maximum Playlist Number. `Int`
552
+ - `LEECH_LIMIT`: To limit the Torrent/Direct/ytdlp leech size. the default unit is `GB`. `Int`
553
+ - `MEGA_LIMIT`: To limit the size of Mega download. the default unit is `GB`. `Int`
554
+ - `STORAGE_THRESHOLD`: To leave specific storage free and any download will lead to leave free storage less than this value will be cancelled the default unit is `GB`. `Int`
555
+ </details></li>
556
+ <li><details>
557
+ <summary><b>Templates</b></summary>
558
+
559
+ - `ANIME_TEMPLATE`: Set template for anime...
560
+ - `IMDB_TEMPLATE`: Set your imdb template...
561
+ </details></li>
562
+
563
+ <li><details>
564
+ <summary><b>Telegraph</b></summary>
565
+
566
+ - `TITLE_NAME`: Title `name` for Telegraph pages (while using /list command)
567
+ - `AUTHOR_NAME`: Author `name` for Telegraph pages
568
+ - `AUTHOR_URL`: Author `URL` for Telegraph page
569
+ </details></li>
570
+
571
+
572
+ <li><details>
573
+ <summary><b>Extra</b></summary>
574
+
575
+ - `SAFE_MODE`: Remove all file names. Not from BOT_PM & LINK_LOGS. Default is `False`. `Bool`
576
+ - `DELETE_LINKS`: Delete links after used. Default is `False`. `Bool`
577
+ - `CLEAN_LOG_MSG`: Clean log msg. Default is `False`. `Bool`
578
+ - `SHOW_EXTRA_CMDS`: Add old cmds like zipleech... Default is `False`. `Bool`
579
+ - `SOURCE_LINK`: Source button of files and links. Default is `False`. `Bool`
580
+ - `IMAGES`: Add multiple telgraph(graph.org) image links that are seperated by spaces.
581
+ - `IMG_SEARCH`: Put Keyword to Download Images. Sperarte each name by , like `anime`, `iron man`, `god of war`
582
+ - `IMG_PAGE`: Set the page value for downloading a image. Each page have approx 70 images. Deafult is `1`. `Int`
583
+ - `BOT_THEME`: Change the theme of bot. For now theme availabe is `minimal`.
584
+ - You can make your own theme checkout this link https://t.ly/9rVXq
585
+ </details></li>
586
+
587
+
588
+ <li><details>
589
+ <summary><b>Token system</b></summary>
590
+
591
+ - `TOKEN_TIMEOUT`: Token timeout for each group member in sec. Default is `21600`. `Int`
592
+ - `LOGIN_PASS`: Permanent pass for user to skip the token system
593
+ </details></li>
594
+
595
+ <li><details>
596
+ <summary><b>Torrent Search</b></summary>
597
+
598
+ - `SEARCH_API_LINK`: Search api app link. Get your api from deploying this [repository](https://github.com/Ryuk-me/Torrent-Api-py). `Str`
599
+ - Supported Sites:
600
+ >1337x, Piratebay, Nyaasi, Torlock, Torrent Galaxy, Zooqle, Kickass, Bitsearch, MagnetDL, Libgen, YTS, Limetorrent, TorrentFunk, Glodls, TorrentProject and YourBittorrent
601
+ - `SEARCH_LIMIT`: Search limit for search api, limit for each site and not overall result limit. Default is zero (Default api limit for each site). `Int`
602
+ - `SEARCH_PLUGINS`: List of qBittorrent search plugins (github raw links). I have added some plugins, you can remove/add plugins as you want. Main Source: [qBittorrent Search Plugins (Official/Unofficial)](https://github.com/qbittorrent/search-plugins/wiki/Unofficial-search-plugins). `List`
603
+
604
+ </details></li></ol>
605
+ </details>
606
+
607
+ ------
608
+
609
+ ### 🖨 ***Getting Google OAuth API credential file and `token.pickle`***
610
+
611
+ <details>
612
+ <summary><b>View All Steps<b><sup><kbd>Click to Expand</kbd></sup></summary>
613
+
614
+ **NOTES**
615
+
616
+ - Old authentication changed, now we can't use bot or replit to generate token.pickle. You need OS with a local browser. For example `Termux`.
617
+ - Windows users should install python3 and pip. You can find how to install and use them from google or from this [telegraph](https://telegra.ph/Create-Telegram-Mirror-Leech-Bot-by-Deploying-App-with-Heroku-Branch-using-Github-Workflow-12-06) from [Wiszky](https://github.com/vishnoe115) tutorial.
618
+ - You can ONLY open the generated link from `generate_drive_token.py` in local browser.
619
+
620
+ 1. Visit the [Google Cloud Console](https://console.developers.google.com/apis/credentials)
621
+ 2. Go to the OAuth Consent tab, fill it, and save.
622
+ 3. Go to the Credentials tab and click Create Credentials -> OAuth Client ID
623
+ 4. Choose Desktop and Create.
624
+ 5. Publish your OAuth consent screen App to prevent **token.pickle** from expire
625
+ 6. Use the download button to download your credentials.
626
+ 7. Move that file to the root of mirrorbot, and rename it to **credentials.json**
627
+ 8. Visit [Google API page](https://console.developers.google.com/apis/library)
628
+ 9. Search for Google Drive Api and enable it
629
+ 10. Finally, run the script to generate **token.pickle** file for Google Drive:
630
+
631
+ ```
632
+ pip3 install google-api-python-client google-auth-httplib2 google-auth-oauthlib
633
+ python3 generate_drive_token.py
634
+ ```
635
+
636
+ </details>
637
+
638
+ ------
639
+
640
+ ### 🧾 ***Generate `rclone.conf`***
641
+
642
+ <details>
643
+ <summary><b>View All Steps<b><sup><kbd>Click to Expand</kbd></sup></summary>
644
+
645
+ 1. Install rclone from [Official Site](https://rclone.org/install/)
646
+ 2. Create new remote(s) using `rclone config` command.
647
+ 3. Follow the Steps one by one to generate `rclone.conf`
648
+ 4. Copy rclone.conf from .config/rclone/rclone.conf to repo folder
649
+
650
+ - Sample `rclone.conf' :
651
+ ```
652
+ [Name]
653
+ - root_id :
654
+ ```
655
+
656
+ </details>
657
+
658
+ ------
659
+
660
+ ### 🔍 ***Multi Upload System***
661
+
662
+ <details>
663
+ <summary><b>View All Description<b><sup><kbd>Click to Expand</kbd></sup></summary>
664
+
665
+ - `RCLONE_PATH` is like `GDRIVE_ID` a default path for mirror. In additional to those variables `DEFAULT_UPLOAD` to choose the default tool whether it's rclone or google-api-python-client.
666
+ - If `DEFAULT_UPLOAD` = 'rc' then you must fill `RCLONE_PATH` with path as default one or with `rcl` to select destination path on each new task.
667
+ - If `DEFAULT_UPLOAD` = 'gd' then you must fill `GDRIVE_ID` with folder/TD id.
668
+ - If `DEFAULT_UPLOAD` = 'ddl' then it will upload to User Specific Enabled DDL Servers, Without further complicating, just enable in usetting
669
+ - `rclone.conf` can be added before deploy like `token.pickle` to repo folder root or use bsetting to upload it as private file.
670
+ - If rclone.conf uploaded from usetting or added in `rclone/{user_id}.conf` then `RCLONE_PATH` must start with `mrcc:`.
671
+ - Whenever you want to write path manually to use user rclone.conf that added from usetting then you must add the `mrcc:` at the beginning.
672
+ - So in short, -up has 5 possible values which are: gd(Upload to GDRIVE_ID), rc(Upload to RCLONE_PATH), ddl(Upload to User's Enabled DDL Servers), rcl(Select Rclone Path) and rclone_path(remote:path(owner rclone.conf) or mrcc:remote:path(user rclone.conf))
673
+
674
+ </details>
675
+
676
+ ------
677
+
678
+ ### 📃 ***UPSTREAM REPO (Recommended)***
679
+
680
+ <details>
681
+ <summary><b>View All Variables<b><sup><kbd>Click to Expand</kbd></sup></summary>
682
+
683
+ - `UPSTREAM_REPO` variable can be used for edit/add any file in repository.
684
+ - You can add private/public repository link to grab/overwrite all files from it.
685
+ - You can skip adding the privates files like token.pickle or accounts folder before deploying, simply fill `UPSTREAM_REPO` private one in case you want to grab all files including private files.
686
+ - If you added private files while deploying and you have added private `UPSTREAM_REPO` and your private files in this private repository, so your private files will be overwritten from this repository. Also if you are using database for private files, then all files from database will override the private files that added before deploying or from private `UPSTREAM_REPO`.
687
+ - If you filled `UPSTREAM_REPO` with the official repository link, then be carefull incase any change in requirements.txt your bot will not start after restart. In this case you need to deploy again with updated code to install the new requirements or simply by changing the `UPSTREAM_REPO` to you fork link with that old updates.
688
+ - In case you you filled `UPSTREAM_REPO` with your fork link be carefull also if you fetched the commits from the official repository.
689
+ - The changes in your `UPSTREAM_REPO` will take affect only after restart.
690
+
691
+ </details>
692
+
693
+ ------
694
+
695
+ ### 🌱 ***Bittorrent Seed***
696
+
697
+ <details>
698
+ <summary><b>View All Notes<b><sup><kbd>Click to Expand</kbd></sup></summary>
699
+
700
+ - Using `-d` argument alone will lead to use global options for aria2c or qbittorrent.
701
+
702
+ #### Qbittorrent
703
+
704
+ - Global options: `GlobalMaxRatio` and `GlobalMaxSeedingMinutes` in qbittorrent.conf, `-1` means no limit, but you can cancel manually.
705
+ - **NOTE**: Don't change `MaxRatioAction`.
706
+
707
+ #### Aria2c
708
+
709
+ - Global options: `--seed-ratio` (0 means no limit) and `--seed-time` (0 means no seed) in aria.sh.
710
+
711
+ </details>
712
+
713
+ ------
714
+
715
+ ### 📈 ***Using Service Accounts (User Rate Limit)***
716
+
717
+ <details>
718
+ <summary><b>View All Notes<b><sup><kbd>Click to Expand</kbd></sup></summary>
719
+
720
+ >For Service Account to work, you must set `USE_SERVICE_ACCOUNTS` = "True" in config file or environment variables.
721
+ >**NOTE**: Using Service Accounts is only recommended while uploading to a Team Drive.
722
+
723
+ ### 1. Generate Service Accounts. [What is Service Account?](https://cloud.google.com/iam/docs/service-accounts)
724
+
725
+ Let us create only the Service Accounts that we need.
726
+
727
+ **Warning**: Abuse of this feature is not the aim of this project and we do **NOT** recommend that you make a lot of projects, just one project and 100 SAs allow you plenty of use, its also possible that over abuse might get your projects banned by Google.
728
+
729
+ >**NOTE**: If you have created SAs in past from this script, you can also just re download the keys by running:
730
+
731
+ ```
732
+ python3 gen_sa_accounts.py --download-keys $PROJECTID
733
+ ```
734
+
735
+ >**NOTE:** 1 Service Account can upload/copy around 750 GB a day, 1 project can make 100 Service Accounts so you can upload 75 TB a day.
736
+
737
+ >**NOTE:** All people can copy `2TB/DAY` from each file creator (uploader account), so if you got error `userRateLimitExceeded` that doesn't mean your limit exceeded but file creator limit have been exceeded which is `2TB/DAY`.
738
+
739
+ #### Two methods to create service accounts
740
+
741
+ Choose one of these methods
742
+
743
+ ##### 1. Create Service Accounts in existed Project (Recommended Method)
744
+
745
+ - List your projects ids
746
+
747
+ ```
748
+ python3 gen_sa_accounts.py --list-projects
749
+ ```
750
+
751
+ - Enable services automatically by this command
752
+
753
+ ```
754
+ python3 gen_sa_accounts.py --enable-services $PROJECTID
755
+ ```
756
+
757
+ - Create Sevice Accounts to current project
758
+
759
+ ```
760
+ python3 gen_sa_accounts.py --create-sas $PROJECTID
761
+ ```
762
+
763
+ - Download Sevice Accounts as accounts folder
764
+
765
+ ```
766
+ python3 gen_sa_accounts.py --download-keys $PROJECTID
767
+ ```
768
+
769
+ ##### 2. Create Service Accounts in New Project
770
+
771
+ ```
772
+ python3 gen_sa_accounts.py --quick-setup 1 --new-only
773
+ ```
774
+
775
+ A folder named accounts will be created which will contain keys for the Service Accounts.
776
+
777
+ ### 2. Add Service Accounts
778
+
779
+ #### Two methods to add service accounts
780
+
781
+ Choose one of these methods
782
+
783
+ ##### 1. Add Them To Google Group then to Team Drive (Recommended)
784
+
785
+ - Mount accounts folder
786
+
787
+ ```
788
+ cd accounts
789
+ ```
790
+
791
+ - Grab emails form all accounts to emails.txt file that would be created in accounts folder
792
+ - `For Windows using PowerShell`
793
+
794
+ ```
795
+ $emails = Get-ChildItem .\**.json |Get-Content -Raw |ConvertFrom-Json |Select -ExpandProperty client_email >>emails.txt
796
+ ```
797
+
798
+ - `For Linux`
799
+
800
+ ```
801
+ grep -oPh '"client_email": "\K[^"]+' *.json > emails.txt
802
+ ```
803
+
804
+ - Unmount acounts folder
805
+
806
+ ```
807
+ cd ..
808
+ ```
809
+
810
+ Then add emails from emails.txt to Google Group, after that add this Google Group to your Shared Drive and promote it to manager and delete email.txt file from accounts folder
811
+
812
+ ##### 2. Add Them To Team Drive Directly
813
+
814
+ - Run:
815
+
816
+ ```
817
+ python3 add_to_team_drive.py -d SharedTeamDriveSrcID
818
+ ```
819
+
820
+ </details>
821
+
822
+ ------
823
+
824
+ ### 📡 ***Generate MongoDB Database***
825
+
826
+ <details>
827
+ <summary><b>View All Steps<b><sup><kbd>Click to Expand</kbd></sup></summary>
828
+
829
+ 1. Go to `https://mongodb.com/` and sign-up.
830
+ 2. Create Shared Cluster.
831
+ 3. Press on `Database` under `Deployment` Header, your created cluster will be there.
832
+ 5. Press on connect, choose `Allow Acces From Anywhere` and press on `Add IP Address` without editing the ip, then create user.
833
+ 6. After creating user press on `Choose a connection`, then press on `Connect your application`. Choose `Driver` **python** and `version` **3.6 or later**.
834
+ 7. Copy your `connection string` and replace `<password>` with the password of your user, then press close.
835
+
836
+ </details>
837
+
838
+ ------
839
+
840
+ ### 🗃 ***Multi- Google Drive List***
841
+
842
+ <details>
843
+ <summary><b>View All Steps<b><sup><kbd>Click to Expand</kbd></sup></summary>
844
+
845
+ To use list from multi TD/folder. Run driveid.py in your terminal and follow it. It will generate **list_drives.txt** file or u can simply create `list_drives.txt` file in working directory and fill it, check below format:
846
+
847
+ ```
848
+ DriveName folderID/tdID or `root` IndexLink(if available)
849
+ DriveName folderID/tdID or `root` IndexLink(if available)
850
+ ```
851
+
852
+ Example:
853
+
854
+ ```
855
+ TD1 root https://example.dev
856
+ TD2 0AO1JDB1t3i5jUk9PVA https://example.dev
857
+ ```
858
+
859
+ </details>
860
+
861
+ -----
862
+
863
+ ### 📢 ***Multi Shortener***
864
+
865
+ <details>
866
+ <summary><b>View All Notes<b><sup><kbd>Click to Expand</kbd></sup></summary>
867
+
868
+ To use multiple shorteners to maintain CPM! it will use random shorteners to generate short links.
869
+ you can simply create `shorteners.txt` file in working directory and fill it, check below format:
870
+ ```
871
+ shortener_domain shortener_api_key
872
+ ```
873
+ Example:
874
+ ```
875
+ urlshortx.com 91fc872f9882144c27eecdc22d16f7369766f297
876
+ ouo.io LYT0zBn1
877
+ ```
878
+ - Supported URL Shorteners:
879
+ >exe.io, gplinks.in, shrinkme.io, urlshortx.com, shortzon.com, bit.ly, shorte.st, linkvertise.com, ouo.io, cutt.ly
880
+
881
+ </details>
882
+
883
+ -----
884
+
885
+ ### 🎛 ***Extra Start Buttons***
886
+
887
+ <details>
888
+ <summary><b>View All Notes<b><sup><kbd>Click to Expand</kbd></sup></summary>
889
+
890
+ - Four buttons are already added, Drive Link, Index Link and View Link, You can add up to four extra buttons if you don't know what are the below entries.
891
+ You can simply create `buttons.txt` file in working directory and fill it, check below format:
892
+ ```
893
+ button_name button_url
894
+ ```
895
+ Example:
896
+ ```
897
+ Repo_❤️ https://github.com/WZML-X
898
+ Updates https://t.me/WZML_X
899
+ ```
900
+ - **Note**: If you want to add space in button name use `_` for add space
901
+
902
+ </details>
903
+
904
+ -----
905
+
906
+ ### 🔐 ***yt-dlp and Aria2c Authentication Using `.netrc` File***
907
+
908
+ <details>
909
+ <summary><b>View All Steps<b><sup><kbd>Click to Expand</kbd></sup></summary>
910
+
911
+ For using your premium accounts in yt-dlp or for protected Index Links, create .netrc file according to following format:
912
+
913
+ **Note**: Create .netrc and not netrc, this file will be hidden, so view hidden files to edit it after creation.
914
+
915
+ Format:
916
+
917
+ ```
918
+ machine host login username password my_password
919
+ ```
920
+
921
+ Example:
922
+
923
+ ```
924
+ machine instagram login doc.adhikari password mypassword
925
+ ```
926
+
927
+ **Instagram Note**: You must login even if you want to download public posts and after first try you must confirm that this was you logged in from different ip(you can confirm from phone app).
928
+
929
+ **Youtube Note**: For `youtube` authentication use [cookies.txt](https://github.com/ytdl-org/youtube-dl#how-do-i-pass-cookies-to-youtube-dl) file.
930
+
931
+ Using Aria2c you can also use built in feature from bot with or without username. Here example for index link without username.
932
+
933
+ ```
934
+ machine example.workers.dev password index_password
935
+ ```
936
+
937
+ Where host is the name of extractor (eg. instagram, Twitch). Multiple accounts of different hosts can be added each separated by a new line.
938
+
939
+ </details>
940
+
941
+ -----
942
+
943
+ ### 🏅 ***Bot Authors***
944
+ <details>
945
+ <summary><b>Click Here For Description</b></summary>
946
+
947
+ |![](https://avatars.githubusercontent.com/u/105407900)|![](https://avatars.githubusercontent.com/u/113664541)|![](https://avatars.githubusercontent.com/u/84721324)|![](https://avatars.githubusercontent.com/u/77075674)|
948
+ |:---:|:---:|:---:|:---:|
949
+ |[`SilentDemonSD`](https://github.com/SilentDemonSD)|[`CodeWithWeeb`](https://github.com/weebzone)|[`Maverick`](https://github.com/MajnuRangeela)|[`Anasty17`](https://github.com/anasty17)|
950
+ |Author and DDL, UI Design, More Customs..|Author and Wraps Up Features|Co-Author & Bug Tester|Base Repo: MLTB|
951
+
952
+ </details>
add_to_team_drive.py ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import print_function
2
+ from google.oauth2.service_account import Credentials
3
+ import googleapiclient.discovery
4
+ import json
5
+ import progress.bar
6
+ import glob
7
+ import sys
8
+ import argparse
9
+ import time
10
+ from google_auth_oauthlib.flow import InstalledAppFlow
11
+ from google.auth.transport.requests import Request
12
+ import os
13
+ import pickle
14
+
15
+ stt = time.time()
16
+
17
+ parse = argparse.ArgumentParser(
18
+ description='A tool to add service accounts to a shared drive from a folder containing credential files.')
19
+ parse.add_argument('--path', '-p', default='accounts',
20
+ help='Specify an alternative path to the service accounts folder.')
21
+ parse.add_argument('--credentials', '-c', default='./credentials.json',
22
+ help='Specify the relative path for the credentials file.')
23
+ parse.add_argument('--yes', '-y', default=False,
24
+ action='store_true', help='Skips the sanity prompt.')
25
+ parsereq = parse.add_argument_group('required arguments')
26
+ parsereq.add_argument('--drive-id', '-d',
27
+ help='The ID of the Shared Drive.', required=True)
28
+
29
+ args = parse.parse_args()
30
+ acc_dir = args.path
31
+ did = args.drive_id
32
+ credentials = glob.glob(args.credentials)
33
+
34
+ try:
35
+ open(credentials[0], 'r')
36
+ print('>> Found credentials.')
37
+ except IndexError:
38
+ print('>> No credentials found.')
39
+ sys.exit(0)
40
+
41
+ if not args.yes:
42
+ # input('Make sure the following client id is added to the shared drive as Manager:\n' + json.loads((open(
43
+ # credentials[0],'r').read()))['installed']['client_id'])
44
+ input('>> Make sure the **Google account** that has generated credentials.json\n is added into your Team Drive '
45
+ '(shared drive) as Manager\n>> (Press any key to continue)')
46
+
47
+ creds = None
48
+ if os.path.exists('token_sa.pickle'):
49
+ with open('token_sa.pickle', 'rb') as token:
50
+ creds = pickle.load(token)
51
+ # If there are no (valid) credentials available, let the user log in.
52
+ if not creds or not creds.valid:
53
+ if creds and creds.expired and creds.refresh_token:
54
+ creds.refresh(Request())
55
+ else:
56
+ flow = InstalledAppFlow.from_client_secrets_file(credentials[0], scopes=[
57
+ 'https://www.googleapis.com/auth/admin.directory.group',
58
+ 'https://www.googleapis.com/auth/admin.directory.group.member'
59
+ ])
60
+ # creds = flow.run_local_server(port=0)
61
+ creds = flow.run_console()
62
+ # Save the credentials for the next run
63
+ with open('token_sa.pickle', 'wb') as token:
64
+ pickle.dump(creds, token)
65
+
66
+ drive = googleapiclient.discovery.build("drive", "v3", credentials=creds)
67
+ batch = drive.new_batch_http_request()
68
+
69
+ aa = glob.glob('%s/*.json' % acc_dir)
70
+ pbar = progress.bar.Bar("Readying accounts", max=len(aa))
71
+ for i in aa:
72
+ ce = json.loads(open(i, 'r').read())['client_email']
73
+ batch.add(drive.permissions().create(fileId=did, supportsAllDrives=True, body={
74
+ "role": "organizer",
75
+ "type": "user",
76
+ "emailAddress": ce
77
+ }))
78
+ pbar.next()
79
+ pbar.finish()
80
+ print('Adding...')
81
+ batch.execute()
82
+
83
+ print('Complete.')
84
+ hours, rem = divmod((time.time() - stt), 3600)
85
+ minutes, sec = divmod(rem, 60)
86
+ print("Elapsed Time:\n{:0>2}:{:0>2}:{:05.2f}".format(
87
+ int(hours), int(minutes), sec))
aria.sh ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ tracker_list=$(curl -Ns https://ngosang.github.io/trackerslist/trackers_all_http.txt | awk '$0' | tr '\n\n' ',')
2
+ aria2c --allow-overwrite=true --auto-file-renaming=true --bt-enable-lpd=true --bt-detach-seed-only=true \
3
+ --bt-remove-unselected-file=true --bt-tracker="[$tracker_list]" --bt-max-peers=0 --enable-rpc=true \
4
+ --rpc-max-request-size=1024M --max-connection-per-server=10 --max-concurrent-downloads=10 --split=10 \
5
+ --seed-ratio=0 --check-integrity=true --continue=true --daemon=true --disk-cache=40M --force-save=true \
6
+ --min-split-size=10M --follow-torrent=mem --check-certificate=false --optimize-concurrent-downloads=true \
7
+ --http-accept-gzip=true --max-file-not-found=0 --max-tries=20 --peer-id-prefix=-qB4520- --reuse-uri=true \
8
+ --content-disposition-default-utf8=true --user-agent=Wget/1.12 --peer-agent=qBittorrent/4.5.2 --quiet=true \
9
+ --summary-interval=0 --max-upload-limit=1K
captain-definition ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "schemaVersion": 2,
3
+ "dockerfilePath": "./Dockerfile"
4
+ }
config_sample.env ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Remove this line before deploying
2
+ _____REMOVE_THIS_LINE_____=True
3
+ # REQUIRED CONFIG
4
+ BOT_TOKEN = "" # Require restart after changing it while bot running
5
+ OWNER_ID = "" # Require restart after changing it while bot running
6
+ TELEGRAM_API = "" # Require restart after changing it while bot running
7
+ TELEGRAM_HASH = "" # Require restart after changing it while bot running
8
+
9
+ # OPTIONAL CONFIG
10
+ USER_SESSION_STRING = "" # Require restart after changing it while bot running
11
+ DATABASE_URL = "" # Require restart after changing it while bot running
12
+ DOWNLOAD_DIR = "/usr/src/app/downloads/" # Require restart after changing it while bot running
13
+ CMD_SUFFIX = "" # Require restart after changing it while bot running
14
+ AUTHORIZED_CHATS = "" # Require restart after changing it while bot running
15
+ SUDO_USERS = "" # Require restart after changing it while bot running
16
+ STATUS_LIMIT = "6"
17
+ DEFAULT_UPLOAD = "gd"
18
+ STATUS_UPDATE_INTERVAL = "10"
19
+ AUTO_DELETE_MESSAGE_DURATION = "60"
20
+ UPTOBOX_TOKEN = ""
21
+ EXTENSION_FILTER = ""
22
+ INCOMPLETE_TASK_NOTIFIER = "False"
23
+ YT_DLP_OPTIONS = ""
24
+ USE_SERVICE_ACCOUNTS = "False"
25
+ SET_COMMANDS = "False"
26
+ FSUB_IDS = ""
27
+ BOT_PM = ""
28
+ BOT_MAX_TASKS = ""
29
+
30
+ # GDrive Tools
31
+ GDRIVE_ID = ""
32
+ IS_TEAM_DRIVE = "False"
33
+ STOP_DUPLICATE = "False"
34
+ DISABLE_DRIVE_LINK = "False"
35
+ INDEX_URL = ""
36
+ GD_INFO = "Uploaded by WZML-X"
37
+
38
+ # Rclone
39
+ RCLONE_PATH = ""
40
+ RCLONE_FLAGS = ""
41
+ RCLONE_SERVE_URL = ""
42
+ RCLONE_SERVE_PORT = ""
43
+ RCLONE_SERVE_USER = ""
44
+ RCLONE_SERVE_PASS = ""
45
+
46
+ # Update
47
+ UPSTREAM_REPO = ""
48
+ UPSTREAM_BRANCH = ""
49
+
50
+ # Leech & Mirror
51
+ LEECH_SPLIT_SIZE = ""
52
+ AS_DOCUMENT = "False"
53
+ EQUAL_SPLITS = "False"
54
+ MEDIA_GROUP = "False"
55
+ CAP_FONT = "code"
56
+ LEECH_FILENAME_PREFIX = ""
57
+ LEECH_FILENAME_SUFFIX = ""
58
+ LEECH_FILENAME_CAPTION = ""
59
+ LEECH_FILENAME_REMNAME = ""
60
+ MIRROR_FILENAME_PREFIX = ""
61
+ MIRROR_FILENAME_SUFFIX = ""
62
+ MIRROR_FILENAME_REMNAME = ""
63
+
64
+ # Log Channel (Single ID)
65
+ LEECH_LOG_ID = ""
66
+ MIRROR_LOG_ID = ""
67
+ LINKS_LOG_ID = ""
68
+
69
+ # qBittorrent/Aria2c
70
+ TORRENT_TIMEOUT = ""
71
+ BASE_URL = ""
72
+ BASE_URL_PORT = ""
73
+ WEB_PINCODE = "False"
74
+
75
+ #Queueing system
76
+ QUEUE_ALL = ""
77
+ QUEUE_DOWNLOAD = ""
78
+ QUEUE_UPLOAD = ""
79
+
80
+ # RSS
81
+ RSS_DELAY = "600"
82
+ RSS_CHAT_ID = ""
83
+
84
+ # Mega
85
+ MEGA_EMAIL = ""
86
+ MEGA_PASSWORD = ""
87
+
88
+ # Limits
89
+ DAILY_TASK_LIMIT = ""
90
+ DAILY_MIRROR_LIMIT = ""
91
+ DAILY_LEECH_LIMIT = ""
92
+ USER_MAX_TASKS = ""
93
+ TORRENT_LIMIT= ""
94
+ DIRECT_LIMIT = ""
95
+ GDRIVE_LIMIT = ""
96
+ CLONE_LIMIT = ""
97
+ YTDLP_LIMIT = ""
98
+ PLAYLIST_LIMIT = ""
99
+ LEECH_LIMIT = ""
100
+ MEGA_LIMIT = ""
101
+ STORAGE_THRESHOLD = ""
102
+
103
+ # Templates
104
+ ANIME_TEMPLATE = ""
105
+ IMDB_TEMPLATE = ""
106
+ MDL_TEMPLATE = ""
107
+
108
+ # Telegraph
109
+ TITLE_NAME = "WZ-M/L-X"
110
+ AUTHOR_NAME = "WZML-X"
111
+ AUTHOR_URL = "https://t.me/WZML_X"
112
+
113
+ # Extra
114
+ SAFE_MODE = ""
115
+ DELETE_LINKS = ""
116
+ CLEAN_LOG_MSG = ""
117
+ SHOW_EXTRA_CMDS = ""
118
+ SOURCE_LINK = ""
119
+ TIMEZONE = "Asia/Kolkata"
120
+ IMAGES = ""
121
+ IMG_SEARCH = ""
122
+ IMG_PAGE = ""
123
+ BOT_THEME = "minimal"
124
+ USER_TIME_INTERVAL = "0"
125
+
126
+ # M/L Buttons
127
+ SHOW_MEDIAINFO = "False"
128
+ SAVE_MSG = "False"
129
+
130
+ # Token system
131
+ TOKEN_TIMEOUT = ""
132
+ LOGIN_PASS = ""
133
+
134
+ # Torrent Search
135
+ SEARCH_API_LINK = ""
136
+ SEARCH_LIMIT = "0"
137
+ SEARCH_PLUGINS = '["https://raw.githubusercontent.com/qbittorrent/search-plugins/master/nova3/engines/piratebay.py",
138
+ "https://raw.githubusercontent.com/qbittorrent/search-plugins/master/nova3/engines/limetorrents.py",
139
+ "https://raw.githubusercontent.com/qbittorrent/search-plugins/master/nova3/engines/torrentscsv.py",
140
+ "https://raw.githubusercontent.com/qbittorrent/search-plugins/master/nova3/engines/torlock.py",
141
+ "https://raw.githubusercontent.com/qbittorrent/search-plugins/master/nova3/engines/eztv.py",
142
+ "https://raw.githubusercontent.com/qbittorrent/search-plugins/master/nova3/engines/torrentproject.py",
143
+ "https://raw.githubusercontent.com/v1k45/1337x-qBittorrent-search-plugin/master/leetx.py",
144
+ "https://raw.githubusercontent.com/MaurizioRicci/qBittorrent_search_engines/master/kickass_torrent.py",
145
+ "https://raw.githubusercontent.com/MaurizioRicci/qBittorrent_search_engines/master/yts_am.py",
146
+ "https://raw.githubusercontent.com/MadeOfMagicAndWires/qBit-plugins/master/engines/linuxtracker.py",
147
+ "https://raw.githubusercontent.com/MadeOfMagicAndWires/qBit-plugins/master/engines/nyaasi.py",
148
+ "https://raw.githubusercontent.com/LightDestory/qBittorrent-Search-Plugins/master/src/engines/ettv.py",
149
+ "https://raw.githubusercontent.com/LightDestory/qBittorrent-Search-Plugins/master/src/engines/glotorrents.py",
150
+ "https://raw.githubusercontent.com/LightDestory/qBittorrent-Search-Plugins/master/src/engines/thepiratebay.py",
151
+ "https://raw.githubusercontent.com/nindogo/qbtSearchScripts/master/magnetdl.py",
152
+ "https://raw.githubusercontent.com/msagca/qbittorrent_plugins/main/uniondht.py",
153
+ "https://raw.githubusercontent.com/khensolomon/leyts/master/yts.py"]'
docker-compose.yml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ version: "3.3"
2
+ services:
3
+ #gluetun:
4
+ #image: qmcgaw/gluetun:v3.34
5
+ #container_name: gluetun
6
+ # External Container --> https://github.com/qdm12/gluetun-wiki/blob/main/setup/connect-a-container-to-gluetun.md#external-container-to-gluetun
7
+ #cap_add:
8
+ # - NET_ADMIN
9
+ #devices:
10
+ # - /dev/net/tun:/dev/net/tun
11
+ #environment:
12
+ # # SetUp --> https://github.com/qdm12/gluetun-wiki/tree/main/setup#setup
13
+ # - VPN_SERVICE_PROVIDER=
14
+ # - VPN_TYPE=
15
+ # # OpenVPN --> https://github.com/qdm12/gluetun-wiki/blob/main/setup/options/openvpn.md
16
+ # - OPENVPN_USER=
17
+ # - OPENVPN_PASSWORD=
18
+ # # Wireguard --> https://github.com/qdm12/gluetun-wiki/blob/main/setup/options/wireguard.md
19
+ # - WIREGUARD_PRIVATE_KEY=
20
+ # - WIREGUARD_ADDRESS=
21
+ # - WIREGUARD_PUBLIC_KEY=
22
+ # # TimeZone Logs --> https://github.com/qdm12/gluetun-wiki/blob/main/setup/options/others.md
23
+ # - TZ=Asia/Kolkata
24
+ # # Server List Updater --> https://github.com/qdm12/gluetun-wiki/blob/main/setup/servers.md#update-the-vpn-servers-list
25
+ # - UPDATER_PERIOD=24h
26
+ #ports:
27
+ # - "80:80"
28
+ # - "8080:8080"
29
+ #restart: on-failure
30
+ app:
31
+ build: .
32
+ #network_mode: "service:gluetun" #If using VPN, Remove the Hash from first and fill up Above Details.
33
+ command: bash start.sh
34
+ restart: on-failure
35
+ ports:
36
+ - "80:80"
37
+ - "8080:8080"
driveid.py ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import re
3
+ print("\n\n"
4
+ " Bot can search files recursively, but you have to add the list of drives you want to search.\n"
5
+ " Use the following format: (You can use 'root' in the ID in case you wan to use main drive.)\n"
6
+ " teamdrive NAME --> anything that you likes\n"
7
+ " teamdrive ID --> id of teamdrives in which you likes to search ('root' for main drive)\n"
8
+ " teamdrive INDEX URL --> enter index url for this drive.\n"
9
+ " go to the respective drive and copy the url from address bar\n")
10
+ msg = ''
11
+ if os.path.exists('list_drives.txt'):
12
+ with open('list_drives.txt', 'r+') as f:
13
+ lines = f.read()
14
+ if not re.match(r'^\s*$', lines):
15
+ print(lines)
16
+ print("\n\n"
17
+ " DO YOU WISH TO KEEP THE ABOVE DETAILS THAT YOU PREVIOUSLY ADDED???? ENTER (y/n)\n"
18
+ " IF NOTHING SHOWS ENTER n")
19
+ while 1:
20
+ choice = input()
21
+ if choice in ['y', 'Y']:
22
+ msg = f'{lines}'
23
+ break
24
+ elif choice in ['n', 'N']:
25
+ break
26
+ else:
27
+ print(
28
+ "\n\n DO YOU WISH TO KEEP THE ABOVE DETAILS ???? y/n <=== this is option ..... OPEN YOUR EYES & READ...")
29
+ num = int(input(" How Many Drive/Folder You Likes To Add : "))
30
+ for count in range(1, num + 1):
31
+ print(f"\n > DRIVE - {count}\n")
32
+ name = input(" Enter Drive NAME (anything) : ")
33
+ id = input(" Enter Drive ID : ")
34
+ index = input(" Enter Drive INDEX URL (optional) : ")
35
+ if not name or not id:
36
+ print("\n\n ERROR : Dont leave the name/id without filling.")
37
+ exit(1)
38
+ name = name.replace(" ", "_")
39
+ if index:
40
+ if index[-1] == "/":
41
+ index = index[:-1]
42
+ else:
43
+ index = ''
44
+ msg += f"{name} {id} {index}\n"
45
+ with open('list_drives.txt', 'w') as file:
46
+ file.truncate(0)
47
+ file.write(msg)
48
+ print("\n\n Done!")
gen_sa_accounts.py ADDED
@@ -0,0 +1,366 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import errno
2
+ import os
3
+ import pickle
4
+ import sys
5
+ from argparse import ArgumentParser
6
+ from base64 import b64decode
7
+ from glob import glob
8
+ from json import loads
9
+ from random import choice
10
+ from time import sleep
11
+
12
+ from google.auth.transport.requests import Request
13
+ from google_auth_oauthlib.flow import InstalledAppFlow
14
+ from googleapiclient.discovery import build
15
+ from googleapiclient.errors import HttpError
16
+
17
+ SCOPES = ['https://www.googleapis.com/auth/drive', 'https://www.googleapis.com/auth/cloud-platform',
18
+ 'https://www.googleapis.com/auth/iam']
19
+ project_create_ops = []
20
+ current_key_dump = []
21
+ sleep_time = 30
22
+
23
+
24
+ # Create count SAs in project
25
+ def _create_accounts(service, project, count):
26
+ batch = service.new_batch_http_request(callback=_def_batch_resp)
27
+ for _ in range(count):
28
+ aid = _generate_id('mfc-')
29
+ batch.add(service.projects().serviceAccounts().create(name='projects/' + project, body={'accountId': aid,
30
+ 'serviceAccount': {
31
+ 'displayName': aid}}))
32
+ batch.execute()
33
+
34
+
35
+ # Create accounts needed to fill project
36
+ def _create_remaining_accounts(iam, project):
37
+ print('Creating accounts in %s' % project)
38
+ sa_count = len(_list_sas(iam, project))
39
+ while sa_count != 100:
40
+ _create_accounts(iam, project, 100 - sa_count)
41
+ sa_count = len(_list_sas(iam, project))
42
+
43
+
44
+ # Generate a random id
45
+ def _generate_id(prefix='saf-'):
46
+ chars = '-abcdefghijklmnopqrstuvwxyz1234567890'
47
+ return prefix + ''.join(choice(chars) for _ in range(25)) + choice(chars[1:])
48
+
49
+
50
+ # List projects using service
51
+ def _get_projects(service):
52
+ return [i['projectId'] for i in service.projects().list().execute()['projects']]
53
+
54
+
55
+ # Default batch callback handler
56
+ def _def_batch_resp(id, resp, exception):
57
+ if exception is not None:
58
+ if str(exception).startswith('<HttpError 429'):
59
+ sleep(sleep_time / 100)
60
+ else:
61
+ print(str(exception))
62
+
63
+
64
+ # Project Creation Batch Handler
65
+ def _pc_resp(id, resp, exception):
66
+ global project_create_ops
67
+ if exception is not None:
68
+ print(str(exception))
69
+ else:
70
+ for i in resp.values():
71
+ project_create_ops.append(i)
72
+
73
+
74
+ # Project Creation
75
+ def _create_projects(cloud, count):
76
+ global project_create_ops
77
+ batch = cloud.new_batch_http_request(callback=_pc_resp)
78
+ new_projs = []
79
+ for _ in range(count):
80
+ new_proj = _generate_id()
81
+ new_projs.append(new_proj)
82
+ batch.add(cloud.projects().create(body={'project_id': new_proj}))
83
+ batch.execute()
84
+
85
+ for i in project_create_ops:
86
+ while True:
87
+ resp = cloud.operations().get(name=i).execute()
88
+ if 'done' in resp and resp['done']:
89
+ break
90
+ sleep(3)
91
+ return new_projs
92
+
93
+
94
+ # Enable services ste for projects in projects
95
+ def _enable_services(service, projects, ste):
96
+ batch = service.new_batch_http_request(callback=_def_batch_resp)
97
+ for i in projects:
98
+ for j in ste:
99
+ batch.add(service.services().enable(
100
+ name='projects/%s/services/%s' % (i, j)))
101
+ batch.execute()
102
+
103
+
104
+ # List SAs in project
105
+ def _list_sas(iam, project):
106
+ resp = iam.projects().serviceAccounts().list(
107
+ name='projects/' + project, pageSize=100).execute()
108
+ if 'accounts' in resp:
109
+ return resp['accounts']
110
+ return []
111
+
112
+
113
+ # Create Keys Batch Handler
114
+ def _batch_keys_resp(id, resp, exception):
115
+ global current_key_dump
116
+ if exception is not None:
117
+ current_key_dump = None
118
+ sleep(sleep_time / 100)
119
+ elif current_key_dump is None:
120
+ sleep(sleep_time / 100)
121
+ else:
122
+ current_key_dump.append((
123
+ resp['name'][resp['name'].rfind('/'):],
124
+ b64decode(resp['privateKeyData']).decode('utf-8')
125
+ ))
126
+
127
+
128
+ # Create Keys
129
+ def _create_sa_keys(iam, projects, path):
130
+ global current_key_dump
131
+ for i in projects:
132
+ current_key_dump = []
133
+ print('Downloading keys from %s' % i)
134
+ while current_key_dump is None or len(current_key_dump) != 100:
135
+ batch = iam.new_batch_http_request(callback=_batch_keys_resp)
136
+ total_sas = _list_sas(iam, i)
137
+ for j in total_sas:
138
+ batch.add(iam.projects().serviceAccounts().keys().create(
139
+ name='projects/%s/serviceAccounts/%s' % (i, j['uniqueId']),
140
+ body={
141
+ 'privateKeyType': 'TYPE_GOOGLE_CREDENTIALS_FILE',
142
+ 'keyAlgorithm': 'KEY_ALG_RSA_2048'
143
+ }
144
+ ))
145
+ batch.execute()
146
+ if current_key_dump is None:
147
+ print('Redownloading keys from %s' % i)
148
+ current_key_dump = []
149
+ else:
150
+ for index, j in enumerate(current_key_dump):
151
+ with open(f'{path}/{index}.json', 'w+') as f:
152
+ f.write(j[1])
153
+
154
+
155
+ # Delete Service Accounts
156
+ def _delete_sas(iam, project):
157
+ sas = _list_sas(iam, project)
158
+ batch = iam.new_batch_http_request(callback=_def_batch_resp)
159
+ for i in sas:
160
+ batch.add(iam.projects().serviceAccounts().delete(name=i['name']))
161
+ batch.execute()
162
+
163
+
164
+ def serviceaccountfactory(
165
+ credentials='credentials.json',
166
+ token='token_sa.pickle',
167
+ path=None,
168
+ list_projects=False,
169
+ list_sas=None,
170
+ create_projects=None,
171
+ max_projects=12,
172
+ enable_services=None,
173
+ services=['iam', 'drive'],
174
+ create_sas=None,
175
+ delete_sas=None,
176
+ download_keys=None
177
+ ):
178
+ selected_projects = []
179
+ proj_id = loads(open(credentials, 'r').read())['installed']['project_id']
180
+ creds = None
181
+ if os.path.exists(token):
182
+ with open(token, 'rb') as t:
183
+ creds = pickle.load(t)
184
+ if not creds or not creds.valid:
185
+ if creds and creds.expired and creds.refresh_token:
186
+ creds.refresh(Request())
187
+ else:
188
+ flow = InstalledAppFlow.from_client_secrets_file(
189
+ credentials, SCOPES)
190
+
191
+ creds = flow.run_local_server(port=0, open_browser=False)
192
+
193
+ with open(token, 'wb') as t:
194
+ pickle.dump(creds, t)
195
+
196
+ cloud = build('cloudresourcemanager', 'v1', credentials=creds)
197
+ iam = build('iam', 'v1', credentials=creds)
198
+ serviceusage = build('serviceusage', 'v1', credentials=creds)
199
+
200
+ projs = None
201
+ while projs is None:
202
+ try:
203
+ projs = _get_projects(cloud)
204
+ except HttpError as e:
205
+ if loads(e.content.decode('utf-8'))['error']['status'] == 'PERMISSION_DENIED':
206
+ try:
207
+ serviceusage.services().enable(
208
+ name='projects/%s/services/cloudresourcemanager.googleapis.com' % proj_id).execute()
209
+ except HttpError as e:
210
+ print(e._get_reason())
211
+ input('Press Enter to retry.')
212
+ if list_projects:
213
+ return _get_projects(cloud)
214
+ if list_sas:
215
+ return _list_sas(iam, list_sas)
216
+ if create_projects:
217
+ print("creat projects: {}".format(create_projects))
218
+ if create_projects > 0:
219
+ current_count = len(_get_projects(cloud))
220
+ if current_count + create_projects <= max_projects:
221
+ print('Creating %d projects' % (create_projects))
222
+ nprjs = _create_projects(cloud, create_projects)
223
+ selected_projects = nprjs
224
+ else:
225
+ sys.exit('No, you cannot create %d new project (s).\n'
226
+ 'Please reduce value of --quick-setup.\n'
227
+ 'Remember that you can totally create %d projects (%d already).\n'
228
+ 'Please do not delete existing projects unless you know what you are doing' % (
229
+ create_projects, max_projects, current_count))
230
+ else:
231
+ print('Will overwrite all service accounts in existing projects.\n'
232
+ 'So make sure you have some projects already.')
233
+ input("Press Enter to continue...")
234
+
235
+ if enable_services:
236
+ ste = [enable_services]
237
+ if enable_services == '~':
238
+ ste = selected_projects
239
+ elif enable_services == '*':
240
+ ste = _get_projects(cloud)
241
+ services = [i + '.googleapis.com' for i in services]
242
+ print('Enabling services')
243
+ _enable_services(serviceusage, ste, services)
244
+ if create_sas:
245
+ stc = [create_sas]
246
+ if create_sas == '~':
247
+ stc = selected_projects
248
+ elif create_sas == '*':
249
+ stc = _get_projects(cloud)
250
+ for i in stc:
251
+ _create_remaining_accounts(iam, i)
252
+ if download_keys:
253
+ try:
254
+ os.mkdir(path)
255
+ except OSError as e:
256
+ if e.errno != errno.EEXIST:
257
+ raise
258
+ std = [download_keys]
259
+ if download_keys == '~':
260
+ std = selected_projects
261
+ elif download_keys == '*':
262
+ std = _get_projects(cloud)
263
+ _create_sa_keys(iam, std, path)
264
+ if delete_sas:
265
+ std = []
266
+ std.append(delete_sas)
267
+ if delete_sas == '~':
268
+ std = selected_projects
269
+ elif delete_sas == '*':
270
+ std = _get_projects(cloud)
271
+ for i in std:
272
+ print('Deleting service accounts in %s' % i)
273
+ _delete_sas(iam, i)
274
+
275
+
276
+ if __name__ == '__main__':
277
+ parse = ArgumentParser(
278
+ description='A tool to create Google service accounts.')
279
+ parse.add_argument('--path', '-p', default='accounts',
280
+ help='Specify an alternate directory to output the credential files.')
281
+ parse.add_argument('--token', default='token_sa.pickle',
282
+ help='Specify the pickle token file path.')
283
+ parse.add_argument('--credentials', default='credentials.json',
284
+ help='Specify the credentials file path.')
285
+ parse.add_argument('--list-projects', default=False, action='store_true',
286
+ help='List projects viewable by the user.')
287
+ parse.add_argument('--list-sas', default=False,
288
+ help='List service accounts in a project.')
289
+ parse.add_argument('--create-projects', type=int,
290
+ default=None, help='Creates up to N projects.')
291
+ parse.add_argument('--max-projects', type=int, default=12,
292
+ help='Max amount of project allowed. Default: 12')
293
+ parse.add_argument('--enable-services', default=None,
294
+ help='Enables services on the project. Default: IAM and Drive')
295
+ parse.add_argument('--services', nargs='+', default=['iam', 'drive'],
296
+ help='Specify a different set of services to enable. Overrides the default.')
297
+ parse.add_argument('--create-sas', default=None,
298
+ help='Create service accounts in a project.')
299
+ parse.add_argument('--delete-sas', default=None,
300
+ help='Delete service accounts in a project.')
301
+ parse.add_argument('--download-keys', default=None,
302
+ help='Download keys for all the service accounts in a project.')
303
+ parse.add_argument('--quick-setup', default=None, type=int,
304
+ help='Create projects, enable services, create service accounts and download keys. ')
305
+ parse.add_argument('--new-only', default=False,
306
+ action='store_true', help='Do not use exisiting projects.')
307
+ args = parse.parse_args()
308
+ # If credentials file is invalid, search for one.
309
+ if not os.path.exists(args.credentials):
310
+ options = glob('*.json')
311
+ print('No credentials found at %s. Please enable the Drive API in:\n'
312
+ 'https://developers.google.com/drive/api/v3/quickstart/python\n'
313
+ 'and save the json file as credentials.json' % args.credentials)
314
+ if len(options) < 1:
315
+ exit(-1)
316
+ else:
317
+ print('Select a credentials file below.')
318
+ inp_options = [str(i) for i in list(
319
+ range(1, len(options) + 1))] + options
320
+ for i in range(len(options)):
321
+ print(' %d) %s' % (i + 1, options[i]))
322
+ inp = None
323
+ while True:
324
+ inp = input('> ')
325
+ if inp in inp_options:
326
+ break
327
+ args.credentials = inp if inp in options else options[int(inp) - 1]
328
+ print('Use --credentials %s next time to use this credentials file.' %
329
+ args.credentials)
330
+ if args.quick_setup:
331
+ opt = '~' if args.new_only else '*'
332
+ args.services = ['iam', 'drive']
333
+ args.create_projects = args.quick_setup
334
+ args.enable_services = opt
335
+ args.create_sas = opt
336
+ args.download_keys = opt
337
+ resp = serviceaccountfactory(
338
+ path=args.path,
339
+ token=args.token,
340
+ credentials=args.credentials,
341
+ list_projects=args.list_projects,
342
+ list_sas=args.list_sas,
343
+ create_projects=args.create_projects,
344
+ max_projects=args.max_projects,
345
+ create_sas=args.create_sas,
346
+ delete_sas=args.delete_sas,
347
+ enable_services=args.enable_services,
348
+ services=args.services,
349
+ download_keys=args.download_keys
350
+ )
351
+ if resp is not None:
352
+ if args.list_projects:
353
+ if resp:
354
+ print('Projects (%d):' % len(resp))
355
+ for i in resp:
356
+ print(' ' + i)
357
+ else:
358
+ print('No projects.')
359
+ elif args.list_sas:
360
+ if resp:
361
+ print('Service accounts in %s (%d):' %
362
+ (args.list_sas, len(resp)))
363
+ for i in resp:
364
+ print(' %s (%s)' % (i['email'], i['uniqueId']))
365
+ else:
366
+ print('No service accounts.')
generate_drive_token.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pickle
2
+ import os
3
+ from google_auth_oauthlib.flow import InstalledAppFlow
4
+ from google.auth.transport.requests import Request
5
+
6
+ credentials = None
7
+ __G_DRIVE_TOKEN_FILE = "token.pickle"
8
+ __OAUTH_SCOPE = ["https://www.googleapis.com/auth/drive"]
9
+ if os.path.exists(__G_DRIVE_TOKEN_FILE):
10
+ with open(__G_DRIVE_TOKEN_FILE, 'rb') as f:
11
+ credentials = pickle.load(f)
12
+ if (
13
+ (credentials is None or not credentials.valid)
14
+ and credentials
15
+ and credentials.expired
16
+ and credentials.refresh_token
17
+ ):
18
+ credentials.refresh(Request())
19
+ else:
20
+ flow = InstalledAppFlow.from_client_secrets_file(
21
+ 'credentials.json', __OAUTH_SCOPE)
22
+ credentials = flow.run_local_server(port=0, open_browser=False)
23
+
24
+ # Save the credentials for the next run
25
+ with open(__G_DRIVE_TOKEN_FILE, 'wb') as token:
26
+ pickle.dump(credentials, token)
requirements-cli.txt ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ oauth2client
2
+ google-api-python-client
3
+ progress
4
+ progressbar2
5
+ httplib2shim
6
+ google_auth_oauthlib
7
+ pyrogram==2.0.77
8
+ tgcrypto
requirements.txt ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ aiohttp
2
+ aiofiles
3
+ aioshutil
4
+ anytree==2.8.0
5
+ apscheduler
6
+ aria2p
7
+ asyncio
8
+ beautifulsoup4
9
+ cinemagoer
10
+ cloudscraper
11
+ dnspython
12
+ feedparser
13
+ flask
14
+ gevent
15
+ google-api-python-client
16
+ google-auth-httplib2
17
+ google-auth-oauthlib
18
+ gunicorn
19
+ git+https://github.com/zevtyardt/lk21.git
20
+ httpx
21
+ lxml
22
+ motor
23
+ mutagen
24
+ markdown
25
+ natsort
26
+ pillow
27
+ psutil
28
+ pybase64
29
+ pycountry
30
+ pymongo
31
+ pyrogram==2.0.77
32
+ python-dotenv
33
+ python-magic
34
+ qbittorrent-api
35
+ requests
36
+ speedtest-cli
37
+ telegraph
38
+ tenacity
39
+ tgcrypto
40
+ uvloop
41
+ xattr
42
+ yt-dlp==2023.3.4
start.sh ADDED
@@ -0,0 +1 @@
 
 
1
+ python3 update.py && python3 -m bot
update.py ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from logging import FileHandler, StreamHandler, INFO, basicConfig, error as log_error, info as log_info
2
+ from os import path as ospath, environ, remove
3
+ from subprocess import run as srun
4
+ from requests import get as rget
5
+ from dotenv import load_dotenv, dotenv_values
6
+ from pymongo import MongoClient
7
+
8
+ if ospath.exists('log.txt'):
9
+ with open('log.txt', 'r+') as f:
10
+ f.truncate(0)
11
+
12
+ if ospath.exists('rlog.txt'): #RClone Logs
13
+ remove('rlog.txt')
14
+
15
+ basicConfig(format="[%(asctime)s] [%(levelname)s] - %(message)s",
16
+ datefmt="%d-%b-%y %I:%M:%S %p",
17
+ handlers=[FileHandler('log.txt'), StreamHandler()],
18
+ level=INFO)
19
+
20
+ load_dotenv('config.env', override=True)
21
+
22
+ try:
23
+ if bool(environ.get('_____REMOVE_THIS_LINE_____')):
24
+ log_error('The README.md file there to be read! Exiting now!')
25
+ exit()
26
+ except:
27
+ pass
28
+
29
+ BOT_TOKEN = environ.get('BOT_TOKEN', '')
30
+ if len(BOT_TOKEN) == 0:
31
+ log_error("BOT_TOKEN variable is missing! Exiting now")
32
+ exit(1)
33
+
34
+ bot_id = BOT_TOKEN.split(':', 1)[0]
35
+
36
+ DATABASE_URL = environ.get('DATABASE_URL', '')
37
+ if len(DATABASE_URL) == 0:
38
+ DATABASE_URL = None
39
+
40
+ if DATABASE_URL is not None:
41
+ conn = MongoClient(DATABASE_URL)
42
+ db = conn.wzmlx
43
+ old_config = db.settings.deployConfig.find_one({'_id': bot_id})
44
+ config_dict = db.settings.config.find_one({'_id': bot_id})
45
+ if old_config is not None:
46
+ del old_config['_id']
47
+ if (old_config is not None and old_config == dict(dotenv_values('config.env')) or old_config is None) \
48
+ and config_dict is not None:
49
+ environ['UPSTREAM_REPO'] = config_dict['UPSTREAM_REPO']
50
+ environ['UPSTREAM_BRANCH'] = config_dict['UPSTREAM_BRANCH']
51
+ conn.close()
52
+
53
+ UPSTREAM_REPO = environ.get('UPSTREAM_REPO', '')
54
+ if len(UPSTREAM_REPO) == 0:
55
+ UPSTREAM_REPO = None
56
+
57
+ UPSTREAM_BRANCH = environ.get('UPSTREAM_BRANCH', '')
58
+ if len(UPSTREAM_BRANCH) == 0:
59
+ UPSTREAM_BRANCH = 'master'
60
+
61
+ if UPSTREAM_REPO is not None:
62
+ if ospath.exists('.git'):
63
+ srun(["rm", "-rf", ".git"])
64
+
65
+ update = srun([f"git init -q \
66
+ && git config --global user.email [email protected] \
67
+ && git config --global user.name weebzone \
68
+ && git add . \
69
+ && git commit -sm update -q \
70
+ && git remote add origin {UPSTREAM_REPO} \
71
+ && git fetch origin -q \
72
+ && git reset --hard origin/{UPSTREAM_BRANCH} -q"], shell=True)
73
+
74
+ repo = UPSTREAM_REPO.split('/')
75
+ UPSTREAM_REPO = f"https://github.com/{repo[-2]}/{repo[-1]}"
76
+ if update.returncode == 0:
77
+ log_info('Successfully updated with latest commits !!')
78
+ else:
79
+ log_error('Something went Wrong !!')
80
+ log_error(f'UPSTREAM_REPO: {UPSTREAM_REPO} | UPSTREAM_BRANCH: {UPSTREAM_BRANCH}')