Compare commits

..

7 Commits

Author SHA1 Message Date
Andy
5f2c4476ad 1.0.1.0
Extend settings, fix minor bugs, add some functions
2021-12-20 14:16:29 +03:00
Andy
adc563eb6b Create LICENSE 2021-12-13 17:58:28 +03:00
Andy
1c67d18cd2 Create LICENSE 2021-12-13 11:04:34 +03:00
Andy
67c4b25d22 1.0.0.4
Add full channel support, make ready for download prop available for collections and multiusers
Fixed imgur pics compatibility
Updated abstract classes and functions for channels compatibility
2021-12-12 14:47:34 +03:00
Andy
70e73c7d97 1.0.0.3
Fix typo in properties, re-enabling the "Download all" button after changing the mode, removed unused elements
2021-12-11 07:44:43 +03:00
Andy
4acef31c99 Update README.md 2021-12-10 14:33:38 +03:00
Andy
55a28a7d89 1.0.0.2
Add: downloading certain types of media, name files by date
Fix: Stop button is not activated after download start
2021-12-10 13:59:23 +03:00
37 changed files with 3057 additions and 582 deletions

View File

@@ -1,3 +1,46 @@
# 1.0.1.0
- Added
- Extended site settings
- Non-existend users will be marked in red
- Suspended users' profiles will be marked in yellow
- Automatically disable 'Ready for download' if user does not exist.
- Ability to disable MD5 check when downloading regular (added to the main window) channels
- Ability to create a user from a channel with the default option 'Ready to download' (setting in the 'Settings')
- Ability to change default 'Temporary' parameter on create a user from a channel (setting in the 'Settings')
- Advanced defaults for each site (download images, download videos and temporary)
- By checking the 'Temporary' checkbox in the user creation form, the 'Ready for download' checkbox became unchecked
- Automatically disable 'Ready for download' if profile does not exists or has been deleted
- Change
- Removed extended twitter invalid credentials error and replaced with a simple line in the log
- Redesigned settings form
- Fixed
- In some cases, the image of the channel post is not copied to the user's folder
- Users in the main window are not refreshed if new users are added by a list that includes banned and/or unrecognized users.
- Minor bugs
# 1.0.0.4
- Added
- Full channels support (you can now add channel (subreddit) for standard download)
- ```Ready for download``` now available for collections and can be changed for multiple user
- Fixed
- Images hosted on Imgur won't download
# 1.0.0.3
- Fixed
- Custom "Download videos" option is not saved
- The "Download all" button is not activated after changing modes
# 1.0.0.2
- Added
- Ability to choose what types of media you want to download (images only, videos only, both)
- Ability to name files by date
- Fixed
- In some cases, the "Stop" button is not activated after download start
# 1.0.0.1 # 1.0.0.1
- Added - Added

674
LICENSE Normal file
View File

@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@@ -7,7 +7,7 @@ Enjoying the tool? Considering adding to my coffee fund :)
[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/andyprogram) [![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/andyprogram)
# What can program do: # What can program do:
- Download pictures and videos from users' profiles: - Download pictures and videos from users' profiles and subreddits:
- Reddit images; - Reddit images;
- Reddit galleries of images; - Reddit galleries of images;
- Redgifs hosted videos (https://www.redgifs.com/); - Redgifs hosted videos (https://www.redgifs.com/);
@@ -18,6 +18,7 @@ Enjoying the tool? Considering adding to my coffee fund :)
- Add users from parsed channel. - Add users from parsed channel.
- Labeling users. - Labeling users.
- Filter exists users by label or group. - Filter exists users by label or group.
- Selection of media types you want to download (images only, videos only, both)
# How does it works: # How does it works:
@@ -46,10 +47,13 @@ Just add user profile and press ```Start downloading``` button.
Users can be added by patterns: Users can be added by patterns:
- https://twitter.com/SomeUserName - https://twitter.com/SomeUserName
- https://reddit.com/user/SomeUserName - https://reddit.com/user/SomeUserName
- https://reddit.com/r/SomeSubredditName
- u/SomeUserName - u/SomeUserName
- r/SomeSubredditName
- SomeUserName (in this case you must to choose user site) - SomeUserName (in this case you must to choose user site)
- SomeSubredditName
More about users adding [here](https://github.com/AAndyProgram/SCrawler/wiki/Users) More about users and subreddits adding [here](https://github.com/AAndyProgram/SCrawler/wiki/Users)
**Full guide you can find [here](https://github.com/AAndyProgram/SCrawler/wiki)** **Full guide you can find [here](https://github.com/AAndyProgram/SCrawler/wiki)**

126
SCrawler/.editorconfig Normal file
View File

@@ -0,0 +1,126 @@
# To learn more about .editorconfig see https://aka.ms/editorconfigdocs
###############################
# Core EditorConfig Options #
###############################
root = true
# All files
[*]
indent_style = space
# Code files
[*.{cs,csx,vb,vbx}]
indent_size = 4
insert_final_newline = false
charset = utf-8-bom
###############################
# .NET Coding Conventions #
###############################
[*.{cs,vb}]
# Organize usings
dotnet_sort_system_directives_first = true
# this. preferences
dotnet_style_qualification_for_field = false:silent
dotnet_style_qualification_for_property = false:silent
dotnet_style_qualification_for_method = false:silent
dotnet_style_qualification_for_event = false:silent
# Language keywords vs BCL types preferences
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
dotnet_style_predefined_type_for_member_access = true:silent
# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
# Modifier preferences
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
dotnet_style_readonly_field = true:suggestion
# Expression-level preferences
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
###############################
# Naming Conventions #
###############################
# Style Definitions
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
# Use PascalCase for constant fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
dotnet_naming_symbols.constant_fields.required_modifiers = const
###############################
# C# Coding Conventions #
###############################
[*.cs]
# var preferences
csharp_style_var_for_built_in_types = true:silent
csharp_style_var_when_type_is_apparent = true:silent
csharp_style_var_elsewhere = true:silent
# Expression-bodied members
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
# Pattern matching preferences
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
# Null-checking preferences
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
# Modifier preferences
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
# Expression-level preferences
csharp_prefer_braces = true:silent
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_pattern_local_over_anonymous_function = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
###############################
# C# Formatting Rules #
###############################
# New line preferences
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = false
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true
# Indentation preferences
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_labels = flush_left
# Space preferences
csharp_space_after_cast = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_around_binary_operators = before_and_after
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
# Wrapping preferences
csharp_preserve_single_line_statements = true
csharp_preserve_single_line_blocks = true
insert_final_newline=false
###############################
# VB Coding Conventions #
###############################
[*.vb]
# Modifier preferences
visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion
file_header_template = Copyright (C) 2022 Andy\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see <https://www.gnu.org/licenses/>

View File

@@ -1,4 +1,12 @@
Imports PersonalUtilities.Tools ' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports PersonalUtilities.Tools
Imports PersonalUtilities.Functions.XML Imports PersonalUtilities.Functions.XML
Imports PersonalUtilities.Functions.XML.Base Imports PersonalUtilities.Functions.XML.Base
Namespace API.Base Namespace API.Base
@@ -52,7 +60,10 @@ Namespace API.Base
End If End If
Responser.SaveSettings() Responser.SaveSettings()
End If End If
_Path = New XMLValue(Of SFile)("Path", SFile.GetPath($"{GlobalPath.PathWithSeparator}{Site}"), _XML, {Site.ToString}, XMLValue(Of SFile).ToFilePath) _Path = New XMLValue(Of SFile)("Path", SFile.GetPath($"{GlobalPath.PathWithSeparator}{Site}"),
_XML, {SettingsCLS.Name_Node_Sites, Site.ToString}, XMLValue(Of SFile).ToFilePath)
_Path.ReplaceByValue("Path", {Site.ToString})
_XML.Remove(Site.ToString)
End Sub End Sub
Friend Sub Update() Friend Sub Update()
Responser.SaveSettings() Responser.SaveSettings()

View File

@@ -1,4 +1,12 @@
Namespace API.Base ' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Namespace API.Base
Friend Module Structures Friend Module Structures
Friend Structure UserMedia : Implements IEquatable(Of UserMedia) Friend Structure UserMedia : Implements IEquatable(Of UserMedia)
Friend Enum Types As Integer Friend Enum Types As Integer

View File

@@ -1,13 +1,21 @@
Imports PersonalUtilities.Functions.XML ' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports PersonalUtilities.Functions.XML
Imports System.IO Imports System.IO
Imports System.Threading Imports System.Threading
Imports UState = SCrawler.API.Base.UserMedia.States Imports UState = SCrawler.API.Base.UserMedia.States
Namespace API.Base Namespace API.Base
Friend MustInherit Class UserDataBase : Implements IUserData Friend MustInherit Class UserDataBase : Implements IUserData
Friend Const UserFileAppender As String = "User" Friend Const UserFileAppender As String = "User"
Friend Event OnPictureUpdated As IUserData.OnPictureUpdatedEventHandler Implements IUserData.OnPictureUpdated Friend Event OnUserUpdated As IUserData.OnUserUpdatedEventHandler Implements IUserData.OnUserUpdated
Protected Sub Raise_OnPictureUpdated() Protected Sub Raise_OnUserUpdated()
RaiseEvent OnPictureUpdated(Me) RaiseEvent OnUserUpdated(Me)
End Sub End Sub
#Region "Collection buttons" #Region "Collection buttons"
Friend WithEvents BTT_CONTEXT_DOWN As ToolStripMenuItem Friend WithEvents BTT_CONTEXT_DOWN As ToolStripMenuItem
@@ -33,7 +41,10 @@ Namespace API.Base
#End Region #End Region
#Region "XML Declarations" #Region "XML Declarations"
Private Const Name_Site As String = "Site" Private Const Name_Site As String = "Site"
Private Const Name_IsChannel As String = "IsChannel"
Private Const Name_UserName As String = "UserName" Private Const Name_UserName As String = "UserName"
Private Const Name_UserExists As String = "UserExists"
Private Const Name_UserSuspended As String = "UserSuspended"
Private Const Name_FriendlyName As String = "FriendlyName" Private Const Name_FriendlyName As String = "FriendlyName"
Private Const Name_UserID As String = "UserID" Private Const Name_UserID As String = "UserID"
Private Const Name_Description As String = "Description" Private Const Name_Description As String = "Description"
@@ -47,6 +58,8 @@ Namespace API.Base
Private Const Name_LabelsName As String = "Labels" Private Const Name_LabelsName As String = "Labels"
Private Const Name_ReadyForDownload As String = "ReadyForDownload" Private Const Name_ReadyForDownload As String = "ReadyForDownload"
Private Const Name_DownloadImages As String = "DownloadImages"
Private Const Name_DownloadVideos As String = "DownloadVideos"
Private Const Name_VideoCount As String = "VideoCount" Private Const Name_VideoCount As String = "VideoCount"
Private Const Name_PicturesCount As String = "PicturesCount" Private Const Name_PicturesCount As String = "PicturesCount"
@@ -65,6 +78,10 @@ Namespace API.Base
#Region "Declarations" #Region "Declarations"
Friend MustOverride Property Site As Sites Implements IContentProvider.Site Friend MustOverride Property Site As Sites Implements IContentProvider.Site
Friend User As UserInfo Friend User As UserInfo
Protected Const NonExistendUserHelp As String = "404"
Protected Const SuspendedUserHelp As String = "403"
Friend Overridable Property UserExists As Boolean = True Implements IUserData.Exists
Friend Overridable Property UserSuspended As Boolean = False Implements IUserData.Suspended
Friend Overridable Property Name As String Implements IContentProvider.Name Friend Overridable Property Name As String Implements IContentProvider.Name
Get Get
Return User.Name Return User.Name
@@ -129,7 +146,7 @@ Namespace API.Base
Protected Function GetNullPicture(ByVal MaxHeigh As XML.Base.XMLValue(Of Integer)) As Bitmap Protected Function GetNullPicture(ByVal MaxHeigh As XML.Base.XMLValue(Of Integer)) As Bitmap
Return New Bitmap(CInt(DivideWithZeroChecking(MaxHeigh.Value, 100) * 75), MaxHeigh.Value) Return New Bitmap(CInt(DivideWithZeroChecking(MaxHeigh.Value, 100) * 75), MaxHeigh.Value)
End Function End Function
Private Function GetPicture(Optional ByVal ReturnNullImageOnNothing As Boolean = True) As Image Protected Function GetPicture(Optional ByVal ReturnNullImageOnNothing As Boolean = True) As Image
Dim f As SFile = Nothing Dim f As SFile = Nothing
Dim p As UserImage = Nothing Dim p As UserImage = Nothing
Dim DelPath As Boolean = True Dim DelPath As Boolean = True
@@ -232,7 +249,9 @@ BlockNullPicture:
#Region "Downloading params" #Region "Downloading params"
Protected _DataLoaded As Boolean = False Protected _DataLoaded As Boolean = False
Protected _DataParsed As Boolean = False Protected _DataParsed As Boolean = False
Friend Property ReadyForDownload As Boolean = True Implements IUserData.ReadyForDownload Friend Overridable Property ReadyForDownload As Boolean = True Implements IUserData.ReadyForDownload
Friend Property DownloadImages As Boolean = True Implements IUserData.DownloadImages
Friend Property DownloadVideos As Boolean = True Implements IUserData.DownloadVideos
#End Region #End Region
#Region "Content" #Region "Content"
Protected ReadOnly _ContentList As List(Of UserMedia) Protected ReadOnly _ContentList As List(Of UserMedia)
@@ -405,7 +424,12 @@ BlockNullPicture:
''' <exception cref="ArgumentOutOfRangeException"></exception> ''' <exception cref="ArgumentOutOfRangeException"></exception>
Friend Overloads Shared Function GetInstance(ByVal u As UserInfo, Optional ByVal _LoadUserInformation As Boolean = True) As IUserData Friend Overloads Shared Function GetInstance(ByVal u As UserInfo, Optional ByVal _LoadUserInformation As Boolean = True) As IUserData
Select Case u.Site Select Case u.Site
Case Sites.Reddit : Return New Reddit.UserData(u, _LoadUserInformation) Case Sites.Reddit
If u.IsChannel Then
Return New Reddit.Channel(u, _LoadUserInformation)
Else
Return New Reddit.UserData(u, _LoadUserInformation)
End If
Case Sites.Twitter : Return New Twitter.UserData(u, _LoadUserInformation) Case Sites.Twitter : Return New Twitter.UserData(u, _LoadUserInformation)
Case Else : Throw New ArgumentOutOfRangeException("Site", $"Site [{u.Site}] information does not recognized by loader") Case Else : Throw New ArgumentOutOfRangeException("Site", $"Site [{u.Site}] information does not recognized by loader")
End Select End Select
@@ -418,10 +442,11 @@ BlockNullPicture:
If MyFile.Exists Then If MyFile.Exists Then
FileExists = True FileExists = True
Using x As New XmlFile(MyFile) With {.XmlReadOnly = True} Using x As New XmlFile(MyFile) With {.XmlReadOnly = True}
x.DefaultsLoading(False)
User.Site = Site User.Site = Site
Site = x.Value(Name_Site).FromXML(Of Integer)(0) Site = x.Value(Name_Site).FromXML(Of Integer)(0)
User.Name = x.Value(Name_UserName) User.Name = x.Value(Name_UserName)
UserExists = x.Value(Name_UserExists).FromXML(Of Boolean)(True)
UserSuspended = x.Value(Name_UserSuspended).FromXML(Of Boolean)(False)
ID = x.Value(Name_UserID) ID = x.Value(Name_UserID)
FriendlyName = x.Value(Name_FriendlyName) FriendlyName = x.Value(Name_FriendlyName)
UserDescription = x.Value(Name_Description) UserDescription = x.Value(Name_Description)
@@ -431,6 +456,8 @@ BlockNullPicture:
CreatedByChannel = x.Value(Name_CreatedByChannel).FromXML(Of Boolean)(False) CreatedByChannel = x.Value(Name_CreatedByChannel).FromXML(Of Boolean)(False)
SeparateVideoFolder = AConvert(Of Boolean)(x.Value(Name_SeparateVideoFolder), Nothing) SeparateVideoFolder = AConvert(Of Boolean)(x.Value(Name_SeparateVideoFolder), Nothing)
ReadyForDownload = x.Value(Name_ReadyForDownload).FromXML(Of Boolean)(True) ReadyForDownload = x.Value(Name_ReadyForDownload).FromXML(Of Boolean)(True)
DownloadImages = x.Value(Name_DownloadImages).FromXML(Of Boolean)(True)
DownloadVideos = x.Value(Name_DownloadVideos).FromXML(Of Boolean)(True)
_CountVideo = x.Value(Name_VideoCount).FromXML(Of Integer)(0) _CountVideo = x.Value(Name_VideoCount).FromXML(Of Integer)(0)
_CountPictures = x.Value(Name_PicturesCount).FromXML(Of Integer)(0) _CountPictures = x.Value(Name_PicturesCount).FromXML(Of Integer)(0)
LastUpdated = AConvert(Of Date)(x.Value(Name_LastUpdated), ADateTime.Formats.BaseDateTime, Nothing) LastUpdated = AConvert(Of Date)(x.Value(Name_LastUpdated), ADateTime.Formats.BaseDateTime, Nothing)
@@ -450,6 +477,8 @@ BlockNullPicture:
Using x As New XmlFile With {.Name = "User"} Using x As New XmlFile With {.Name = "User"}
x.Add(Name_Site, CInt(Site)) x.Add(Name_Site, CInt(Site))
x.Add(Name_UserName, User.Name) x.Add(Name_UserName, User.Name)
x.Add(Name_UserExists, UserExists.BoolToInteger)
x.Add(Name_UserSuspended, UserSuspended.BoolToInteger)
x.Add(Name_UserID, ID) x.Add(Name_UserID, ID)
x.Add(Name_FriendlyName, FriendlyName) x.Add(Name_FriendlyName, FriendlyName)
x.Add(Name_Description, UserDescription) x.Add(Name_Description, UserDescription)
@@ -463,6 +492,8 @@ BlockNullPicture:
x.Add(Name_SeparateVideoFolder, String.Empty) x.Add(Name_SeparateVideoFolder, String.Empty)
End If End If
x.Add(Name_ReadyForDownload, ReadyForDownload.BoolToInteger) x.Add(Name_ReadyForDownload, ReadyForDownload.BoolToInteger)
x.Add(Name_DownloadImages, DownloadImages.BoolToInteger)
x.Add(Name_DownloadVideos, DownloadVideos.BoolToInteger)
x.Add(Name_VideoCount, _CountVideo) x.Add(Name_VideoCount, _CountVideo)
x.Add(Name_PicturesCount, _CountPictures) x.Add(Name_PicturesCount, _CountPictures)
x.Add(Name_LastUpdated, AConvert(Of String)(LastUpdated, ADateTime.Formats.BaseDateTime, String.Empty)) x.Add(Name_LastUpdated, AConvert(Of String)(LastUpdated, ADateTime.Formats.BaseDateTime, String.Empty))
@@ -486,9 +517,8 @@ BlockNullPicture:
Private Overloads Sub LoadContentInformation(ByRef _CLIST As List(Of UserMedia), ByVal f As SFile) Private Overloads Sub LoadContentInformation(ByRef _CLIST As List(Of UserMedia), ByVal f As SFile)
Try Try
If Not f.Exists Then Exit Sub If Not f.Exists Then Exit Sub
Using x As New XmlFile(f, ProtectionLevels.All, False) With {.XmlReadOnly = True, .AllowSameNames = True} Using x As New XmlFile(f, Protector.Modes.All, False) With {.XmlReadOnly = True, .AllowSameNames = True}
x.LoadData() x.LoadData()
x.DefaultsLoading(False)
If x.Count > 0 Then If x.Count > 0 Then
Dim fs$ = MyFile.CutPath.PathWithSeparator Dim fs$ = MyFile.CutPath.PathWithSeparator
Dim gfn As Func(Of String, String) = Function(ByVal Input As String) As String Dim gfn As Func(Of String, String) = Function(ByVal Input As String) As String
@@ -552,7 +582,7 @@ BlockNullPicture:
Try Try
Dim URL$ = String.Empty Dim URL$ = String.Empty
Select Case Site Select Case Site
Case Sites.Reddit : URL = $"https://www.reddit.com/user/{Name}/" Case Sites.Reddit : URL = $"https://www.reddit.com/{IIf(IsChannel, "r", "user")}/{Name}/"
Case Sites.Twitter : URL = $"https://twitter.com/{Name}" Case Sites.Twitter : URL = $"https://twitter.com/{Name}"
Case Else : MsgBoxE($"Site [{Site}] opening does not implemented", MsgBoxStyle.Exclamation) Case Else : MsgBoxE($"Site [{Site}] opening does not implemented", MsgBoxStyle.Exclamation)
End Select End Select
@@ -567,11 +597,17 @@ BlockNullPicture:
#End Region #End Region
#Region "Download functions and options" #Region "Download functions and options"
Friend Overridable Property DownloadTopCount As Integer? = Nothing Implements IUserData.DownloadTopCount Friend Overridable Property DownloadTopCount As Integer? = Nothing Implements IUserData.DownloadTopCount
Protected Responser As PersonalUtilities.Tools.WEB.Response
Friend Overridable Sub DownloadData(ByVal Token As CancellationToken) Implements IContentProvider.DownloadData Friend Overridable Sub DownloadData(ByVal Token As CancellationToken) Implements IContentProvider.DownloadData
Dim Canceled As Boolean = False Dim Canceled As Boolean = False
Try Try
UpdateDataFiles() UpdateDataFiles()
If Not Responser Is Nothing Then Responser.Dispose()
Responser = New PersonalUtilities.Tools.WEB.Response
Responser.Copy(Settings.Site(Site).Responser)
Dim UpPic As Boolean = Settings.ViewModeIsPicture AndAlso GetPicture(False) Is Nothing Dim UpPic As Boolean = Settings.ViewModeIsPicture AndAlso GetPicture(False) Is Nothing
Dim sEnvir() As Boolean = {UserExists, UserSuspended}
Dim EnvirChanged As Func(Of Boolean) = Function() Not sEnvir(0) = UserExists Or Not sEnvir(1) = UserSuspended
_DownloadedPicturesSession = 0 _DownloadedPicturesSession = 0
_DownloadedVideosSession = 0 _DownloadedVideosSession = 0
_TempMediaList.Clear() _TempMediaList.Clear()
@@ -586,6 +622,12 @@ BlockNullPicture:
DownloadDataF(Token) DownloadDataF(Token)
ThrowAny(Token) ThrowAny(Token)
If _TempMediaList.Count > 0 Then
If Not DownloadImages Then _TempMediaList.RemoveAll(Function(m) m.Type = UserMedia.Types.GIF Or m.Type = UserMedia.Types.Picture)
If Not DownloadVideos Then _TempMediaList.RemoveAll(Function(m) m.Type = UserMedia.Types.Video Or
m.Type = UserMedia.Types.VideoPre Or m.Type = UserMedia.Types.m3u8)
End If
ReparseVideo(Token) ReparseVideo(Token)
ThrowAny(Token) ThrowAny(Token)
If _TempPostsList.Count > 0 And __SaveData Then TextSaver.SaveTextToFile(_TempPostsList.ListToString(, Environment.NewLine), MyFilePosts, True,, EDP.None) If _TempPostsList.Count > 0 And __SaveData Then TextSaver.SaveTextToFile(_TempPostsList.ListToString(, Environment.NewLine), MyFilePosts, True,, EDP.None)
@@ -595,7 +637,7 @@ BlockNullPicture:
_ContentList.ListAddList(_ContentNew.Where(Function(c) c.State = UState.Downloaded), LNC) _ContentList.ListAddList(_ContentNew.Where(Function(c) c.State = UState.Downloaded), LNC)
_CountPictures = _ContentList.LongCount(Function(c) c.Type = UserMedia.Types.Picture) _CountPictures = _ContentList.LongCount(Function(c) c.Type = UserMedia.Types.Picture)
_CountVideo = _ContentList.LongCount(Function(c) c.Type = UserMedia.Types.Video) _CountVideo = _ContentList.LongCount(Function(c) c.Type = UserMedia.Types.Video)
If DownloadedPictures + DownloadedVideos > 0 Then If DownloadedPictures + DownloadedVideos > 0 Or EnvirChanged.Invoke Then
If __SaveData Then If __SaveData Then
LastUpdated = Now LastUpdated = Now
If Labels.Contains(LabelsKeeper.NoParsedUser) Then Labels.Remove(LabelsKeeper.NoParsedUser) If Labels.Contains(LabelsKeeper.NoParsedUser) Then Labels.Remove(LabelsKeeper.NoParsedUser)
@@ -606,12 +648,13 @@ BlockNullPicture:
_ContentList.Clear() _ContentList.Clear()
CreatedByChannel = False CreatedByChannel = False
End If End If
If Not UserExists Then ReadyForDownload = False
UpdateUserInformation() UpdateUserInformation()
End If End If
ThrowIfDisposed() ThrowIfDisposed()
_DownloadedPicturesTotal += _DownloadedPicturesSession _DownloadedPicturesTotal += _DownloadedPicturesSession
_DownloadedVideosTotal += _DownloadedVideosSession _DownloadedVideosTotal += _DownloadedVideosSession
If UpPic Then Raise_OnPictureUpdated() If UpPic Or EnvirChanged.Invoke Then Raise_OnUserUpdated()
Catch oex As OperationCanceledException When Token.IsCancellationRequested Catch oex As OperationCanceledException When Token.IsCancellationRequested
MyMainLOG = $"{Site} - {Name}: downloading canceled" MyMainLOG = $"{Site} - {Name}: downloading canceled"
Canceled = True Canceled = True
@@ -621,12 +664,13 @@ BlockNullPicture:
LogError(ex, "downloading data error") LogError(ex, "downloading data error")
HasError = True HasError = True
Finally Finally
If Not Responser Is Nothing Then Responser.Dispose() : Responser = Nothing
If Not Canceled Then _DataParsed = True ': LastUpdated = Now If Not Canceled Then _DataParsed = True ': LastUpdated = Now
_ContentNew.Clear() _ContentNew.Clear()
DownloadTopCount = Nothing DownloadTopCount = Nothing
End Try End Try
End Sub End Sub
Private Sub UpdateDataFiles() Protected Sub UpdateDataFiles()
If Not User.File.IsEmptyString Then If Not User.File.IsEmptyString Then
MyFileData = User.File MyFileData = User.File
MyFileData.Name &= "_Data" MyFileData.Name &= "_Data"
@@ -640,35 +684,64 @@ BlockNullPicture:
Protected MustOverride Sub DownloadDataF(ByVal Token As CancellationToken) Protected MustOverride Sub DownloadDataF(ByVal Token As CancellationToken)
Protected MustOverride Sub ReparseVideo(ByVal Token As CancellationToken) Protected MustOverride Sub ReparseVideo(ByVal Token As CancellationToken)
Protected MustOverride Sub DownloadContent(ByVal Token As CancellationToken) Protected MustOverride Sub DownloadContent(ByVal Token As CancellationToken)
Protected Function ChangeFileNameByProvider(ByVal f As SFile, ByVal m As UserMedia) As SFile
Dim ff As SFile = Nothing
Try
If Not f.IsEmptyString AndAlso f.Exists Then
Dim d As Date? = m.Post.Date
If Settings.FileReplaceNameByDate Then
Dim dd$ = AConvert(Of String)(If(d, Now), FileDateAppenderProvider, String.Empty)
ff = f
ff.Name = dd
ff = SFile.Indexed_IndexFile(ff,, New NumberedFile(ff))
ElseIf d.HasValue AndAlso (Settings.FileAddDateToFileName Or Settings.FileAddTimeToFileName) AndAlso
(Not FileDateAppenderProvider Is Nothing And Not FileDateAppenderPattern.IsEmptyString) Then
ff = f
ff.Name = String.Format(FileDateAppenderPattern, f.Name, CStr(AConvert(Of String)(d.Value, FileDateAppenderProvider, String.Empty)))
End If
If Not ff.Name.IsEmptyString Then My.Computer.FileSystem.RenameFile(f, ff.File) : Return ff
End If
Return f
Catch ex As Exception
LogError(ex, $"change file name from [{f}] to [{ff}]")
Return f
End Try
End Function
#End Region #End Region
#Region "Delete, Move, Merge" #Region "Delete, Move, Merge"
Friend Overridable Function Delete() As Integer Implements IUserData.Delete Friend Overridable Function Delete() As Integer Implements IUserData.Delete
Return DeleteF(Me)
End Function
Friend Function DeleteF(ByVal Instance As IUserData) As Integer
Dim f As SFile = SFile.GetPath(MyFile.CutPath.Path) Dim f As SFile = SFile.GetPath(MyFile.CutPath.Path)
If f.Exists(SFO.Path, False) AndAlso f.Delete(SFO.Path, False, False) Then If f.Exists(SFO.Path, False) AndAlso f.Delete(SFO.Path, False, False) Then
ImageHandler(Me, False) ImageHandler(Me, False)
Settings.UsersList.Remove(User) Settings.UsersList.Remove(User)
Settings.UpdateUsersList() Settings.UpdateUsersList()
Settings.Users.Remove(Me) Settings.Users.Remove(Instance)
Downloader.UserRemove(Me) Downloader.UserRemove(Instance)
Dispose(True) Dispose(True)
Return 1 Return 1
Else Else
Return 0 Return 0
End If End If
End Function End Function
Friend Overridable Function MoveFiles(ByVal __CollectionName As String, ByVal _MergeData As Boolean) As Boolean Implements IUserData.MoveFiles Friend Overridable Function MoveFiles(ByVal __CollectionName As String) As Boolean Implements IUserData.MoveFiles
Return MoveFilesF(Me, __CollectionName)
End Function
Friend Function MoveFilesF(ByRef Instance As IUserData, ByVal __CollectionName As String) As Boolean
Dim UserBefore As UserInfo = User Dim UserBefore As UserInfo = User
Dim Removed As Boolean = True Dim Removed As Boolean = True
Dim _TurnBack As Boolean = False Dim _TurnBack As Boolean = False
Try Try
Dim f As SFile Dim f As SFile
If IncludedInCollection Then If IncludedInCollection Then
Settings.Users.Add(Me) Settings.Users.Add(Instance)
Removed = False Removed = False
User.CollectionName = String.Empty User.CollectionName = String.Empty
User.IncludedInCollection = False User.IncludedInCollection = False
Else Else
Settings.Users.Remove(Me) Settings.Users.Remove(Instance)
Removed = True Removed = True
User.CollectionName = __CollectionName User.CollectionName = __CollectionName
User.IncludedInCollection = True User.IncludedInCollection = True
@@ -683,7 +756,7 @@ BlockNullPicture:
"Destination directory is not empty!"}, MsgBoxStyle.Exclamation,,, {"Delete", "Cancel"}) = 1 Then "Destination directory is not empty!"}, MsgBoxStyle.Exclamation,,, {"Delete", "Cancel"}) = 1 Then
MsgBoxE("Operation canceled", MsgBoxStyle.Exclamation) MsgBoxE("Operation canceled", MsgBoxStyle.Exclamation)
User = UserBefore User = UserBefore
If Removed Then Settings.Users.Add(Me) Else Settings.Users.Remove(Me) If Removed Then Settings.Users.Add(Instance) Else Settings.Users.Remove(Instance)
_TurnBack = False _TurnBack = False
Return False Return False
End If End If
@@ -699,7 +772,7 @@ BlockNullPicture:
ErrorsDescriber.Execute(EDP.LogMessageValue, ex, "Files moving error") ErrorsDescriber.Execute(EDP.LogMessageValue, ex, "Files moving error")
User = UserBefore User = UserBefore
If _TurnBack Then If _TurnBack Then
If Removed Then Settings.Users.Add(Me) Else Settings.Users.Remove(Me) If Removed Then Settings.Users.Add(Instance) Else Settings.Users.Remove(Instance)
End If End If
Return False Return False
End Try End Try
@@ -746,6 +819,8 @@ BlockNullPicture:
End If End If
UpdateUserInformation() UpdateUserInformation()
End If End If
Catch ioex As InvalidOperationException When ioex.HelpLink = 1
MsgBoxE(ioex.Message, vbCritical)
Catch ex As Exception Catch ex As Exception
LogError(ex, "[UserDataBase.MergeData]") LogError(ex, "[UserDataBase.MergeData]")
End Try End Try
@@ -835,7 +910,11 @@ BlockNullPicture:
Return OutValue Return OutValue
End Function End Function
Friend Overridable Function CompareTo(ByVal Obj As Object) As Integer Implements IComparable.CompareTo Friend Overridable Function CompareTo(ByVal Obj As Object) As Integer Implements IComparable.CompareTo
If TypeOf Obj Is Reddit.Channel Then
Return CompareTo(DirectCast(DirectCast(Obj, Reddit.Channel).Instance, UserDataBase))
Else
Return CompareTo(DirectCast(Obj, UserDataBase)) Return CompareTo(DirectCast(Obj, UserDataBase))
End If
End Function End Function
#End Region #End Region
#Region "IEquatable Support" #Region "IEquatable Support"
@@ -843,7 +922,11 @@ BlockNullPicture:
Return Site = Other.Site And Name = Other.Name Return Site = Other.Site And Name = Other.Name
End Function End Function
Public Overrides Function Equals(ByVal Obj As Object) As Boolean Public Overrides Function Equals(ByVal Obj As Object) As Boolean
If TypeOf Obj Is Reddit.Channel Then
Return Equals(DirectCast(DirectCast(Obj, Reddit.Channel).Instance, UserDataBase))
Else
Return Equals(DirectCast(Obj, UserDataBase)) Return Equals(DirectCast(Obj, UserDataBase))
End If
End Function End Function
#End Region #End Region
#Region "IDisposable Support" #Region "IDisposable Support"
@@ -860,6 +943,7 @@ BlockNullPicture:
_ContentNew.Clear() _ContentNew.Clear()
_TempMediaList.Clear() _TempMediaList.Clear()
_TempPostsList.Clear() _TempPostsList.Clear()
If Not Responser Is Nothing Then Responser.Dispose()
If Not BTT_CONTEXT_DOWN Is Nothing Then BTT_CONTEXT_DOWN.Dispose() If Not BTT_CONTEXT_DOWN Is Nothing Then BTT_CONTEXT_DOWN.Dispose()
If Not BTT_CONTEXT_EDIT Is Nothing Then BTT_CONTEXT_EDIT.Dispose() If Not BTT_CONTEXT_EDIT Is Nothing Then BTT_CONTEXT_EDIT.Dispose()
If Not BTT_CONTEXT_DELETE Is Nothing Then BTT_CONTEXT_DELETE.Dispose() If Not BTT_CONTEXT_DELETE Is Nothing Then BTT_CONTEXT_DELETE.Dispose()
@@ -892,7 +976,7 @@ BlockNullPicture:
Sub DownloadData(ByVal Token As CancellationToken) Sub DownloadData(ByVal Token As CancellationToken)
End Interface End Interface
Friend Interface IUserData : Inherits IContentProvider, IComparable(Of UserDataBase), IComparable, IEquatable(Of UserDataBase), IDisposable Friend Interface IUserData : Inherits IContentProvider, IComparable(Of UserDataBase), IComparable, IEquatable(Of UserDataBase), IDisposable
Event OnPictureUpdated(ByVal User As IUserData) Event OnUserUpdated(ByVal User As IUserData)
Property ParseUserMediaOnly As Boolean Property ParseUserMediaOnly As Boolean
#Region "Images" #Region "Images"
Function GetPicture() As Image Function GetPicture() As Image
@@ -905,6 +989,8 @@ BlockNullPicture:
ReadOnly Property Labels As List(Of String) ReadOnly Property Labels As List(Of String)
#End Region #End Region
ReadOnly Property IsChannel As Boolean ReadOnly Property IsChannel As Boolean
Property Exists As Boolean
Property Suspended As Boolean
Property ReadyForDownload As Boolean Property ReadyForDownload As Boolean
Property [File] As SFile Property [File] As SFile
Property FileExists As Boolean Property FileExists As Boolean
@@ -916,6 +1002,8 @@ BlockNullPicture:
ReadOnly Property FitToAddParams As Boolean ReadOnly Property FitToAddParams As Boolean
ReadOnly Property LVIKey As String ReadOnly Property LVIKey As String
ReadOnly Property LVIIndex As Integer ReadOnly Property LVIIndex As Integer
Property DownloadImages As Boolean
Property DownloadVideos As Boolean
Function GetLVI(ByVal Destination As ListView) As ListViewItem Function GetLVI(ByVal Destination As ListView) As ListViewItem
Function GetLVIGroup(ByVal Destination As ListView) As ListViewGroup Function GetLVIGroup(ByVal Destination As ListView) As ListViewGroup
Sub LoadUserInformation() Sub LoadUserInformation()
@@ -927,7 +1015,7 @@ BlockNullPicture:
''' 3 - Collection splitted ''' 3 - Collection splitted
''' </summary> ''' </summary>
Function Delete() As Integer Function Delete() As Integer
Function MoveFiles(ByVal CollectionName As String, ByVal MergeData As Boolean) As Boolean Function MoveFiles(ByVal CollectionName As String) As Boolean
Sub OpenFolder() Sub OpenFolder()
ReadOnly Property Self As IUserData ReadOnly Property Self As IUserData
Property DownloadTopCount As Integer? Property DownloadTopCount As Integer?

View File

@@ -1,10 +1,19 @@
Imports PersonalUtilities.Tools ' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports PersonalUtilities.Tools
Imports PersonalUtilities.Forms.Toolbars Imports PersonalUtilities.Forms.Toolbars
Imports PersonalUtilities.Functions.XML Imports PersonalUtilities.Functions.XML
Imports SCrawler.API.Base Imports SCrawler.API.Base
Imports System.Threading
Namespace API.Reddit Namespace API.Reddit
Friend Class Channel : Implements ICollection(Of UserPost), IEquatable(Of Channel), IComparable(Of Channel), Friend Class Channel : Implements ICollection(Of UserPost), IEquatable(Of Channel), IComparable(Of Channel),
IRangeSwitcherContainer(Of UserPost), ILoaderSaver, IMyEnumerator(Of UserPost), IChannelLimits, IDisposable IRangeSwitcherContainer(Of UserPost), ILoaderSaver, IMyEnumerator(Of UserPost), IChannelLimits, IUserData, IDisposable
#Region "XML Nodes' Names" #Region "XML Nodes' Names"
Private Const Name_Name As String = "Name" Private Const Name_Name As String = "Name"
Private Const Name_ID As String = "ID" Private Const Name_ID As String = "ID"
@@ -12,8 +21,251 @@ Namespace API.Reddit
Private Const Name_PostsNode As String = "Posts" Private Const Name_PostsNode As String = "Posts"
#End Region #End Region
Friend Const DefaultDownloadLimitCount As Integer = 1000 Friend Const DefaultDownloadLimitCount As Integer = 1000
Friend Property Name As String = String.Empty #Region "IUserData Support"
Friend Property ID As String = String.Empty Private Event OnUserUpdated As IUserData.OnUserUpdatedEventHandler Implements IUserData.OnUserUpdated
Friend Property Instance As IUserData
Private Property IUserData_ParseUserMediaOnly As Boolean = False Implements IUserData.ParseUserMediaOnly
Private Property IUserData_Exists As Boolean Implements IUserData.Exists
Get
Return Instance.Exists
End Get
Set(ByVal e As Boolean)
End Set
End Property
Private Property IUserData_Suspended As Boolean Implements IUserData.Suspended
Get
Return Instance.Suspended
End Get
Set(ByVal s As Boolean)
End Set
End Property
Private ReadOnly Property IUserData_IsCollection As Boolean Implements IUserData.IsCollection
Get
Return Instance.IsCollection
End Get
End Property
Private Property IUserData_CollectionName As String Implements IUserData.CollectionName
Get
Return Instance.CollectionName
End Get
Set(ByVal NewName As String)
Instance.CollectionName = NewName
End Set
End Property
Private ReadOnly Property IUserData_IncludedInCollection As Boolean Implements IUserData.IncludedInCollection
Get
Return Instance.IncludedInCollection
End Get
End Property
Private ReadOnly Property IUserData_Labels As List(Of String) Implements IUserData.Labels
Get
Return Instance.Labels
End Get
End Property
Private ReadOnly Property IUserData_IsChannel As Boolean = True Implements IUserData.IsChannel
Private Property IUserData_ReadyForDownload As Boolean Implements IUserData.ReadyForDownload
Get
Return Instance.ReadyForDownload
End Get
Set(ByVal IsReady As Boolean)
Instance.ReadyForDownload = IsReady
End Set
End Property
Private Property IUserData_File As SFile Implements IUserData.File
Get
Return Instance.File
End Get
Set(ByVal NewFile As SFile)
Instance.File = NewFile
End Set
End Property
Private Property IUserData_FileExists As Boolean Implements IUserData.FileExists
Get
Return Instance.FileExists
End Get
Set(ByVal IsExists As Boolean)
Instance.FileExists = IsExists
End Set
End Property
Private Property IUserData_DownloadedPictures As Integer Implements IUserData.DownloadedPictures
Get
Return Instance.DownloadedPictures
End Get
Set(ByVal c As Integer)
Instance.DownloadedPictures = c
End Set
End Property
Private Property IUserData_DownloadedVideos As Integer Implements IUserData.DownloadedVideos
Get
Return Instance.DownloadedVideos
End Get
Set(ByVal c As Integer)
Instance.DownloadedVideos = c
End Set
End Property
Private ReadOnly Property IUserData_DownloadedTotal(Optional Total As Boolean = True) As Integer Implements IUserData.DownloadedTotal
Get
Return Instance.DownloadedTotal
End Get
End Property
Private ReadOnly Property IUserData_DownloadedInformation As String Implements IUserData.DownloadedInformation
Get
Return Instance.DownloadedInformation
End Get
End Property
Private Property IUserData_HasError As Boolean Implements IUserData.HasError
Get
Return Instance.HasError
End Get
Set(ByVal e As Boolean)
Instance.HasError = e
End Set
End Property
Private ReadOnly Property IUserData_FitToAddParams As Boolean Implements IUserData.FitToAddParams
Get
Return Instance.FitToAddParams
End Get
End Property
Private ReadOnly Property IUserData_LVIKey As String Implements IUserData.LVIKey
Get
Return Instance.LVIKey
End Get
End Property
Private ReadOnly Property IUserData_LVIIndex As Integer Implements IUserData.LVIIndex
Get
Return Instance.LVIIndex
End Get
End Property
Private Property IUserData_DownloadImages As Boolean Implements IUserData.DownloadImages
Get
Return Instance.DownloadImages
End Get
Set(ByVal d As Boolean)
Instance.DownloadImages = d
End Set
End Property
Private Property IUserData_DownloadVideos As Boolean Implements IUserData.DownloadVideos
Get
Return Instance.DownloadVideos
End Get
Set(ByVal d As Boolean)
Instance.DownloadVideos = d
End Set
End Property
Private ReadOnly Property IUserData_Self As IUserData Implements IUserData.Self
Get
Return Instance
End Get
End Property
Private Property IUserData_DownloadTopCount As Integer? Implements IUserData.DownloadTopCount
Get
Return Instance.DownloadTopCount
End Get
Set(ByVal c As Integer?)
Instance.DownloadTopCount = c
End Set
End Property
Friend Property Site As Sites = Sites.Reddit Implements IContentProvider.Site
Private Property IUserData_FriendlyName As String Implements IContentProvider.FriendlyName
Get
Return Instance.FriendlyName
End Get
Set(ByVal NewName As String)
Instance.FriendlyName = NewName
End Set
End Property
Private Property IUserData_Description As String Implements IContentProvider.Description
Get
Return Instance.Description
End Get
Set(ByVal d As String)
Instance.Description = d
End Set
End Property
Private Property IUserData_Favorite As Boolean Implements IContentProvider.Favorite
Get
Return Instance.Favorite
End Get
Set(ByVal f As Boolean)
Instance.Favorite = f
End Set
End Property
Private Property IUserData_Temporary As Boolean Implements IContentProvider.Temporary
Get
Return Instance.Temporary
End Get
Set(ByVal t As Boolean)
Instance.Temporary = t
End Set
End Property
Private Sub IUserData_SetPicture(ByVal f As SFile) Implements IUserData.SetPicture
Instance.SetPicture(f)
End Sub
Private Sub IUserData_LoadUserInformation() Implements IUserData.LoadUserInformation
Instance.LoadUserInformation()
End Sub
Private Sub IUserData_UpdateUserInformation() Implements IUserData.UpdateUserInformation
Instance.UpdateUserInformation()
End Sub
Private Sub IUserData_OpenFolder() Implements IUserData.OpenFolder
Instance.OpenFolder()
End Sub
Private Sub IUserData_OpenSite() Implements IContentProvider.OpenSite
Instance.OpenSite()
End Sub
Private Sub IUserData_DownloadData(ByVal Token As CancellationToken) Implements IContentProvider.DownloadData
DownloadData(Token, False, Nothing)
End Sub
Private Function IUserData_GetPicture() As Image Implements IUserData.GetPicture
Return Instance.GetPicture()
End Function
Private Function IUserData_GetLVI(ByVal Destination As ListView) As ListViewItem Implements IUserData.GetLVI
Return Instance.GetLVI(Destination)
End Function
Private Function IUserData_GetLVIGroup(ByVal Destination As ListView) As ListViewGroup Implements IUserData.GetLVIGroup
Return Instance.GetLVIGroup(Destination)
End Function
Private Function IUserData_Delete() As Integer Implements IUserData.Delete
Return DirectCast(Instance, UserDataBase).DeleteF(Me)
End Function
Private Function IUserData_MoveFiles(ByVal CollectionName As String) As Boolean Implements IUserData.MoveFiles
Return DirectCast(Instance, UserDataBase).MoveFilesF(Me, CollectionName)
End Function
#End Region
Private _Name As String = String.Empty
Friend Property Name As String Implements IUserData.Name
Get
If IsRegularChannel Then
Return Instance.Name
Else
Return _Name
End If
End Get
Set(ByVal NewName As String)
If IsRegularChannel Then
Instance.Name = NewName
Else
_Name = NewName
End If
End Set
End Property
Private _ID As String = String.Empty
Friend Property ID As String Implements IUserData.ID
Get
If IsRegularChannel Then
Return Instance.ID
Else
Return _ID
End If
End Get
Set(ByVal NewID As String)
If IsRegularChannel Then
Instance.ID = NewID
Else
_ID = NewID
End If
End Set
End Property
Friend ReadOnly Property CUser As UserInfo Friend ReadOnly Property CUser As UserInfo
Get Get
Return New UserInfo(Me) Return New UserInfo(Me)
@@ -122,6 +374,7 @@ Namespace API.Reddit
End Sub End Sub
Friend Property AutoGetLimits As Boolean = True Implements IChannelLimits.AutoGetLimits Friend Property AutoGetLimits As Boolean = True Implements IChannelLimits.AutoGetLimits
#End Region #End Region
Friend ReadOnly IsRegularChannel As Boolean = False
Friend Sub New() Friend Sub New()
Posts = New List(Of UserPost) Posts = New List(Of UserPost)
PostsLatest = New List(Of UserPost) PostsLatest = New List(Of UserPost)
@@ -131,9 +384,19 @@ Namespace API.Reddit
Me.New Me.New
LoadData(f, False) LoadData(f, False)
End Sub End Sub
Friend Sub New(ByVal u As UserInfo, Optional ByVal _LoadUserInformation As Boolean = True)
Me.New
Instance = New UserData(u, _LoadUserInformation) With {.SaveToCache = False, .SkipExistsUsers = False, .ChannelInfo = Me}
AutoGetLimits = True
DirectCast(Instance, UserData).SetLimit(Me)
IsRegularChannel = True
End Sub
Public Shared Widening Operator CType(ByVal f As SFile) As Channel Public Shared Widening Operator CType(ByVal f As SFile) As Channel
Return New Channel(f) Return New Channel(f)
End Operator End Operator
Public Shared Widening Operator CType(ByVal c As Channel) As UserDataBase
Return DirectCast(c.Instance, UserDataBase)
End Operator
Public Overrides Function ToString() As String Public Overrides Function ToString() As String
If Not Name.IsEmptyString Then If Not Name.IsEmptyString Then
Return Name Return Name
@@ -144,10 +407,13 @@ Namespace API.Reddit
Friend Sub Delete() Friend Sub Delete()
If File.Exists Then File.Delete() If File.Exists Then File.Delete()
End Sub End Sub
Friend Sub DownloadData(ByVal Token As Threading.CancellationToken, Optional ByVal SkipExists As Boolean = True, Friend Sub DownloadData(ByVal Token As CancellationToken, Optional ByVal SkipExists As Boolean = True,
Optional ByVal p As MyProgress = Nothing) Optional ByVal p As MyProgress = Nothing)
Try Try
_Downloading = True _Downloading = True
If Not Instance Is Nothing Then
Instance.DownloadData(Token)
Else
Using d As New UserData(CUser, False, False) With { Using d As New UserData(CUser, False, False) With {
.Progress = p, .Progress = p,
.SaveToCache = True, .SaveToCache = True,
@@ -159,8 +425,8 @@ Namespace API.Reddit
Posts.ListAddList(d.GetNewChannelPosts(), LAP.NotContainsOnly) Posts.ListAddList(d.GetNewChannelPosts(), LAP.NotContainsOnly)
Posts.Sort() Posts.Sort()
LatestParsedDate = If(Posts.FirstOrDefault(Function(pp) pp.Date.HasValue).Date, LatestParsedDate) LatestParsedDate = If(Posts.FirstOrDefault(Function(pp) pp.Date.HasValue).Date, LatestParsedDate)
Token.ThrowIfCancellationRequested()
End Using End Using
End If
Catch oex As OperationCanceledException When Token.IsCancellationRequested Catch oex As OperationCanceledException When Token.IsCancellationRequested
Finally Finally
_Downloading = False _Downloading = False
@@ -201,26 +467,50 @@ Namespace API.Reddit
Friend Overloads Function Equals(ByVal Other As Channel) As Boolean Implements IEquatable(Of Channel).Equals Friend Overloads Function Equals(ByVal Other As Channel) As Boolean Implements IEquatable(Of Channel).Equals
Return ID = Other.ID Return ID = Other.ID
End Function End Function
Public Overloads Overrides Function Equals(ByVal Obj As Object) As Boolean Private Overloads Function Equals(ByVal Other As UserDataBase) As Boolean Implements IEquatable(Of UserDataBase).Equals
If Not Obj Is Nothing Then If Not Instance Is Nothing Then
If TypeOf Obj Is String Then Return Instance.Equals(Other)
Return ID = CStr(Obj)
Else
Return Equals(DirectCast(Obj, Channel))
End If
Else Else
Return False Return False
End If End If
End Function End Function
Public Overloads Overrides Function Equals(ByVal Obj As Object) As Boolean
If Not Obj Is Nothing Then
If TypeOf Obj Is String Then
Return ID = CStr(Obj)
ElseIf TypeOf Obj Is Channel Then
Return Equals(DirectCast(Obj, Channel))
ElseIf TypeOf Obj Is UserDataBase Then
Return Equals(DirectCast(Obj, UserDataBase))
End If
End If
Return False
End Function
#End Region #End Region
#Region "IComparable Support" #Region "IComparable Support"
Friend Function CompareTo(ByVal Other As Channel) As Integer Implements IComparable(Of Channel).CompareTo Friend Overloads Function CompareTo(ByVal Other As Channel) As Integer Implements IComparable(Of Channel).CompareTo
If Not Name.IsEmptyString And Not Other.Name.IsEmptyString Then If Not Name.IsEmptyString And Not Other.Name.IsEmptyString Then
Return Name.CompareTo(Other.Name) Return Name.CompareTo(Other.Name)
Else Else
Return ID.CompareTo(Other.ID) Return ID.CompareTo(Other.ID)
End If End If
End Function End Function
Private Overloads Function CompareTo(ByVal Other As UserDataBase) As Integer Implements IComparable(Of UserDataBase).CompareTo
If Not Instance Is Nothing Then
Return Instance.CompareTo(Other)
Else
Return 0
End If
End Function
Private Overloads Function CompareTo(ByVal Obj As Object) As Integer Implements IComparable.CompareTo
If TypeOf Obj Is Channel Then
Return CompareTo(DirectCast(Obj, Channel))
ElseIf TypeOf Obj Is UserDataBase And Not Instance Is Nothing Then
Return Instance.CompareTo(Obj)
Else
Return 0
End If
End Function
#End Region #End Region
#Region "ILoaderSaver Support" #Region "ILoaderSaver Support"
Friend Overloads Function LoadData(Optional ByVal f As SFile = Nothing, Optional ByVal e As ErrorsDescriber = Nothing) As Boolean Implements ILoaderSaver.Load Friend Overloads Function LoadData(Optional ByVal f As SFile = Nothing, Optional ByVal e As ErrorsDescriber = Nothing) As Boolean Implements ILoaderSaver.Load
@@ -228,9 +518,8 @@ Namespace API.Reddit
End Function End Function
Friend Overloads Function LoadData(ByVal f As SFile, ByVal PartialLoad As Boolean, Optional ByVal e As ErrorsDescriber = Nothing) As Boolean Friend Overloads Function LoadData(ByVal f As SFile, ByVal PartialLoad As Boolean, Optional ByVal e As ErrorsDescriber = Nothing) As Boolean
If f.Exists Then If f.Exists Then
Using x As New XmlFile(f, ProtectionLevels.All, False) With {.XmlReadOnly = True, .AllowSameNames = True} Using x As New XmlFile(f, Protector.Modes.All, False) With {.XmlReadOnly = True, .AllowSameNames = True}
x.LoadData() x.LoadData()
x.DefaultsLoading(False)
If x.Count > 0 Then If x.Count > 0 Then
Dim XMLDateProvider As New ADateTime(ADateTime.Formats.BaseDateTime) Dim XMLDateProvider As New ADateTime(ADateTime.Formats.BaseDateTime)
Name = x.Value(Name_Name) Name = x.Value(Name_Name)
@@ -251,7 +540,6 @@ Namespace API.Reddit
Friend Overloads Function Save(Optional ByVal f As SFile = Nothing, Optional ByVal e As ErrorsDescriber = Nothing) As Boolean Implements ILoaderSaver.Save Friend Overloads Function Save(Optional ByVal f As SFile = Nothing, Optional ByVal e As ErrorsDescriber = Nothing) As Boolean Implements ILoaderSaver.Save
Dim XMLDateProvider As New ADateTime(ADateTime.Formats.BaseDateTime) Dim XMLDateProvider As New ADateTime(ADateTime.Formats.BaseDateTime)
Using x As New XmlFile With {.AllowSameNames = True, .Name = "Channel"} Using x As New XmlFile With {.AllowSameNames = True, .Name = "Channel"}
x.DefaultsLoading(False)
x.Add(Name_Name, Name) x.Add(Name_Name, Name)
x.Add(Name_ID, ID) x.Add(Name_ID, ID)
If Posts.Count > 0 Or PostsLatest.Count > 0 Then If Posts.Count > 0 Or PostsLatest.Count > 0 Then
@@ -280,12 +568,18 @@ Namespace API.Reddit
#End Region #End Region
#Region "IDisposable Support" #Region "IDisposable Support"
Private disposedValue As Boolean = False Private disposedValue As Boolean = False
Friend ReadOnly Property Disposed As Boolean Implements IUserData.Disposed
Get
Return disposedValue
End Get
End Property
Protected Overridable Overloads Sub Dispose(ByVal disposing As Boolean) Protected Overridable Overloads Sub Dispose(ByVal disposing As Boolean)
If Not disposedValue Then If Not disposedValue Then
If disposing Then If disposing Then
Posts.Clear() Posts.Clear()
PostsLatest.Clear() PostsLatest.Clear()
Range.Dispose() Range.Dispose()
If Not Instance Is Nothing Then Instance.Dispose()
If CachePath.Exists(SFO.Path, False) Then CachePath.Delete(SFO.Path, False, False, EDP.SendInLog) If CachePath.Exists(SFO.Path, False) Then CachePath.Delete(SFO.Path, False, False, EDP.SendInLog)
End If End If
disposedValue = True disposedValue = True

View File

@@ -1,4 +1,12 @@
Imports PersonalUtilities.Tools ' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports PersonalUtilities.Tools
Imports PersonalUtilities.Forms.Toolbars Imports PersonalUtilities.Forms.Toolbars
Imports SCrawler.API.Base Imports SCrawler.API.Base
Imports System.Threading Imports System.Threading

View File

@@ -1,4 +1,12 @@
Imports PersonalUtilities.Functions.XML.Base ' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports PersonalUtilities.Functions.XML.Base
Namespace API.Reddit Namespace API.Reddit
Friend Module Declarations Friend Module Declarations
Friend ReadOnly JsonNodesJson() As NodeParams = {New NodeParams("posts", True, True, True, True, 3)} Friend ReadOnly JsonNodesJson() As NodeParams = {New NodeParams("posts", True, True, True, True, 3)}

View File

@@ -1,4 +1,12 @@
Imports System.Net ' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports System.Net
Imports SCrawler.API.Reddit.M3U8_Declarations Imports SCrawler.API.Reddit.M3U8_Declarations
Imports PersonalUtilities.Tools.WEB Imports PersonalUtilities.Tools.WEB
Namespace API.Reddit.M3U8_Declarations Namespace API.Reddit.M3U8_Declarations

View File

@@ -1,4 +1,12 @@
Imports PersonalUtilities.Functions.XML ' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports PersonalUtilities.Functions.XML
Imports PersonalUtilities.Forms.Toolbars Imports PersonalUtilities.Forms.Toolbars
Imports PersonalUtilities.Tools.ImageRenderer Imports PersonalUtilities.Tools.ImageRenderer
Imports PersonalUtilities.Tools.WebDocuments.JSON Imports PersonalUtilities.Tools.WebDocuments.JSON
@@ -54,6 +62,8 @@ Namespace API.Reddit
#Region "Initializers" #Region "Initializers"
''' <summary>Video downloader initializer</summary> ''' <summary>Video downloader initializer</summary>
Private Sub New() Private Sub New()
ChannelPostsNames = New List(Of String)
_ExistsUsersNames = New List(Of String)
End Sub End Sub
''' <summary>Default initializer</summary> ''' <summary>Default initializer</summary>
Friend Sub New(ByVal u As UserInfo, Optional ByVal _LoadUserInformation As Boolean = True, Optional ByVal InvokeImageHandler As Boolean = True) Friend Sub New(ByVal u As UserInfo, Optional ByVal _LoadUserInformation As Boolean = True, Optional ByVal InvokeImageHandler As Boolean = True)
@@ -66,7 +76,10 @@ Namespace API.Reddit
#End Region #End Region
#Region "Download Overrides" #Region "Download Overrides"
Friend Overrides Sub DownloadData(ByVal Token As CancellationToken) Friend Overrides Sub DownloadData(ByVal Token As CancellationToken)
If IsChannel Then If IsChannel AndAlso Not ChannelInfo.IsRegularChannel Then
If Not Responser Is Nothing Then Responser.Dispose()
Responser = New PersonalUtilities.Tools.WEB.Response
Responser.Copy(Settings.Site(Sites.Reddit).Responser)
ChannelPostsNames.ListAddList(ChannelInfo.PostsAll.Select(Function(p) p.ID), LNC) ChannelPostsNames.ListAddList(ChannelInfo.PostsAll.Select(Function(p) p.ID), LNC)
If SkipExistsUsers Then _ExistsUsersNames.ListAddList(Settings.UsersList.Select(Function(p) p.Name), LNC) If SkipExistsUsers Then _ExistsUsersNames.ListAddList(Settings.UsersList.Select(Function(p) p.Name), LNC)
DownloadDataF(Token) DownloadDataF(Token)
@@ -80,7 +93,18 @@ Namespace API.Reddit
Protected Overrides Sub DownloadDataF(ByVal Token As CancellationToken) Protected Overrides Sub DownloadDataF(ByVal Token As CancellationToken)
_TotalPostsDownloaded = 0 _TotalPostsDownloaded = 0
If IsChannel Then If IsChannel Then
If ChannelInfo.IsRegularChannel Then
ChannelPostsNames.ListAddList(_TempPostsList, LNC)
If ChannelPostsNames.Count > 0 Then
DownloadLimitCount = Nothing
With _ContentList.Where(Function(c) c.Post.Date.HasValue)
If .Count > 0 Then DownloadLimitDate = .Max(Function(p) p.Post.Date.Value).AddMinutes(-10)
End With
End If
If DownloadTopCount.HasValue Then DownloadLimitCount = DownloadTopCount
End If
DownloadDataChannel(String.Empty, Token) DownloadDataChannel(String.Empty, Token)
If ChannelInfo.IsRegularChannel Then _TempPostsList.ListAddList(_TempMediaList.Select(Function(m) m.Post.ID), LNC)
Else Else
DownloadDataUser(String.Empty, Token) DownloadDataUser(String.Empty, Token)
End If End If
@@ -107,7 +131,7 @@ Namespace API.Reddit
ThrowAny(Token) ThrowAny(Token)
Dim r$ = GetSiteResponse(URL) Dim r$ = GetSiteResponse(URL)
If Not r.IsEmptyString Then If Not r.IsEmptyString Then
Using w As EContainer = JsonDocument.Parse(r) Using w As EContainer = JsonDocument.Parse(r).XmlIfNothing
If w.Count > 0 Then If w.Count > 0 Then
n = w.GetNode(JsonNodesJson) n = w.GetNode(JsonNodesJson)
If Not n Is Nothing AndAlso n.Count > 0 Then If Not n Is Nothing AndAlso n.Count > 0 Then
@@ -124,29 +148,31 @@ Namespace API.Reddit
ExistsDetected = True ExistsDetected = True
Continue For Continue For
End If End If
If CheckNode(nn) Then If CheckNode(nn) Then
_ItemsBefore = _TempMediaList.Count _ItemsBefore = _TempMediaList.Count
added = True added = True
s = nn.ItemF({"source", "url"}) s = nn.ItemF({"source", "url"})
If s.XmlIfNothingValue("/").Contains("redgifs.com") Then If s.XmlIfNothingValue("/").Contains("redgifs.com") Then
_TempMediaList.ListAddValue(MediaFromData(UTypes.VideoPre, s.Value, PostID, PostDate,, IsChannel), LNC) _TempMediaList.ListAddValue(MediaFromData(UTypes.VideoPre, s.Value, PostID, PostDate,, IsChannel), LNC)
_TotalPostsDownloaded += 1 ElseIf Not CreateImgurMedia(s.XmlIfNothingValue, PostID, PostDate,, IsChannel) Then
Else
s = nn.ItemF({"media"}).XmlIfNothing s = nn.ItemF({"media"}).XmlIfNothing
__ItemType = s("type").XmlIfNothingValue __ItemType = s("type").XmlIfNothingValue
Select Case __ItemType Select Case __ItemType
Case "gallery" : DownloadGallery(s, PostID, PostDate) : _TotalPostsDownloaded += 1 Case "gallery" : If Not DownloadGallery(s, PostID, PostDate) Then added = False
Case "image", "gifvideo" Case "image", "gifvideo"
If s.Contains("content") Then If s.Contains("content") Then
_TempMediaList.ListAddValue(MediaFromData(UPicType(__ItemType), s.Value("content"), _TempMediaList.ListAddValue(MediaFromData(UPicType(__ItemType), s.Value("content"),
PostID, PostDate,, IsChannel), LNC) PostID, PostDate,, IsChannel), LNC)
_TotalPostsDownloaded += 1 Else
added = False
End If End If
Case "video" Case "video"
If Settings.UseM3U8 AndAlso s("hlsUrl").XmlIfNothingValue("/").ToLower.Contains("m3u8") Then If Settings.UseM3U8 AndAlso s("hlsUrl").XmlIfNothingValue("/").ToLower.Contains("m3u8") Then
_TempMediaList.ListAddValue(MediaFromData(UTypes.m3u8, s.Value("hlsUrl"), _TempMediaList.ListAddValue(MediaFromData(UTypes.m3u8, s.Value("hlsUrl"),
PostID, PostDate,, IsChannel), LNC) PostID, PostDate,, IsChannel), LNC)
_TotalPostsDownloaded += 1 Else
added = False
End If End If
Case Else : added = False Case Else : added = False
End Select End Select
@@ -165,7 +191,6 @@ Namespace API.Reddit
End With End With
If Not tmpType = UTypes.Undefined Then If Not tmpType = UTypes.Undefined Then
_TempMediaList.ListAddValue(MediaFromData(tmpType, s.Value, PostID, PostDate,, IsChannel), LNC) _TempMediaList.ListAddValue(MediaFromData(tmpType, s.Value, PostID, PostDate,, IsChannel), LNC)
_TotalPostsDownloaded += 1
End If End If
End If End If
End If End If
@@ -181,8 +206,14 @@ Namespace API.Reddit
Catch oex As OperationCanceledException When Token.IsCancellationRequested Catch oex As OperationCanceledException When Token.IsCancellationRequested
Catch dex As ObjectDisposedException When Disposed Catch dex As ObjectDisposedException When Disposed
Catch ex As Exception Catch ex As Exception
If ex.HelpLink = NonExistendUserHelp Then
UserExists = False
ElseIf ex.HelpLink = SuspendedUserHelp Then
UserSuspended = True
Else
LogError(ex, $"data downloading error [{URL}]") LogError(ex, $"data downloading error [{URL}]")
HasError = True HasError = True
End If
End Try End Try
End Sub End Sub
Private Sub DownloadDataChannel(ByVal POST As String, ByVal Token As CancellationToken) Private Sub DownloadDataChannel(ByVal POST As String, ByVal Token As CancellationToken)
@@ -240,6 +271,8 @@ Namespace API.Reddit
_TempMediaList.ListAddValue(MediaFromData(UTypes.VideoPre, tmpUrl, PostID, PostDate, _UserID, IsChannel), LNC) _TempMediaList.ListAddValue(MediaFromData(UTypes.VideoPre, tmpUrl, PostID, PostDate, _UserID, IsChannel), LNC)
_TotalPostsDownloaded += 1 _TotalPostsDownloaded += 1
End If End If
ElseIf CreateImgurMedia(tmpUrl, PostID, PostDate, _UserID, IsChannel) Then
_TotalPostsDownloaded += 1
ElseIf s.Item("media_metadata").XmlIfNothing.Count > 0 Then ElseIf s.Item("media_metadata").XmlIfNothing.Count > 0 Then
DownloadGallery(s, PostID, PostDate, _UserID, SaveToCache) DownloadGallery(s, PostID, PostDate, _UserID, SaveToCache)
_TotalPostsDownloaded += 1 _TotalPostsDownloaded += 1
@@ -261,15 +294,59 @@ Namespace API.Reddit
Catch oex As OperationCanceledException When Token.IsCancellationRequested Catch oex As OperationCanceledException When Token.IsCancellationRequested
Catch dex As ObjectDisposedException When Disposed Catch dex As ObjectDisposedException When Disposed
Catch ex As Exception Catch ex As Exception
If ex.HelpLink = NonExistendUserHelp Then
UserExists = False
ElseIf ex.HelpLink = SuspendedUserHelp Then
UserSuspended = True
Else
LogError(ex, $"channel data downloading error [{URL}]") LogError(ex, $"channel data downloading error [{URL}]")
HasError = True HasError = True
End If
End Try End Try
End Sub End Sub
#End Region #End Region
#Region "Download Base Functions" #Region "Download Base Functions"
Private Sub DownloadGallery(ByVal w As EContainer, ByVal PostID As String, ByVal PostDate As String, Private Function ImgurPicture(ByVal Source As EContainer, ByVal Value As String) As String
Optional ByVal _UserID As String = Nothing, Optional ByVal FirstOnly As Boolean = False)
Try Try
Dim e As EContainer = Source({"source", "url"}).XmlIfNothing
If Not e.IsEmptyString AndAlso e.Value.ToLower.Contains("imgur") Then
Return e.Value
Else
Return Value
End If
Catch ex As Exception
LogError(ex, "[ImgurPicture]")
Return Value
End Try
End Function
Private Function CreateImgurMedia(ByVal _URL As String, ByVal PostID As String, ByVal PostDate As String,
Optional ByVal _UserID As String = "", Optional ByVal IsChannel As Boolean = False) As Boolean
If Not _URL.IsEmptyString AndAlso _URL.Contains("imgur") Then
If _URL.StringContains({".jpg", ".png", ".jpeg"}) Then
_TempMediaList.ListAddValue(MediaFromData(UTypes.Picture, _URL, PostID, PostDate, _UserID, IsChannel), LNC)
ElseIf _URL.Contains(".gifv") Then
If SaveToCache Then
_TempMediaList.ListAddValue(MediaFromData(UTypes.Picture, _URL.Replace(".gifv", ".gif"),
PostID, PostDate, _UserID, IsChannel), LNC)
Else
_TempMediaList.ListAddValue(MediaFromData(UTypes.Video, _URL.Replace(".gifv", ".mp4"),
PostID, PostDate, _UserID, IsChannel), LNC)
End If
ElseIf _URL.Contains(".gif") Then
_TempMediaList.ListAddValue(MediaFromData(UTypes.GIF, _URL, PostID, PostDate, _UserID, IsChannel), LNC)
Else
If Not TryFile(_URL) Then _URL &= ".jpg"
_TempMediaList.ListAddValue(MediaFromData(UTypes.Picture, _URL, PostID, PostDate, _UserID, IsChannel), LNC)
End If
Return True
Else
Return False
End If
End Function
Private Function DownloadGallery(ByVal w As EContainer, ByVal PostID As String, ByVal PostDate As String,
Optional ByVal _UserID As String = Nothing, Optional ByVal FirstOnly As Boolean = False) As Boolean
Try
Dim added As Boolean = False
Dim cn$ = IIf(IsChannel, "media_metadata", "mediaMetadata") Dim cn$ = IIf(IsChannel, "media_metadata", "mediaMetadata")
If Not w Is Nothing AndAlso w(cn).XmlIfNothing.Count > 0 Then If Not w Is Nothing AndAlso w(cn).XmlIfNothing.Count > 0 Then
Dim t As EContainer Dim t As EContainer
@@ -277,15 +354,18 @@ Namespace API.Reddit
t = n.ItemF({"s", "u"}) t = n.ItemF({"s", "u"})
If Not t Is Nothing AndAlso Not t.Value.IsEmptyString Then If Not t Is Nothing AndAlso Not t.Value.IsEmptyString Then
_TempMediaList.ListAddValue(MediaFromData(UTypes.Picture, t.Value, PostID, PostDate, _UserID, IsChannel), LNC) _TempMediaList.ListAddValue(MediaFromData(UTypes.Picture, t.Value, PostID, PostDate, _UserID, IsChannel), LNC)
added = True
If FirstOnly Then Exit For If FirstOnly Then Exit For
End If End If
Next Next
End If End If
Return added
Catch ex As Exception Catch ex As Exception
LogError(ex, "gallery parsing error") LogError(ex, "gallery parsing error")
HasError = True HasError = True
Return False
End Try End Try
End Sub End Function
Protected Overrides Sub ReparseVideo(ByVal Token As CancellationToken) Protected Overrides Sub ReparseVideo(ByVal Token As CancellationToken)
Try Try
ThrowAny(Token) ThrowAny(Token)
@@ -321,6 +401,8 @@ Namespace API.Reddit
If Not URL.IsEmptyString AndAlso URL.Contains("redgifs") Then If Not URL.IsEmptyString AndAlso URL.Contains("redgifs") Then
Using r As New UserData Using r As New UserData
r._TempMediaList.Add(MediaFromData(UTypes.VideoPre, URL, String.Empty, String.Empty,, False)) r._TempMediaList.Add(MediaFromData(UTypes.VideoPre, URL, String.Empty, String.Empty,, False))
r.Responser = New PersonalUtilities.Tools.WEB.Response
r.Responser.Copy(Settings.Site(Sites.Reddit).Responser)
r.ReparseVideo(Nothing) r.ReparseVideo(Nothing)
If r._TempMediaList.ListExists Then Return r._TempMediaList(0) If r._TempMediaList.ListExists Then Return r._TempMediaList(0)
End Using End Using
@@ -344,7 +426,7 @@ Namespace API.Reddit
End Function End Function
Private Function TryFile(ByVal URL As String) As Boolean Private Function TryFile(ByVal URL As String) As Boolean
Try Try
If Not URL.IsEmptyString AndAlso URL.Contains(".jpg") Then If Not URL.IsEmptyString AndAlso URL.StringContains({".jpg", ".png", ".jpeg"}) Then
Dim f As SFile = CStr(RegexReplace(URL, FilesPattern)) Dim f As SFile = CStr(RegexReplace(URL, FilesPattern))
Return Not f.IsEmptyString And Not f.File.IsEmptyString Return Not f.IsEmptyString And Not f.File.IsEmptyString
End If End If
@@ -379,6 +461,7 @@ Namespace API.Reddit
Dim cached As Boolean = IsChannel And SaveToCache Dim cached As Boolean = IsChannel And SaveToCache
Dim vsf As Boolean = SeparateVideoFolderF Dim vsf As Boolean = SeparateVideoFolderF
Dim ImgFormat As Imaging.ImageFormat Dim ImgFormat As Imaging.ImageFormat
Dim UseMD5 As Boolean = Not IsChannel Or (Not cached And Settings.ChannelsRegularCheckMD5)
Dim bDP As New ErrorsDescriber(EDP.None) Dim bDP As New ErrorsDescriber(EDP.None)
Dim MD5BS As Func(Of String, UTypes, Dim MD5BS As Func(Of String, UTypes,
SFile, Boolean, String) = Function(ByVal __URL As String, ByVal __MT As UTypes, SFile, Boolean, String) = Function(ByVal __URL As String, ByVal __MT As UTypes,
@@ -411,7 +494,7 @@ Namespace API.Reddit
End If End If
f.Separator = "\" f.Separator = "\"
m = String.Empty m = String.Empty
If (v.Type = UTypes.Picture Or v.Type = UTypes.GIF) And Not cached Then If (v.Type = UTypes.Picture Or v.Type = UTypes.GIF) And UseMD5 Then
m = MD5BS(v.URL, v.Type, f, False) m = MD5BS(v.URL, v.Type, f, False)
If m.IsEmptyString AndAlso Not v.URL_BASE.IsEmptyString AndAlso Not v.URL_BASE = v.URL Then If m.IsEmptyString AndAlso Not v.URL_BASE.IsEmptyString AndAlso Not v.URL_BASE = v.URL Then
m = MD5BS(v.URL_BASE, v.Type, f, True) m = MD5BS(v.URL_BASE, v.Type, f, True)
@@ -420,7 +503,7 @@ Namespace API.Reddit
End If End If
If (Not m.IsEmptyString AndAlso Not HashList.Contains(m)) Or Not (v.Type = UTypes.Picture Or If (Not m.IsEmptyString AndAlso Not HashList.Contains(m)) Or Not (v.Type = UTypes.Picture Or
v.Type = UTypes.GIF) Or cached Then v.Type = UTypes.GIF) Or Not UseMD5 Then
If Not cached Then HashList.Add(m) If Not cached Then HashList.Add(m)
v.MD5 = m v.MD5 = m
f.Path = MyDir f.Path = MyDir
@@ -436,7 +519,11 @@ Namespace API.Reddit
Case UTypes.Picture : DownloadedPictures += 1 : _CountPictures += 1 Case UTypes.Picture : DownloadedPictures += 1 : _CountPictures += 1
Case UTypes.Video, UTypes.m3u8 : DownloadedVideos += 1 : _CountVideo += 1 Case UTypes.Video, UTypes.m3u8 : DownloadedVideos += 1 : _CountVideo += 1
End Select End Select
If Not IsChannel Or Not SaveToCache Then
v.File = ChangeFileNameByProvider(f, v)
Else
v.File = f v.File = f
End If
v.Post.CachedFile = f v.Post.CachedFile = f
v.State = UStates.Downloaded v.State = UStates.Downloaded
dCount += 1 dCount += 1
@@ -469,15 +556,20 @@ Namespace API.Reddit
End Sub End Sub
Protected Function GetSiteResponse(ByVal URL As String, Optional ByVal e As ErrorsDescriber = Nothing) As String Protected Function GetSiteResponse(ByVal URL As String, Optional ByVal e As ErrorsDescriber = Nothing) As String
Try Try
Return Settings.Site(Sites.Reddit).Responser.GetResponse(URL,, EDP.ThrowException) Return Responser.GetResponse(URL,, EDP.ThrowException)
Catch ex As Exception Catch ex As Exception
HasError = True HasError = True
Dim OptText$ = String.Empty Dim OptText$ = String.Empty
If Not e.Exists Then If Not e.Exists Then
Dim ee As EDP = EDP.SendInLog Dim ee As EDP = EDP.SendInLog
If Settings.Site(Sites.Reddit).Responser.StatusCode = HttpStatusCode.NotFound Then If Responser.StatusCode = HttpStatusCode.NotFound Then
ee += EDP.ThrowException ee = EDP.ThrowException
OptText = ": USER NOT FOUND" OptText = ": USER NOT FOUND"
ex.HelpLink = NonExistendUserHelp
ElseIf Responser.StatusCode = HttpStatusCode.Forbidden Then
ee = EDP.ThrowException
OptText = ": USER PROFILE SUSPENDED"
ex.HelpLink = SuspendedUserHelp
Else Else
ee += EDP.ReturnValue ee += EDP.ReturnValue
End If End If

View File

@@ -1,4 +1,12 @@
Imports PersonalUtilities.Functions.XML.Base ' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports PersonalUtilities.Functions.XML.Base
Namespace API.Twitter Namespace API.Twitter
Friend Module Declarations Friend Module Declarations
Friend DateProvider As New ADateTime(ADateTime.Formats.BaseDateTime) Friend DateProvider As New ADateTime(ADateTime.Formats.BaseDateTime)

View File

@@ -1,4 +1,13 @@
Imports PersonalUtilities.Tools.WebDocuments.JSON ' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports PersonalUtilities.Tools.WEB
Imports PersonalUtilities.Tools.WebDocuments.JSON
Imports PersonalUtilities.Functions.XML Imports PersonalUtilities.Functions.XML
Imports System.Net Imports System.Net
Imports System.Threading Imports System.Threading
@@ -59,7 +68,7 @@ Namespace API.Twitter
If Not POST.IsEmptyString Then URL &= $"&max_id={POST}" If Not POST.IsEmptyString Then URL &= $"&max_id={POST}"
ThrowAny(Token) ThrowAny(Token)
Dim r$ = Settings.Site(Sites.Twitter).Responser.GetResponse(URL,, EDP.ThrowException) Dim r$ = Responser.GetResponse(URL,, EDP.ThrowException)
If Not r.IsEmptyString Then If Not r.IsEmptyString Then
Using w As EContainer = JsonDocument.Parse(r) Using w As EContainer = JsonDocument.Parse(r)
If Not w Is Nothing AndAlso w.Count > 0 Then If Not w Is Nothing AndAlso w.Count > 0 Then
@@ -109,8 +118,16 @@ Namespace API.Twitter
Catch oex As OperationCanceledException When Token.IsCancellationRequested Catch oex As OperationCanceledException When Token.IsCancellationRequested
Catch dex As ObjectDisposedException When Disposed Catch dex As ObjectDisposedException When Disposed
Catch ex As Exception Catch ex As Exception
If Responser.StatusCode = HttpStatusCode.NotFound Then
UserExists = False
ElseIf Responser.StatusCode = HttpStatusCode.Unauthorized Then
UserSuspended = True
ElseIf Responser.StatusCode = HttpStatusCode.BadRequest Then
MyMainLOG = "Twitter has invalid credentials"
Else
LogError(ex, $"data downloading error [{URL}]") LogError(ex, $"data downloading error [{URL}]")
HasError = True HasError = True
End If
End Try End Try
End Sub End Sub
Friend Shared Function GetVideoInfo(ByVal URL As String) As UserMedia Friend Shared Function GetVideoInfo(ByVal URL As String) As UserMedia
@@ -118,8 +135,8 @@ Namespace API.Twitter
If URL.Contains("twitter") Then If URL.Contains("twitter") Then
Dim PostID$ = RegexReplace(URL, New RegexStructure("(?<=/)\d+", True, False,,,,, String.Empty)) Dim PostID$ = RegexReplace(URL, New RegexStructure("(?<=/)\d+", True, False,,,,, String.Empty))
If Not PostID.IsEmptyString Then If Not PostID.IsEmptyString Then
Dim r$ = Settings.Site(Sites.Twitter).Responser.GetResponse($"https://api.twitter.com/1.1/statuses/show.json?id={PostID}",, Dim r$ = DirectCast(Settings.Site(Sites.Twitter).Responser.Copy(), Response).
EDP.ReturnValue) GetResponse($"https://api.twitter.com/1.1/statuses/show.json?id={PostID}",, EDP.ReturnValue)
If Not r.IsEmptyString Then If Not r.IsEmptyString Then
Using j As EContainer = JsonDocument.Parse(r) Using j As EContainer = JsonDocument.Parse(r)
If j.ListExists Then If j.ListExists Then
@@ -241,7 +258,7 @@ Namespace API.Twitter
Case "mp4" : v.Type = UserMedia.Types.Video : DownloadedVideos += 1 : _CountVideo += 1 Case "mp4" : v.Type = UserMedia.Types.Video : DownloadedVideos += 1 : _CountVideo += 1
Case Else : v.Type = UserMedia.Types.Picture : DownloadedPictures += 1 : _CountPictures += 1 Case Else : v.Type = UserMedia.Types.Picture : DownloadedPictures += 1 : _CountPictures += 1
End Select End Select
v.File = f v.File = ChangeFileNameByProvider(f, v)
v.State = UStates.Downloaded v.State = UStates.Downloaded
Catch wex As Exception Catch wex As Exception
ErrorDownloading(f, v.URL_BASE) ErrorDownloading(f, v.URL_BASE)

View File

@@ -1,4 +1,12 @@
Imports PersonalUtilities.Tools ' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports PersonalUtilities.Tools
Imports System.Threading Imports System.Threading
Imports SCrawler.API.Base Imports SCrawler.API.Base
Namespace API Namespace API
@@ -28,6 +36,20 @@ Namespace API
CollectionName = NewCollectionName CollectionName = NewCollectionName
End Set End Set
End Property End Property
Friend Overrides Property UserExists As Boolean
Get
Return Count > 0 AndAlso Collections.Exists(Function(c) c.Exists)
End Get
Set(ByVal e As Boolean)
End Set
End Property
Friend Overrides Property UserSuspended As Boolean
Get
Return Count > 0 AndAlso Collections.LongCount(Function(c) c.Suspended) = Count
End Get
Set(ByVal s As Boolean)
End Set
End Property
Friend Overrides Sub ChangeCollectionName(ByVal NewName As String, ByVal UpdateSettings As Boolean) Friend Overrides Sub ChangeCollectionName(ByVal NewName As String, ByVal UpdateSettings As Boolean)
_CollectionName = NewName _CollectionName = NewName
If Count > 0 Then Collections.ForEach(Sub(c) c.CollectionName = NewName) If Count > 0 Then Collections.ForEach(Sub(c) c.CollectionName = NewName)
@@ -98,7 +120,7 @@ Namespace API
Friend Overrides Property DataMerging As Boolean Friend Overrides Property DataMerging As Boolean
Get Get
If Count > 0 Then If Count > 0 Then
Return DirectCast(Collections(0), UserDataBase).DataMerging Return DirectCast(Collections(0).Self, UserDataBase).DataMerging
Else Else
Return False Return False
End If End If
@@ -142,6 +164,14 @@ Namespace API
UpdateUserInformation() UpdateUserInformation()
End Set End Set
End Property End Property
Friend Overrides Property ReadyForDownload As Boolean
Get
Return Count > 0 AndAlso Collections(0).ReadyForDownload
End Get
Set(ByVal IsReady As Boolean)
If Count > 0 Then Collections.ForEach(Sub(c) c.ReadyForDownload = IsReady)
End Set
End Property
Friend Overrides ReadOnly Property Labels As List(Of String) Friend Overrides ReadOnly Property Labels As List(Of String)
Get Get
If Count > 0 Then If Count > 0 Then
@@ -153,15 +183,15 @@ Namespace API
End Property End Property
Friend Overrides Function GetUserInformation() As String Friend Overrides Function GetUserInformation() As String
Dim OutStr$ = String.Empty Dim OutStr$ = String.Empty
If Count > 0 Then Collections.ForEach(Sub(c) OutStr.StringAppendLine(DirectCast(c, UserDataBase).GetUserInformation(), $"{vbCrLf}{vbCrLf}")) If Count > 0 Then Collections.ForEach(Sub(c) OutStr.StringAppendLine(DirectCast(c.Self, UserDataBase).GetUserInformation(), $"{vbCrLf}{vbCrLf}"))
Return OutStr Return OutStr
End Function End Function
Friend Overrides Property LastUpdated As Date? Friend Overrides Property LastUpdated As Date?
Get Get
If Count > 0 Then If Count > 0 Then
With If((From c In Collections With If((From c In Collections
Where DirectCast(c, UserDataBase).LastUpdated.HasValue Where DirectCast(c.Self, UserDataBase).LastUpdated.HasValue
Select DirectCast(c, UserDataBase).LastUpdated.Value).ToList, New List(Of Date)) Select DirectCast(c.Self, UserDataBase).LastUpdated.Value).ToList, New List(Of Date))
If .Count > 0 Then Return .Max If .Count > 0 Then Return .Max
End With End With
End If End If
@@ -179,7 +209,7 @@ Namespace API
Friend ReadOnly Property ContextDown As ToolStripMenuItem() Friend ReadOnly Property ContextDown As ToolStripMenuItem()
Get Get
If Count > 0 Then If Count > 0 Then
Return Collections.Select(Function(c) DirectCast(c, UserDataBase).BTT_CONTEXT_DOWN).ToArray Return Collections.Select(Function(c) DirectCast(c.Self, UserDataBase).BTT_CONTEXT_DOWN).ToArray
Else Else
Return New ToolStripMenuItem() {} Return New ToolStripMenuItem() {}
End If End If
@@ -188,7 +218,7 @@ Namespace API
Friend ReadOnly Property ContextEdit As ToolStripMenuItem() Friend ReadOnly Property ContextEdit As ToolStripMenuItem()
Get Get
If Count > 0 Then If Count > 0 Then
Return Collections.Select(Function(c) DirectCast(c, UserDataBase).BTT_CONTEXT_EDIT).ToArray Return Collections.Select(Function(c) DirectCast(c.Self, UserDataBase).BTT_CONTEXT_EDIT).ToArray
Else Else
Return New ToolStripMenuItem() {} Return New ToolStripMenuItem() {}
End If End If
@@ -197,7 +227,7 @@ Namespace API
Friend ReadOnly Property ContextDelete As ToolStripMenuItem() Friend ReadOnly Property ContextDelete As ToolStripMenuItem()
Get Get
If Count > 0 Then If Count > 0 Then
Return Collections.Select(Function(c) DirectCast(c, UserDataBase).BTT_CONTEXT_DELETE).ToArray Return Collections.Select(Function(c) DirectCast(c.Self, UserDataBase).BTT_CONTEXT_DELETE).ToArray
Else Else
Return New ToolStripMenuItem() {} Return New ToolStripMenuItem() {}
End If End If
@@ -206,7 +236,7 @@ Namespace API
Friend ReadOnly Property ContextPath As ToolStripMenuItem() Friend ReadOnly Property ContextPath As ToolStripMenuItem()
Get Get
If Count > 0 Then If Count > 0 Then
Return Collections.Select(Function(c) DirectCast(c, UserDataBase).BTT_CONTEXT_OPEN_PATH).ToArray Return Collections.Select(Function(c) DirectCast(c.Self, UserDataBase).BTT_CONTEXT_OPEN_PATH).ToArray
Else Else
Return New ToolStripMenuItem() {} Return New ToolStripMenuItem() {}
End If End If
@@ -215,7 +245,7 @@ Namespace API
Friend ReadOnly Property ContextSite As ToolStripMenuItem() Friend ReadOnly Property ContextSite As ToolStripMenuItem()
Get Get
If Count > 0 Then If Count > 0 Then
Return Collections.Select(Function(c) DirectCast(c, UserDataBase).BTT_CONTEXT_OPEN_SITE).ToArray Return Collections.Select(Function(c) DirectCast(c.Self, UserDataBase).BTT_CONTEXT_OPEN_SITE).ToArray
Else Else
Return New ToolStripMenuItem() {} Return New ToolStripMenuItem() {}
End If End If
@@ -239,7 +269,7 @@ Namespace API
If Count > 0 Then Collections.ForEach(Sub(c) c.UpdateUserInformation()) If Count > 0 Then Collections.ForEach(Sub(c) c.UpdateUserInformation())
End Sub End Sub
Friend Overrides Sub LoadContentInformation() Friend Overrides Sub LoadContentInformation()
If Count > 0 Then Collections.ForEach(Sub(c) DirectCast(c, UserDataBase).LoadContentInformation()) If Count > 0 Then Collections.ForEach(Sub(c) DirectCast(c.Self, UserDataBase).LoadContentInformation())
End Sub End Sub
Friend Overrides Property DownloadTopCount As Integer? Friend Overrides Property DownloadTopCount As Integer?
Get Get
@@ -262,8 +292,8 @@ Namespace API
End Sub End Sub
Protected Overrides Sub DownloadContent(ByVal Token As CancellationToken) Protected Overrides Sub DownloadContent(ByVal Token As CancellationToken)
End Sub End Sub
Private Sub User_OnPictureUpdated(ByVal User As IUserData) Private Sub User_OnUserUpdated(ByVal User As IUserData)
Raise_OnPictureUpdated() Raise_OnUserUpdated()
End Sub End Sub
Friend Overrides Sub OpenSite() Friend Overrides Sub OpenSite()
If Count > 0 Then Collections(0).OpenSite() If Count > 0 Then Collections(0).OpenSite()
@@ -288,8 +318,8 @@ Namespace API
''' <exception cref="InvalidOperationException"></exception> ''' <exception cref="InvalidOperationException"></exception>
Friend Overloads Sub Add(ByVal _Item As IUserData) Implements ICollection(Of IUserData).Add Friend Overloads Sub Add(ByVal _Item As IUserData) Implements ICollection(Of IUserData).Add
With _Item With _Item
Dim m As Boolean = DataMerging If .MoveFiles(CollectionName) Then
If .MoveFiles(CollectionName, m) Then If DataMerging Then DirectCast(.Self, UserDataBase).MergeData()
Collections.Add(_Item) Collections.Add(_Item)
With Collections.Last With Collections.Last
If Collections.Count - 1 > 0 Then If Collections.Count - 1 > 0 Then
@@ -298,7 +328,7 @@ Namespace API
.UpdateUserInformation() .UpdateUserInformation()
End If End If
ImageHandler(_Item, False) ImageHandler(_Item, False)
AddHandler .OnPictureUpdated, AddressOf User_OnPictureUpdated AddHandler .Self.OnUserUpdated, AddressOf User_OnUserUpdated
DirectCast(.Self, UserDataBase).CreateButtons(Count - 1) DirectCast(.Self, UserDataBase).CreateButtons(Count - 1)
End With End With
Else Else
@@ -313,18 +343,18 @@ Namespace API
Case Sites.Twitter : Collections.Add(New Twitter.UserData(u, _LoadData)) Case Sites.Twitter : Collections.Add(New Twitter.UserData(u, _LoadData))
Case Else : Exit Sub Case Else : Exit Sub
End Select End Select
With DirectCast(Collections(Count - 1), UserDataBase) With DirectCast(Collections.Last.Self, UserDataBase)
.CreateButtons(Count - 1) .CreateButtons(Count - 1)
AddHandler .BTT_CONTEXT_DELETE.Click, AddressOf BTT_CONTEXT_DELETE_Click AddHandler .BTT_CONTEXT_DELETE.Click, AddressOf BTT_CONTEXT_DELETE_Click
End With End With
AddHandler Collections(Count - 1).OnPictureUpdated, AddressOf User_OnPictureUpdated AddHandler Collections.Last.OnUserUpdated, AddressOf User_OnUserUpdated
End Sub End Sub
Friend Sub AddRange(ByVal _Items As IEnumerable(Of IUserData)) Friend Sub AddRange(ByVal _Items As IEnumerable(Of IUserData))
If Not _Items Is Nothing AndAlso _Items.Count > 0 Then If Not _Items Is Nothing AndAlso _Items.Count > 0 Then
For i% = 0 To _Items.Count - 1 : Add(_Items(i)) : Next For i% = 0 To _Items.Count - 1 : Add(_Items(i)) : Next
End If End If
End Sub End Sub
Friend Overrides Function MoveFiles(ByVal __CollectionName As String, ByVal _MergeData As Boolean) As Boolean Friend Overrides Function MoveFiles(ByVal __CollectionName As String) As Boolean
Throw New NotImplementedException("Files moving does not available if collection context") Throw New NotImplementedException("Files moving does not available if collection context")
End Function End Function
Friend Overloads Sub MergeData(ByVal Merging As Boolean) Friend Overloads Sub MergeData(ByVal Merging As Boolean)
@@ -334,7 +364,7 @@ Namespace API
MsgBoxE($"Collection [{CollectionName}] data already merged") MsgBoxE($"Collection [{CollectionName}] data already merged")
Else Else
If Collections.Count > 1 Then If Collections.Count > 1 Then
Collections.ForEach(Sub(c) DirectCast(c, UserDataBase).MergeData()) Collections.ForEach(Sub(c) DirectCast(c.Self, UserDataBase).MergeData())
MsgBoxE($"Collection [{CollectionName}] data merged") MsgBoxE($"Collection [{CollectionName}] data merged")
Else Else
MsgBoxE($"Collection [{CollectionName}] contains only one user profile" & vbCr & MsgBoxE($"Collection [{CollectionName}] contains only one user profile" & vbCr &
@@ -367,21 +397,24 @@ Namespace API
"Operation canceled", MsgBoxStyle.Critical) "Operation canceled", MsgBoxStyle.Critical)
Return False Return False
Else Else
DirectCast(_Item, UserDataBase).MoveFiles(String.Empty, False) DirectCast(_Item.Self, UserDataBase).MoveFiles(String.Empty)
ImageHandler(_Item) ImageHandler(_Item)
Return Collections.Remove(_Item) Return Collections.Remove(_Item)
End If End If
End Function End Function
Friend Overrides Function Delete() As Integer Friend Overrides Function Delete() As Integer
If Count > 0 Then If Count > 0 Then
Dim f As SFile
If MsgBoxE({$"Collection may contain data{vbCr}Do you really want to delete collection and all of it files?", "Collection deleting"}, If MsgBoxE({$"Collection may contain data{vbCr}Do you really want to delete collection and all of it files?", "Collection deleting"},
MsgBoxStyle.Exclamation + MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then MsgBoxStyle.Exclamation + MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
f = Collections(0).File.CutPath(2).PathWithSeparator
Settings.Users.Remove(Me) Settings.Users.Remove(Me)
Collections.ForEach(Sub(c) c.Delete()) Collections.ForEach(Sub(c) c.Delete())
Downloader.UserRemove(Me) Downloader.UserRemove(Me)
ImageHandler(Me, False) ImageHandler(Me, False)
Collections.ListClearDispose Collections.ListClearDispose
Dispose(False) Dispose(False)
If f.Exists(SFO.Path, False) Then f.Delete(SFO.Path, True, False, EDP.SendInLog)
Return 2 Return 2
Else Else
If DataMerging Then If DataMerging Then
@@ -390,10 +423,10 @@ Namespace API
End If End If
If MsgBoxE({$"Do you want to delete collection only?{vbCr}Users will not be deleted", "Collection deleting"}, If MsgBoxE({$"Do you want to delete collection only?{vbCr}Users will not be deleted", "Collection deleting"},
MsgBoxStyle.Question + MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then MsgBoxStyle.Question + MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
Dim f As SFile = Collections(0).File.CutPath(2) f = Collections(0).File.CutPath(2)
Settings.Users.Remove(Me) Settings.Users.Remove(Me)
Collections.ForEach(Sub(c) Collections.ForEach(Sub(c)
c.MoveFiles(String.Empty, False) c.MoveFiles(String.Empty)
ImageHandler(c) ImageHandler(c)
End Sub) End Sub)
Collections.Clear() Collections.Clear()

View File

@@ -1,4 +1,12 @@
Imports PersonalUtilities.Forms ' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports PersonalUtilities.Forms
Imports PersonalUtilities.Forms.Toolbars Imports PersonalUtilities.Forms.Toolbars
Imports PersonalUtilities.Forms.Controls Imports PersonalUtilities.Forms.Controls
Imports PersonalUtilities.Forms.Controls.Base Imports PersonalUtilities.Forms.Controls.Base
@@ -416,7 +424,11 @@ Friend Class ChannelViewForm : Implements IChannelLimits
If Not Settings.UsersList.Contains(.ElementAt(i)) Then If Not Settings.UsersList.Contains(.ElementAt(i)) Then
f = PendingUsers(i).File f = PendingUsers(i).File
Settings.UpdateUsersList(.ElementAt(i)) Settings.UpdateUsersList(.ElementAt(i))
Settings.Users.Add(New UserData(.ElementAt(i), False) With {.Temporary = True, .CreatedByChannel = True}) Settings.Users.Add(New UserData(.ElementAt(i), False) With {
.Temporary = Settings.ChannelsDefaultTemporary,
.CreatedByChannel = True,
.ReadyForDownload = Settings.ChannelsDefaultReadyForDownload
})
With Settings.Users.Last With Settings.Users.Last
.Labels.Add(CannelsLabelName) .Labels.Add(CannelsLabelName)
.UpdateUserInformation() .UpdateUserInformation()
@@ -560,6 +572,7 @@ Friend Class ChannelViewForm : Implements IChannelLimits
End Sub End Sub
Private Sub ChangeComboIndex(ByVal Appender As Integer) Private Sub ChangeComboIndex(ByVal Appender As Integer)
Try Try
AppendPendingUsers()
Dim _ComboUpEnabled As Boolean = False Dim _ComboUpEnabled As Boolean = False
Dim _ComboDownEnabled As Boolean = False Dim _ComboDownEnabled As Boolean = False
If CMB_CHANNELS.Count > 0 Then If CMB_CHANNELS.Count > 0 Then

View File

@@ -1,4 +1,12 @@
Imports System.ComponentModel ' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports System.ComponentModel
Imports PersonalUtilities.Forms Imports PersonalUtilities.Forms
Imports SCrawler.API.Base Imports SCrawler.API.Base
Friend Class DownloadedInfoForm Friend Class DownloadedInfoForm
@@ -54,8 +62,8 @@ Friend Class DownloadedInfoForm
End Sub End Sub
Private Class UsersDateOrder : Implements IComparer(Of IUserData) Private Class UsersDateOrder : Implements IComparer(Of IUserData)
Friend Function Compare(ByVal x As IUserData, ByVal y As IUserData) As Integer Implements IComparer(Of IUserData).Compare Friend Function Compare(ByVal x As IUserData, ByVal y As IUserData) As Integer Implements IComparer(Of IUserData).Compare
Dim xv& = If(DirectCast(x, UserDataBase).LastUpdated.HasValue, DirectCast(x, UserDataBase).LastUpdated.Value.Ticks, 0) Dim xv& = If(DirectCast(x.Self, UserDataBase).LastUpdated.HasValue, DirectCast(x.Self, UserDataBase).LastUpdated.Value.Ticks, 0)
Dim yv& = If(DirectCast(y, UserDataBase).LastUpdated.HasValue, DirectCast(y, UserDataBase).LastUpdated.Value.Ticks, 0) Dim yv& = If(DirectCast(y.Self, UserDataBase).LastUpdated.HasValue, DirectCast(y.Self, UserDataBase).LastUpdated.Value.Ticks, 0)
Return xv.CompareTo(yv) * -1 Return xv.CompareTo(yv) * -1
End Function End Function
End Class End Class
@@ -114,7 +122,7 @@ Friend Class DownloadedInfoForm
Private Sub LIST_DOWN_MouseDoubleClick(sender As Object, e As MouseEventArgs) Handles LIST_DOWN.MouseDoubleClick Private Sub LIST_DOWN_MouseDoubleClick(sender As Object, e As MouseEventArgs) Handles LIST_DOWN.MouseDoubleClick
Try Try
If _LatestSelected >= 0 AndAlso _LatestSelected <= _TempUsersList.Count - 1 AndAlso If _LatestSelected >= 0 AndAlso _LatestSelected <= _TempUsersList.Count - 1 AndAlso
Not DirectCast(_TempUsersList(_LatestSelected), UserDataBase).Disposed Then _TempUsersList(_LatestSelected).OpenFolder() Not DirectCast(_TempUsersList(_LatestSelected).Self, UserDataBase).Disposed Then _TempUsersList(_LatestSelected).OpenFolder()
Catch ex As Exception Catch ex As Exception
End Try End Try
End Sub End Sub

View File

@@ -1,4 +1,12 @@
Imports System.ComponentModel ' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports System.ComponentModel
Imports PersonalUtilities.Forms Imports PersonalUtilities.Forms
Imports PersonalUtilities.Forms.Controls.Base Imports PersonalUtilities.Forms.Controls.Base
Imports PersonalUtilities.Forms.Toolbars Imports PersonalUtilities.Forms.Toolbars

File diff suppressed because it is too large Load Diff

View File

@@ -117,7 +117,7 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="TP_MAIN.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="TP_BASIS.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value> <value>False</value>
</metadata> </metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
@@ -140,17 +140,9 @@
AFuc5QFgn6ClHh5iOQVAKNixyucB8NY0vG9JOzzyhrdq5IRgAAAAAElFTkSuQmCC AFuc5QFgn6ClHh5iOQVAKNixyucB8NY0vG9JOzzyhrdq5IRgAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<metadata name="TT_MAIN.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="TP_IMAGES.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value> <value>False</value>
</metadata> </metadata>
<metadata name="TT_MAIN.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="CH_SEPARATE_VIDEO_FOLDER.ToolTip" xml:space="preserve">
<value>This is global setting for new added only users.
This parameter indicates how video will be stored in users' download path.
If checked then videos will be stored in separated folder; otherwise, videos will be stored with pictures together.</value>
</data>
<data name="ActionButton3.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="ActionButton3.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
@@ -159,12 +151,6 @@ If checked then videos will be stored in separated folder; otherwise, videos wil
AFuc5QFgn6ClHh5iOQVAKNixyucB8NY0vG9JOzzyhrdq5IRgAAAAAElFTkSuQmCC AFuc5QFgn6ClHh5iOQVAKNixyucB8NY0vG9JOzzyhrdq5IRgAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<metadata name="TP_IMAGES.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="TP_CHANNELS_IMGS.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<data name="ActionButton4.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="ActionButton4.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
@@ -197,4 +183,57 @@ If checked then videos will be stored in separated folder; otherwise, videos wil
VnR1MIwhwMTCyqEQ37qEmZVDFF0OE/9nAACtFF4Ey6OP+wAAAABJRU5ErkJggg== VnR1MIwhwMTCyqEQ37qEmZVDFF0OE/9nAACtFF4Ey6OP+wAAAABJRU5ErkJggg==
</value> </value>
</data> </data>
<metadata name="TT_MAIN.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="TT_MAIN.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="CH_SEPARATE_VIDEO_FOLDER.ToolTip" xml:space="preserve">
<value>This is a global setting for newly added users only.
This parameter specifies how the video will be stored in the users' download path.
If checked, videos will be stored in separate folder; otherwise, videos will be stored along with images.</value>
</data>
<metadata name="TP_FILE_NAME.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="TP_FILE_PATTERNS.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="LBL_DATE_POS.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="TP_CHANNELS_IMGS.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="TAB_MAIN.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="TAB_BASIS.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="TAB_DEFAULTS.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="TP_DEFS.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="TAB_DEFS_CHANNELS.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="TP_CHANNELS.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="TAB_DEFS_REDDIT.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="TP_REDDIT.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="TAB_DEFS_TWITTER.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="TP_TWITTER.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root> </root>

View File

@@ -1,4 +1,12 @@
Imports PersonalUtilities.Forms ' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports PersonalUtilities.Forms
Imports PersonalUtilities.Forms.Controls.Base Imports PersonalUtilities.Forms.Controls.Base
Imports PersonalUtilities.Forms.Toolbars Imports PersonalUtilities.Forms.Toolbars
Namespace Editors Namespace Editors
@@ -15,20 +23,43 @@ Namespace Editors
.AddOkCancelToolbar() .AddOkCancelToolbar()
.DelegateClosingChecker() .DelegateClosingChecker()
With Settings With Settings
'Basis
TXT_GLOBAL_PATH.Text = .GlobalPath.Value TXT_GLOBAL_PATH.Text = .GlobalPath.Value
TXT_IMAGE_LARGE.Value = .MaxLargeImageHeigh.Value TXT_IMAGE_LARGE.Value = .MaxLargeImageHeigh.Value
TXT_IMAGE_SMALL.Value = .MaxSmallImageHeigh.Value TXT_IMAGE_SMALL.Value = .MaxSmallImageHeigh.Value
TXT_COLLECTIONS_PATH.Text = .CollectionsPath TXT_COLLECTIONS_PATH.Text = .CollectionsPath
TXT_MAX_JOBS_USERS.Value = .MaxUsersJobsCount.Value
TXT_MAX_JOBS_CHANNELS.Value = .ChannelsMaxJobsCount.Value
CH_CHECK_VER_START.Checked = .CheckUpdatesAtStart
'Defaults
CH_SEPARATE_VIDEO_FOLDER.Checked = .SeparateVideoFolder.Value CH_SEPARATE_VIDEO_FOLDER.Checked = .SeparateVideoFolder.Value
CH_DEF_TEMP.Checked = .DefaultTemporary.Value CH_DEF_TEMP.Checked = .DefaultTemporary
TXT_CHANNELS_COLUMNS.Value = .ChannelsImagesColumns.Value CH_DOWN_IMAGES.Checked = .DefaultDownloadImages
CH_DOWN_VIDEOS.Checked = .DefaultDownloadVideos
'Channels
TXT_CHANNELS_ROWS.Value = .ChannelsImagesRows.Value TXT_CHANNELS_ROWS.Value = .ChannelsImagesRows.Value
TXT_CHANNELS_COLUMNS.Value = .ChannelsImagesColumns.Value
TXT_CHANNEL_USER_POST_LIMIT.Value = .FromChannelDownloadTop.Value TXT_CHANNEL_USER_POST_LIMIT.Value = .FromChannelDownloadTop.Value
TXT_CHANNEL_USER_POST_LIMIT.Checked = .FromChannelDownloadTopUse.Value TXT_CHANNEL_USER_POST_LIMIT.Checked = .FromChannelDownloadTopUse.Value
CH_COPY_CHANNEL_USER_IMAGE.Checked = .FromChannelCopyImageToUser CH_COPY_CHANNEL_USER_IMAGE.Checked = .FromChannelCopyImageToUser
CH_CHECK_VER_START.Checked = .CheckUpdatesAtStart CH_CHANNELS_USERS_TEMP.Checked = .ChannelsDefaultTemporary
TXT_MAX_JOBS_USERS.Value = .MaxUsersJobsCount.Value 'Channels filenames
TXT_MAX_JOBS_CHANNELS.Value = .ChannelsMaxJobsCount.Value CH_FILE_NAME_CHANGE.Checked = .FileReplaceNameByDate Or .FileAddDateToFileName Or .FileAddTimeToFileName
OPT_FILE_NAME_REPLACE.Checked = .FileReplaceNameByDate
OPT_FILE_NAME_ADD_DATE.Checked = Not .FileReplaceNameByDate
CH_FILE_DATE.Checked = .FileAddDateToFileName
CH_FILE_TIME.Checked = .FileAddTimeToFileName
OPT_FILE_DATE_START.Checked = Not .FileDateTimePositionEnd
OPT_FILE_DATE_END.Checked = .FileDateTimePositionEnd
'Reddit
SetChecker(CH_REDDIT_TEMP, .RedditTemporary)
SetChecker(CH_REDDIT_DOWN_IMG, .RedditDownloadImages)
SetChecker(CH_REDDIT_DOWN_VID, .RedditDownloadVideos)
'Twitter
SetChecker(CH_TWITTER_TEMP, .TwitterTemporary)
SetChecker(CH_TWITTER_DOWN_IMG, .TwitterDownloadImages)
SetChecker(CH_TWITTER_DOWN_VID, .TwitterDownloadVideos)
CH_TWITTER_USER_MEDIA.Checked = .TwitterDefaultGetUserMedia
End With End With
.MyFieldsChecker = New FieldsChecker .MyFieldsChecker = New FieldsChecker
With .MyFieldsChecker With .MyFieldsChecker
@@ -38,11 +69,26 @@ Namespace Editors
End With End With
.AppendDetectors() .AppendDetectors()
.EndLoaderOperations() .EndLoaderOperations()
ChangeFileNameChangersEnabling()
End With End With
Catch ex As Exception Catch ex As Exception
MyDefs.InvokeLoaderError(ex) MyDefs.InvokeLoaderError(ex)
End Try End Try
End Sub End Sub
Private Sub SetChecker(ByRef CH As CheckBox, ByVal Prop As XML.Base.XMLValue(Of Boolean))
If Prop.ValueF.Exists Then
CH.Checked = Prop.Value
Else
CH.CheckState = CheckState.Indeterminate
End If
End Sub
Private Sub SetPropByChecker(ByRef Prop As XML.Base.XMLValue(Of Boolean), ByRef CH As CheckBox)
Select Case CH.CheckState
Case CheckState.Checked : Prop.Value = True
Case CheckState.Unchecked : Prop.Value = False
Case CheckState.Indeterminate : Prop.ValueF = Nothing
End Select
End Sub
Private Sub ToolbarBttOK() Implements IOkCancelToolbar.ToolbarBttOK Private Sub ToolbarBttOK() Implements IOkCancelToolbar.ToolbarBttOK
If MyDefs.MyFieldsChecker.AllParamsOK Then If MyDefs.MyFieldsChecker.AllParamsOK Then
With Settings With Settings
@@ -66,20 +112,55 @@ Namespace Editors
Case 2 : Exit Sub Case 2 : Exit Sub
End Select End Select
End If End If
If CH_FILE_NAME_CHANGE.Checked And (Not CH_FILE_DATE.Checked Or Not CH_FILE_TIME.Checked) Then
MsgBoxE({"You must select at least one option (Date and/or Time) if you want to change file names by date or disable file names changes",
"File name options"}, vbCritical)
Exit Sub
End If
.BeginUpdate() .BeginUpdate()
'Basis
.GlobalPath.Value = TXT_GLOBAL_PATH.Text .GlobalPath.Value = TXT_GLOBAL_PATH.Text
.MaxLargeImageHeigh.Value = CInt(TXT_IMAGE_LARGE.Value) .MaxLargeImageHeigh.Value = CInt(TXT_IMAGE_LARGE.Value)
.MaxSmallImageHeigh.Value = CInt(TXT_IMAGE_SMALL.Value) .MaxSmallImageHeigh.Value = CInt(TXT_IMAGE_SMALL.Value)
.SeparateVideoFolder.Value = CH_SEPARATE_VIDEO_FOLDER.Checked
.CollectionsPath.Value = TXT_COLLECTIONS_PATH.Text .CollectionsPath.Value = TXT_COLLECTIONS_PATH.Text
.MaxUsersJobsCount.Value = CInt(TXT_MAX_JOBS_USERS.Value)
.ChannelsMaxJobsCount.Value = TXT_MAX_JOBS_CHANNELS.Value
.CheckUpdatesAtStart.Value = CH_CHECK_VER_START.Checked
'Defaults
.SeparateVideoFolder.Value = CH_SEPARATE_VIDEO_FOLDER.Checked
.DefaultTemporary.Value = CH_DEF_TEMP.Checked .DefaultTemporary.Value = CH_DEF_TEMP.Checked
.DefaultDownloadImages.Value = CH_DOWN_IMAGES.Checked
.DefaultDownloadVideos.Value = CH_DOWN_VIDEOS.Checked
'Channels
.ChannelsImagesRows.Value = CInt(TXT_CHANNELS_ROWS.Value) .ChannelsImagesRows.Value = CInt(TXT_CHANNELS_ROWS.Value)
.ChannelsImagesColumns.Value = CInt(TXT_CHANNELS_COLUMNS.Value) .ChannelsImagesColumns.Value = CInt(TXT_CHANNELS_COLUMNS.Value)
.FromChannelDownloadTopUse.Value = TXT_CHANNEL_USER_POST_LIMIT.Checked
.FromChannelDownloadTop.Value = CInt(TXT_CHANNEL_USER_POST_LIMIT.Value) .FromChannelDownloadTop.Value = CInt(TXT_CHANNEL_USER_POST_LIMIT.Value)
.FromChannelDownloadTopUse.Value = TXT_CHANNEL_USER_POST_LIMIT.Checked
.FromChannelCopyImageToUser.Value = CH_COPY_CHANNEL_USER_IMAGE.Checked .FromChannelCopyImageToUser.Value = CH_COPY_CHANNEL_USER_IMAGE.Checked
.CheckUpdatesAtStart.Value = CH_CHECK_VER_START.Checked .ChannelsDefaultTemporary.Value = CH_CHANNELS_USERS_TEMP.Checked
.MaxUsersJobsCount.Value = CInt(TXT_MAX_JOBS_USERS.Value)
If CH_FILE_NAME_CHANGE.Checked Then
.FileReplaceNameByDate.Value = OPT_FILE_NAME_REPLACE.Checked
.FileAddDateToFileName.Value = CH_FILE_DATE.Checked
.FileAddTimeToFileName.Value = CH_FILE_TIME.Checked
.FileDateTimePositionEnd.Value = OPT_FILE_DATE_END.Checked
Else
.FileAddDateToFileName.Value = False
.FileAddTimeToFileName.Value = False
.FileReplaceNameByDate.Value = False
End If
'Reddit
SetPropByChecker(.RedditTemporary, CH_REDDIT_TEMP)
SetPropByChecker(.RedditDownloadImages, CH_REDDIT_DOWN_IMG)
SetPropByChecker(.RedditDownloadVideos, CH_REDDIT_DOWN_VID)
'Twitter
SetPropByChecker(.TwitterTemporary, CH_TWITTER_TEMP)
SetPropByChecker(.TwitterDownloadImages, CH_TWITTER_DOWN_IMG)
SetPropByChecker(.TwitterDownloadVideos, CH_TWITTER_DOWN_VID)
.TwitterDefaultGetUserMedia.Value = CH_TWITTER_USER_MEDIA.Checked
.EndUpdate() .EndUpdate()
End With End With
MyDefs.CloseForm() MyDefs.CloseForm()
@@ -100,5 +181,27 @@ Namespace Editors
Private Sub TXT_MAX_JOBS_CHANNELS_ActionOnButtonClick(ByVal Sender As ActionButton) Handles TXT_MAX_JOBS_CHANNELS.ActionOnButtonClick Private Sub TXT_MAX_JOBS_CHANNELS_ActionOnButtonClick(ByVal Sender As ActionButton) Handles TXT_MAX_JOBS_CHANNELS.ActionOnButtonClick
If Sender.DefaultButton = ActionButton.DefaultButtons.Refresh Then TXT_MAX_JOBS_CHANNELS.Value = SettingsCLS.DefaultMaxDownloadingTasks If Sender.DefaultButton = ActionButton.DefaultButtons.Refresh Then TXT_MAX_JOBS_CHANNELS.Value = SettingsCLS.DefaultMaxDownloadingTasks
End Sub End Sub
Private Sub CH_FILE_NAME_CHANGE_CheckedChanged(sender As Object, e As EventArgs)
ChangeFileNameChangersEnabling()
End Sub
Private Sub OPT_FILE_NAME_REPLACE_CheckedChanged(sender As Object, e As EventArgs)
ChangePositionControlsEnabling()
End Sub
Private Sub OPT_FILE_NAME_ADD_DATE_CheckedChanged(sender As Object, e As EventArgs)
ChangePositionControlsEnabling()
End Sub
Private Sub ChangePositionControlsEnabling()
Dim b As Boolean = OPT_FILE_NAME_ADD_DATE.Checked And OPT_FILE_NAME_ADD_DATE.Enabled
OPT_FILE_DATE_START.Enabled = b
OPT_FILE_DATE_END.Enabled = b
End Sub
Private Sub ChangeFileNameChangersEnabling()
Dim b As Boolean = CH_FILE_NAME_CHANGE.Checked
OPT_FILE_NAME_REPLACE.Enabled = b
OPT_FILE_NAME_ADD_DATE.Enabled = b
CH_FILE_DATE.Enabled = b
CH_FILE_TIME.Enabled = b
ChangePositionControlsEnabling()
End Sub
End Class End Class
End Namespace End Namespace

View File

@@ -1,4 +1,12 @@
Imports PersonalUtilities.Forms ' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports PersonalUtilities.Forms
Imports PersonalUtilities.Forms.Toolbars Imports PersonalUtilities.Forms.Toolbars
Imports PersonalUtilities.Forms.Controls Imports PersonalUtilities.Forms.Controls
Imports PersonalUtilities.Forms.Controls.Base Imports PersonalUtilities.Forms.Controls.Base

View File

@@ -1,4 +1,12 @@
Imports PersonalUtilities.Forms ' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports PersonalUtilities.Forms
Imports PersonalUtilities.Forms.Controls Imports PersonalUtilities.Forms.Controls
Imports PersonalUtilities.Forms.Controls.Base Imports PersonalUtilities.Forms.Controls.Base
Imports PersonalUtilities.Forms.Toolbars Imports PersonalUtilities.Forms.Toolbars

View File

@@ -1,4 +1,12 @@
Imports PersonalUtilities.Forms ' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports PersonalUtilities.Forms
Imports PersonalUtilities.Forms.Controls Imports PersonalUtilities.Forms.Controls
Imports PersonalUtilities.Forms.Controls.Base Imports PersonalUtilities.Forms.Controls.Base
Imports PersonalUtilities.Forms.Toolbars Imports PersonalUtilities.Forms.Toolbars

View File

@@ -23,10 +23,12 @@
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(UserCreatorForm)) Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(UserCreatorForm))
Dim ActionButton2 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton() Dim ActionButton2 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
Dim ActionButton3 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton() Dim ActionButton3 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
Dim TP_DOWN_OPTIONS As System.Windows.Forms.TableLayoutPanel
Dim TT_MAIN As System.Windows.Forms.ToolTip Dim TT_MAIN As System.Windows.Forms.ToolTip
Me.TXT_USER = New PersonalUtilities.Forms.Controls.TextBoxExtended() Me.TXT_USER = New PersonalUtilities.Forms.Controls.TextBoxExtended()
Me.OPT_REDDIT = New System.Windows.Forms.RadioButton() Me.OPT_REDDIT = New System.Windows.Forms.RadioButton()
Me.OPT_TWITTER = New System.Windows.Forms.RadioButton() Me.OPT_TWITTER = New System.Windows.Forms.RadioButton()
Me.CH_IS_CHANNEL = New System.Windows.Forms.CheckBox()
Me.CH_TEMP = New System.Windows.Forms.CheckBox() Me.CH_TEMP = New System.Windows.Forms.CheckBox()
Me.CH_FAV = New System.Windows.Forms.CheckBox() Me.CH_FAV = New System.Windows.Forms.CheckBox()
Me.CH_PARSE_USER_MEDIA = New System.Windows.Forms.CheckBox() Me.CH_PARSE_USER_MEDIA = New System.Windows.Forms.CheckBox()
@@ -37,11 +39,14 @@
Me.CH_ADD_BY_LIST = New System.Windows.Forms.CheckBox() Me.CH_ADD_BY_LIST = New System.Windows.Forms.CheckBox()
Me.CH_AUTO_DETECT_SITE = New System.Windows.Forms.CheckBox() Me.CH_AUTO_DETECT_SITE = New System.Windows.Forms.CheckBox()
Me.TXT_LABELS = New PersonalUtilities.Forms.Controls.TextBoxExtended() Me.TXT_LABELS = New PersonalUtilities.Forms.Controls.TextBoxExtended()
Me.CH_DOWN_IMAGES = New System.Windows.Forms.CheckBox()
Me.CH_DOWN_VIDEOS = New System.Windows.Forms.CheckBox()
Me.CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer() Me.CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer()
TP_MAIN = New System.Windows.Forms.TableLayoutPanel() TP_MAIN = New System.Windows.Forms.TableLayoutPanel()
TP_SITE = New System.Windows.Forms.TableLayoutPanel() TP_SITE = New System.Windows.Forms.TableLayoutPanel()
TP_PARAMS = New System.Windows.Forms.TableLayoutPanel() TP_PARAMS = New System.Windows.Forms.TableLayoutPanel()
TP_OTHER = New System.Windows.Forms.TableLayoutPanel() TP_OTHER = New System.Windows.Forms.TableLayoutPanel()
TP_DOWN_OPTIONS = New System.Windows.Forms.TableLayoutPanel()
TT_MAIN = New System.Windows.Forms.ToolTip(Me.components) TT_MAIN = New System.Windows.Forms.ToolTip(Me.components)
TP_MAIN.SuspendLayout() TP_MAIN.SuspendLayout()
CType(Me.TXT_USER, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TXT_USER, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -52,6 +57,7 @@
CType(Me.TXT_USER_FRIENDLY, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TXT_USER_FRIENDLY, System.ComponentModel.ISupportInitialize).BeginInit()
Me.TP_ADD_BY_LIST.SuspendLayout() Me.TP_ADD_BY_LIST.SuspendLayout()
CType(Me.TXT_LABELS, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TXT_LABELS, System.ComponentModel.ISupportInitialize).BeginInit()
TP_DOWN_OPTIONS.SuspendLayout()
Me.CONTAINER_MAIN.ContentPanel.SuspendLayout() Me.CONTAINER_MAIN.ContentPanel.SuspendLayout()
Me.CONTAINER_MAIN.SuspendLayout() Me.CONTAINER_MAIN.SuspendLayout()
Me.SuspendLayout() Me.SuspendLayout()
@@ -64,24 +70,26 @@
TP_MAIN.Controls.Add(Me.TXT_USER, 0, 0) TP_MAIN.Controls.Add(Me.TXT_USER, 0, 0)
TP_MAIN.Controls.Add(TP_SITE, 0, 2) TP_MAIN.Controls.Add(TP_SITE, 0, 2)
TP_MAIN.Controls.Add(TP_PARAMS, 0, 3) TP_MAIN.Controls.Add(TP_PARAMS, 0, 3)
TP_MAIN.Controls.Add(TP_OTHER, 0, 4) TP_MAIN.Controls.Add(TP_OTHER, 0, 5)
TP_MAIN.Controls.Add(Me.TXT_DESCR, 0, 7) TP_MAIN.Controls.Add(Me.TXT_DESCR, 0, 8)
TP_MAIN.Controls.Add(Me.TXT_USER_FRIENDLY, 0, 1) TP_MAIN.Controls.Add(Me.TXT_USER_FRIENDLY, 0, 1)
TP_MAIN.Controls.Add(Me.TP_ADD_BY_LIST, 0, 5) TP_MAIN.Controls.Add(Me.TP_ADD_BY_LIST, 0, 6)
TP_MAIN.Controls.Add(Me.TXT_LABELS, 0, 6) TP_MAIN.Controls.Add(Me.TXT_LABELS, 0, 7)
TP_MAIN.Controls.Add(TP_DOWN_OPTIONS, 0, 4)
TP_MAIN.Dock = System.Windows.Forms.DockStyle.Fill TP_MAIN.Dock = System.Windows.Forms.DockStyle.Fill
TP_MAIN.Location = New System.Drawing.Point(0, 0) TP_MAIN.Location = New System.Drawing.Point(0, 0)
TP_MAIN.Name = "TP_MAIN" TP_MAIN.Name = "TP_MAIN"
TP_MAIN.RowCount = 8 TP_MAIN.RowCount = 9
TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!)) TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!))
TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!)) TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!))
TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20.0005!)) TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66708!))
TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20.0005!)) TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66708!))
TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20.0005!)) TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66667!))
TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 19.99851!)) TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66708!))
TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20.0!)) TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66542!))
TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66667!))
TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 150.0!)) TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 150.0!))
TP_MAIN.Size = New System.Drawing.Size(454, 366) TP_MAIN.Size = New System.Drawing.Size(454, 403)
TP_MAIN.TabIndex = 0 TP_MAIN.TabIndex = 0
' '
'TXT_USER 'TXT_USER
@@ -98,19 +106,20 @@
'TP_SITE 'TP_SITE
' '
TP_SITE.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.[Single] TP_SITE.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.[Single]
TP_SITE.ColumnCount = 2 TP_SITE.ColumnCount = 3
TP_SITE.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!)) TP_SITE.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333!))
TP_SITE.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!)) TP_SITE.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333!))
TP_SITE.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333!))
TP_SITE.Controls.Add(Me.OPT_REDDIT, 0, 0) TP_SITE.Controls.Add(Me.OPT_REDDIT, 0, 0)
TP_SITE.Controls.Add(Me.OPT_TWITTER, 1, 0) TP_SITE.Controls.Add(Me.OPT_TWITTER, 2, 0)
TP_SITE.Controls.Add(Me.CH_IS_CHANNEL, 1, 0)
TP_SITE.Dock = System.Windows.Forms.DockStyle.Fill TP_SITE.Dock = System.Windows.Forms.DockStyle.Fill
TP_SITE.Location = New System.Drawing.Point(1, 59) TP_SITE.Location = New System.Drawing.Point(1, 59)
TP_SITE.Margin = New System.Windows.Forms.Padding(0) TP_SITE.Margin = New System.Windows.Forms.Padding(0)
TP_SITE.Name = "TP_SITE" TP_SITE.Name = "TP_SITE"
TP_SITE.RowCount = 1 TP_SITE.RowCount = 1
TP_SITE.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) TP_SITE.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
TP_SITE.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 29.0!)) TP_SITE.Size = New System.Drawing.Size(452, 31)
TP_SITE.Size = New System.Drawing.Size(452, 30)
TP_SITE.TabIndex = 2 TP_SITE.TabIndex = 2
' '
'OPT_REDDIT 'OPT_REDDIT
@@ -119,7 +128,7 @@
Me.OPT_REDDIT.Dock = System.Windows.Forms.DockStyle.Fill Me.OPT_REDDIT.Dock = System.Windows.Forms.DockStyle.Fill
Me.OPT_REDDIT.Location = New System.Drawing.Point(4, 4) Me.OPT_REDDIT.Location = New System.Drawing.Point(4, 4)
Me.OPT_REDDIT.Name = "OPT_REDDIT" Me.OPT_REDDIT.Name = "OPT_REDDIT"
Me.OPT_REDDIT.Size = New System.Drawing.Size(218, 22) Me.OPT_REDDIT.Size = New System.Drawing.Size(143, 23)
Me.OPT_REDDIT.TabIndex = 0 Me.OPT_REDDIT.TabIndex = 0
Me.OPT_REDDIT.TabStop = True Me.OPT_REDDIT.TabStop = True
Me.OPT_REDDIT.Text = "Reddit" Me.OPT_REDDIT.Text = "Reddit"
@@ -129,14 +138,25 @@
' '
Me.OPT_TWITTER.AutoSize = True Me.OPT_TWITTER.AutoSize = True
Me.OPT_TWITTER.Dock = System.Windows.Forms.DockStyle.Fill Me.OPT_TWITTER.Dock = System.Windows.Forms.DockStyle.Fill
Me.OPT_TWITTER.Location = New System.Drawing.Point(229, 4) Me.OPT_TWITTER.Location = New System.Drawing.Point(304, 4)
Me.OPT_TWITTER.Name = "OPT_TWITTER" Me.OPT_TWITTER.Name = "OPT_TWITTER"
Me.OPT_TWITTER.Size = New System.Drawing.Size(219, 22) Me.OPT_TWITTER.Size = New System.Drawing.Size(144, 23)
Me.OPT_TWITTER.TabIndex = 1 Me.OPT_TWITTER.TabIndex = 1
Me.OPT_TWITTER.TabStop = True Me.OPT_TWITTER.TabStop = True
Me.OPT_TWITTER.Text = "Twitter" Me.OPT_TWITTER.Text = "Twitter"
Me.OPT_TWITTER.UseVisualStyleBackColor = True Me.OPT_TWITTER.UseVisualStyleBackColor = True
' '
'CH_IS_CHANNEL
'
Me.CH_IS_CHANNEL.AutoSize = True
Me.CH_IS_CHANNEL.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_IS_CHANNEL.Location = New System.Drawing.Point(154, 4)
Me.CH_IS_CHANNEL.Name = "CH_IS_CHANNEL"
Me.CH_IS_CHANNEL.Size = New System.Drawing.Size(143, 23)
Me.CH_IS_CHANNEL.TabIndex = 2
Me.CH_IS_CHANNEL.Text = "Channel"
Me.CH_IS_CHANNEL.UseVisualStyleBackColor = True
'
'TP_PARAMS 'TP_PARAMS
' '
TP_PARAMS.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.[Single] TP_PARAMS.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.[Single]
@@ -146,13 +166,13 @@
TP_PARAMS.Controls.Add(Me.CH_TEMP, 0, 0) TP_PARAMS.Controls.Add(Me.CH_TEMP, 0, 0)
TP_PARAMS.Controls.Add(Me.CH_FAV, 1, 0) TP_PARAMS.Controls.Add(Me.CH_FAV, 1, 0)
TP_PARAMS.Dock = System.Windows.Forms.DockStyle.Fill TP_PARAMS.Dock = System.Windows.Forms.DockStyle.Fill
TP_PARAMS.Location = New System.Drawing.Point(1, 90) TP_PARAMS.Location = New System.Drawing.Point(1, 91)
TP_PARAMS.Margin = New System.Windows.Forms.Padding(0) TP_PARAMS.Margin = New System.Windows.Forms.Padding(0)
TP_PARAMS.Name = "TP_PARAMS" TP_PARAMS.Name = "TP_PARAMS"
TP_PARAMS.RowCount = 1 TP_PARAMS.RowCount = 1
TP_PARAMS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) TP_PARAMS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
TP_PARAMS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 29.0!)) TP_PARAMS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30.0!))
TP_PARAMS.Size = New System.Drawing.Size(452, 30) TP_PARAMS.Size = New System.Drawing.Size(452, 31)
TP_PARAMS.TabIndex = 3 TP_PARAMS.TabIndex = 3
' '
'CH_TEMP 'CH_TEMP
@@ -161,7 +181,7 @@
Me.CH_TEMP.Dock = System.Windows.Forms.DockStyle.Fill Me.CH_TEMP.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_TEMP.Location = New System.Drawing.Point(4, 4) Me.CH_TEMP.Location = New System.Drawing.Point(4, 4)
Me.CH_TEMP.Name = "CH_TEMP" Me.CH_TEMP.Name = "CH_TEMP"
Me.CH_TEMP.Size = New System.Drawing.Size(218, 22) Me.CH_TEMP.Size = New System.Drawing.Size(218, 23)
Me.CH_TEMP.TabIndex = 0 Me.CH_TEMP.TabIndex = 0
Me.CH_TEMP.Text = "Temporary" Me.CH_TEMP.Text = "Temporary"
Me.CH_TEMP.UseVisualStyleBackColor = True Me.CH_TEMP.UseVisualStyleBackColor = True
@@ -172,7 +192,7 @@
Me.CH_FAV.Dock = System.Windows.Forms.DockStyle.Fill Me.CH_FAV.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_FAV.Location = New System.Drawing.Point(229, 4) Me.CH_FAV.Location = New System.Drawing.Point(229, 4)
Me.CH_FAV.Name = "CH_FAV" Me.CH_FAV.Name = "CH_FAV"
Me.CH_FAV.Size = New System.Drawing.Size(219, 22) Me.CH_FAV.Size = New System.Drawing.Size(219, 23)
Me.CH_FAV.TabIndex = 1 Me.CH_FAV.TabIndex = 1
Me.CH_FAV.Text = "Favorite" Me.CH_FAV.Text = "Favorite"
Me.CH_FAV.UseVisualStyleBackColor = True Me.CH_FAV.UseVisualStyleBackColor = True
@@ -186,14 +206,14 @@
TP_OTHER.Controls.Add(Me.CH_PARSE_USER_MEDIA, 1, 0) TP_OTHER.Controls.Add(Me.CH_PARSE_USER_MEDIA, 1, 0)
TP_OTHER.Controls.Add(Me.CH_READY_FOR_DOWN, 0, 0) TP_OTHER.Controls.Add(Me.CH_READY_FOR_DOWN, 0, 0)
TP_OTHER.Dock = System.Windows.Forms.DockStyle.Fill TP_OTHER.Dock = System.Windows.Forms.DockStyle.Fill
TP_OTHER.Location = New System.Drawing.Point(1, 121) TP_OTHER.Location = New System.Drawing.Point(1, 155)
TP_OTHER.Margin = New System.Windows.Forms.Padding(0) TP_OTHER.Margin = New System.Windows.Forms.Padding(0)
TP_OTHER.Name = "TP_OTHER" TP_OTHER.Name = "TP_OTHER"
TP_OTHER.RowCount = 1 TP_OTHER.RowCount = 1
TP_OTHER.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) TP_OTHER.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
TP_OTHER.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 29.0!)) TP_OTHER.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30.0!))
TP_OTHER.Size = New System.Drawing.Size(452, 30) TP_OTHER.Size = New System.Drawing.Size(452, 31)
TP_OTHER.TabIndex = 4 TP_OTHER.TabIndex = 5
' '
'CH_PARSE_USER_MEDIA 'CH_PARSE_USER_MEDIA
' '
@@ -201,7 +221,7 @@
Me.CH_PARSE_USER_MEDIA.Dock = System.Windows.Forms.DockStyle.Fill Me.CH_PARSE_USER_MEDIA.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_PARSE_USER_MEDIA.Location = New System.Drawing.Point(229, 4) Me.CH_PARSE_USER_MEDIA.Location = New System.Drawing.Point(229, 4)
Me.CH_PARSE_USER_MEDIA.Name = "CH_PARSE_USER_MEDIA" Me.CH_PARSE_USER_MEDIA.Name = "CH_PARSE_USER_MEDIA"
Me.CH_PARSE_USER_MEDIA.Size = New System.Drawing.Size(219, 22) Me.CH_PARSE_USER_MEDIA.Size = New System.Drawing.Size(219, 23)
Me.CH_PARSE_USER_MEDIA.TabIndex = 0 Me.CH_PARSE_USER_MEDIA.TabIndex = 0
Me.CH_PARSE_USER_MEDIA.Text = "Get user media only" Me.CH_PARSE_USER_MEDIA.Text = "Get user media only"
TT_MAIN.SetToolTip(Me.CH_PARSE_USER_MEDIA, "For twitter only!" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "If checked then user media only will be downloaded." & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "Otherwise" & TT_MAIN.SetToolTip(Me.CH_PARSE_USER_MEDIA, "For twitter only!" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "If checked then user media only will be downloaded." & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "Otherwise" &
@@ -214,7 +234,7 @@
Me.CH_READY_FOR_DOWN.Dock = System.Windows.Forms.DockStyle.Fill Me.CH_READY_FOR_DOWN.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_READY_FOR_DOWN.Location = New System.Drawing.Point(4, 4) Me.CH_READY_FOR_DOWN.Location = New System.Drawing.Point(4, 4)
Me.CH_READY_FOR_DOWN.Name = "CH_READY_FOR_DOWN" Me.CH_READY_FOR_DOWN.Name = "CH_READY_FOR_DOWN"
Me.CH_READY_FOR_DOWN.Size = New System.Drawing.Size(218, 22) Me.CH_READY_FOR_DOWN.Size = New System.Drawing.Size(218, 23)
Me.CH_READY_FOR_DOWN.TabIndex = 1 Me.CH_READY_FOR_DOWN.TabIndex = 1
Me.CH_READY_FOR_DOWN.Text = "Ready for download" Me.CH_READY_FOR_DOWN.Text = "Ready for download"
TT_MAIN.SetToolTip(Me.CH_READY_FOR_DOWN, "Can be downloaded by [Download All]") TT_MAIN.SetToolTip(Me.CH_READY_FOR_DOWN, "Can be downloaded by [Download All]")
@@ -233,11 +253,11 @@
Me.TXT_DESCR.Dock = System.Windows.Forms.DockStyle.Fill Me.TXT_DESCR.Dock = System.Windows.Forms.DockStyle.Fill
Me.TXT_DESCR.GroupBoxed = True Me.TXT_DESCR.GroupBoxed = True
Me.TXT_DESCR.GroupBoxText = "Description" Me.TXT_DESCR.GroupBoxText = "Description"
Me.TXT_DESCR.Location = New System.Drawing.Point(4, 217) Me.TXT_DESCR.Location = New System.Drawing.Point(4, 254)
Me.TXT_DESCR.Multiline = True Me.TXT_DESCR.Multiline = True
Me.TXT_DESCR.Name = "TXT_DESCR" Me.TXT_DESCR.Name = "TXT_DESCR"
Me.TXT_DESCR.Size = New System.Drawing.Size(446, 145) Me.TXT_DESCR.Size = New System.Drawing.Size(446, 145)
Me.TXT_DESCR.TabIndex = 5 Me.TXT_DESCR.TabIndex = 8
' '
'TXT_USER_FRIENDLY 'TXT_USER_FRIENDLY
' '
@@ -258,12 +278,12 @@
Me.TP_ADD_BY_LIST.Controls.Add(Me.CH_ADD_BY_LIST, 0, 0) Me.TP_ADD_BY_LIST.Controls.Add(Me.CH_ADD_BY_LIST, 0, 0)
Me.TP_ADD_BY_LIST.Controls.Add(Me.CH_AUTO_DETECT_SITE, 1, 0) Me.TP_ADD_BY_LIST.Controls.Add(Me.CH_AUTO_DETECT_SITE, 1, 0)
Me.TP_ADD_BY_LIST.Dock = System.Windows.Forms.DockStyle.Fill Me.TP_ADD_BY_LIST.Dock = System.Windows.Forms.DockStyle.Fill
Me.TP_ADD_BY_LIST.Location = New System.Drawing.Point(1, 152) Me.TP_ADD_BY_LIST.Location = New System.Drawing.Point(1, 187)
Me.TP_ADD_BY_LIST.Margin = New System.Windows.Forms.Padding(0) Me.TP_ADD_BY_LIST.Margin = New System.Windows.Forms.Padding(0)
Me.TP_ADD_BY_LIST.Name = "TP_ADD_BY_LIST" Me.TP_ADD_BY_LIST.Name = "TP_ADD_BY_LIST"
Me.TP_ADD_BY_LIST.RowCount = 1 Me.TP_ADD_BY_LIST.RowCount = 1
Me.TP_ADD_BY_LIST.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) Me.TP_ADD_BY_LIST.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
Me.TP_ADD_BY_LIST.Size = New System.Drawing.Size(452, 30) Me.TP_ADD_BY_LIST.Size = New System.Drawing.Size(452, 31)
Me.TP_ADD_BY_LIST.TabIndex = 6 Me.TP_ADD_BY_LIST.TabIndex = 6
' '
'CH_ADD_BY_LIST 'CH_ADD_BY_LIST
@@ -272,7 +292,7 @@
Me.CH_ADD_BY_LIST.Dock = System.Windows.Forms.DockStyle.Fill Me.CH_ADD_BY_LIST.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_ADD_BY_LIST.Location = New System.Drawing.Point(4, 4) Me.CH_ADD_BY_LIST.Location = New System.Drawing.Point(4, 4)
Me.CH_ADD_BY_LIST.Name = "CH_ADD_BY_LIST" Me.CH_ADD_BY_LIST.Name = "CH_ADD_BY_LIST"
Me.CH_ADD_BY_LIST.Size = New System.Drawing.Size(218, 22) Me.CH_ADD_BY_LIST.Size = New System.Drawing.Size(218, 23)
Me.CH_ADD_BY_LIST.TabIndex = 0 Me.CH_ADD_BY_LIST.TabIndex = 0
Me.CH_ADD_BY_LIST.Text = "Add by list" Me.CH_ADD_BY_LIST.Text = "Add by list"
Me.CH_ADD_BY_LIST.UseVisualStyleBackColor = True Me.CH_ADD_BY_LIST.UseVisualStyleBackColor = True
@@ -283,7 +303,7 @@
Me.CH_AUTO_DETECT_SITE.Dock = System.Windows.Forms.DockStyle.Fill Me.CH_AUTO_DETECT_SITE.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_AUTO_DETECT_SITE.Location = New System.Drawing.Point(229, 4) Me.CH_AUTO_DETECT_SITE.Location = New System.Drawing.Point(229, 4)
Me.CH_AUTO_DETECT_SITE.Name = "CH_AUTO_DETECT_SITE" Me.CH_AUTO_DETECT_SITE.Name = "CH_AUTO_DETECT_SITE"
Me.CH_AUTO_DETECT_SITE.Size = New System.Drawing.Size(219, 22) Me.CH_AUTO_DETECT_SITE.Size = New System.Drawing.Size(219, 23)
Me.CH_AUTO_DETECT_SITE.TabIndex = 1 Me.CH_AUTO_DETECT_SITE.TabIndex = 1
Me.CH_AUTO_DETECT_SITE.Text = "Auto detect site" Me.CH_AUTO_DETECT_SITE.Text = "Auto detect site"
Me.CH_AUTO_DETECT_SITE.UseVisualStyleBackColor = True Me.CH_AUTO_DETECT_SITE.UseVisualStyleBackColor = True
@@ -301,25 +321,65 @@
Me.TXT_LABELS.CaptionText = "Labels" Me.TXT_LABELS.CaptionText = "Labels"
Me.TXT_LABELS.CaptionWidth = 50.0R Me.TXT_LABELS.CaptionWidth = 50.0R
Me.TXT_LABELS.Dock = System.Windows.Forms.DockStyle.Fill Me.TXT_LABELS.Dock = System.Windows.Forms.DockStyle.Fill
Me.TXT_LABELS.Location = New System.Drawing.Point(4, 186) Me.TXT_LABELS.Location = New System.Drawing.Point(4, 222)
Me.TXT_LABELS.Name = "TXT_LABELS" Me.TXT_LABELS.Name = "TXT_LABELS"
Me.TXT_LABELS.Size = New System.Drawing.Size(446, 22) Me.TXT_LABELS.Size = New System.Drawing.Size(446, 22)
Me.TXT_LABELS.TabIndex = 7 Me.TXT_LABELS.TabIndex = 7
Me.TXT_LABELS.TextBoxReadOnly = True Me.TXT_LABELS.TextBoxReadOnly = True
' '
'TP_DOWN_OPTIONS
'
TP_DOWN_OPTIONS.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.[Single]
TP_DOWN_OPTIONS.ColumnCount = 2
TP_DOWN_OPTIONS.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
TP_DOWN_OPTIONS.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
TP_DOWN_OPTIONS.Controls.Add(Me.CH_DOWN_IMAGES, 0, 0)
TP_DOWN_OPTIONS.Controls.Add(Me.CH_DOWN_VIDEOS, 1, 0)
TP_DOWN_OPTIONS.Dock = System.Windows.Forms.DockStyle.Fill
TP_DOWN_OPTIONS.Location = New System.Drawing.Point(1, 123)
TP_DOWN_OPTIONS.Margin = New System.Windows.Forms.Padding(0)
TP_DOWN_OPTIONS.Name = "TP_DOWN_OPTIONS"
TP_DOWN_OPTIONS.RowCount = 1
TP_DOWN_OPTIONS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
TP_DOWN_OPTIONS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30.0!))
TP_DOWN_OPTIONS.Size = New System.Drawing.Size(452, 31)
TP_DOWN_OPTIONS.TabIndex = 4
'
'CH_DOWN_IMAGES
'
Me.CH_DOWN_IMAGES.AutoSize = True
Me.CH_DOWN_IMAGES.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_DOWN_IMAGES.Location = New System.Drawing.Point(4, 4)
Me.CH_DOWN_IMAGES.Name = "CH_DOWN_IMAGES"
Me.CH_DOWN_IMAGES.Size = New System.Drawing.Size(218, 23)
Me.CH_DOWN_IMAGES.TabIndex = 0
Me.CH_DOWN_IMAGES.Text = "Download Images"
Me.CH_DOWN_IMAGES.UseVisualStyleBackColor = True
'
'CH_DOWN_VIDEOS
'
Me.CH_DOWN_VIDEOS.AutoSize = True
Me.CH_DOWN_VIDEOS.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_DOWN_VIDEOS.Location = New System.Drawing.Point(229, 4)
Me.CH_DOWN_VIDEOS.Name = "CH_DOWN_VIDEOS"
Me.CH_DOWN_VIDEOS.Size = New System.Drawing.Size(219, 23)
Me.CH_DOWN_VIDEOS.TabIndex = 1
Me.CH_DOWN_VIDEOS.Text = "Download videos"
Me.CH_DOWN_VIDEOS.UseVisualStyleBackColor = True
'
'CONTAINER_MAIN 'CONTAINER_MAIN
' '
' '
'CONTAINER_MAIN.ContentPanel 'CONTAINER_MAIN.ContentPanel
' '
Me.CONTAINER_MAIN.ContentPanel.Controls.Add(TP_MAIN) Me.CONTAINER_MAIN.ContentPanel.Controls.Add(TP_MAIN)
Me.CONTAINER_MAIN.ContentPanel.Size = New System.Drawing.Size(454, 366) Me.CONTAINER_MAIN.ContentPanel.Size = New System.Drawing.Size(454, 403)
Me.CONTAINER_MAIN.Dock = System.Windows.Forms.DockStyle.Fill Me.CONTAINER_MAIN.Dock = System.Windows.Forms.DockStyle.Fill
Me.CONTAINER_MAIN.LeftToolStripPanelVisible = False Me.CONTAINER_MAIN.LeftToolStripPanelVisible = False
Me.CONTAINER_MAIN.Location = New System.Drawing.Point(0, 0) Me.CONTAINER_MAIN.Location = New System.Drawing.Point(0, 0)
Me.CONTAINER_MAIN.Name = "CONTAINER_MAIN" Me.CONTAINER_MAIN.Name = "CONTAINER_MAIN"
Me.CONTAINER_MAIN.RightToolStripPanelVisible = False Me.CONTAINER_MAIN.RightToolStripPanelVisible = False
Me.CONTAINER_MAIN.Size = New System.Drawing.Size(454, 366) Me.CONTAINER_MAIN.Size = New System.Drawing.Size(454, 403)
Me.CONTAINER_MAIN.TabIndex = 0 Me.CONTAINER_MAIN.TabIndex = 0
Me.CONTAINER_MAIN.TopToolStripPanelVisible = False Me.CONTAINER_MAIN.TopToolStripPanelVisible = False
' '
@@ -327,15 +387,15 @@
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(454, 366) Me.ClientSize = New System.Drawing.Size(454, 403)
Me.Controls.Add(Me.CONTAINER_MAIN) Me.Controls.Add(Me.CONTAINER_MAIN)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.KeyPreview = True Me.KeyPreview = True
Me.MaximizeBox = False Me.MaximizeBox = False
Me.MaximumSize = New System.Drawing.Size(470, 405) Me.MaximumSize = New System.Drawing.Size(470, 442)
Me.MinimizeBox = False Me.MinimizeBox = False
Me.MinimumSize = New System.Drawing.Size(470, 405) Me.MinimumSize = New System.Drawing.Size(470, 442)
Me.Name = "UserCreatorForm" Me.Name = "UserCreatorForm"
Me.ShowInTaskbar = False Me.ShowInTaskbar = False
Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide
@@ -353,6 +413,8 @@
Me.TP_ADD_BY_LIST.ResumeLayout(False) Me.TP_ADD_BY_LIST.ResumeLayout(False)
Me.TP_ADD_BY_LIST.PerformLayout() Me.TP_ADD_BY_LIST.PerformLayout()
CType(Me.TXT_LABELS, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TXT_LABELS, System.ComponentModel.ISupportInitialize).EndInit()
TP_DOWN_OPTIONS.ResumeLayout(False)
TP_DOWN_OPTIONS.PerformLayout()
Me.CONTAINER_MAIN.ContentPanel.ResumeLayout(False) Me.CONTAINER_MAIN.ContentPanel.ResumeLayout(False)
Me.CONTAINER_MAIN.ResumeLayout(False) Me.CONTAINER_MAIN.ResumeLayout(False)
Me.CONTAINER_MAIN.PerformLayout() Me.CONTAINER_MAIN.PerformLayout()
@@ -374,5 +436,8 @@
Private WithEvents CH_ADD_BY_LIST As CheckBox Private WithEvents CH_ADD_BY_LIST As CheckBox
Private WithEvents CH_AUTO_DETECT_SITE As CheckBox Private WithEvents CH_AUTO_DETECT_SITE As CheckBox
Private WithEvents TXT_LABELS As PersonalUtilities.Forms.Controls.TextBoxExtended Private WithEvents TXT_LABELS As PersonalUtilities.Forms.Controls.TextBoxExtended
Private WithEvents CH_DOWN_IMAGES As CheckBox
Private WithEvents CH_DOWN_VIDEOS As CheckBox
Private WithEvents CH_IS_CHANNEL As CheckBox
End Class End Class
End Namespace End Namespace

View File

@@ -163,6 +163,9 @@
AFuc5QFgn6ClHh5iOQVAKNixyucB8NY0vG9JOzzyhrdq5IRgAAAAAElFTkSuQmCC AFuc5QFgn6ClHh5iOQVAKNixyucB8NY0vG9JOzzyhrdq5IRgAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<metadata name="TP_DOWN_OPTIONS.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
AAABAAkAMDAQAAAAAABoBgAAlgAAACAgEAAAAAAA6AIAAP4GAAAQEBAAAAAAACgBAADmCQAAMDAAAAEA AAABAAkAMDAQAAAAAABoBgAAlgAAACAgEAAAAAAA6AIAAP4GAAAQEBAAAAAAACgBAADmCQAAMDAAAAEA

View File

@@ -1,4 +1,12 @@
Imports System.ComponentModel ' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports System.ComponentModel
Imports PersonalUtilities.Forms Imports PersonalUtilities.Forms
Imports PersonalUtilities.Forms.Controls Imports PersonalUtilities.Forms.Controls
Imports PersonalUtilities.Forms.Controls.Base Imports PersonalUtilities.Forms.Controls.Base
@@ -38,6 +46,16 @@ Namespace Editors
Return CH_READY_FOR_DOWN.Checked Return CH_READY_FOR_DOWN.Checked
End Get End Get
End Property End Property
Friend ReadOnly Property DownloadImages As Boolean
Get
Return CH_DOWN_IMAGES.Checked
End Get
End Property
Friend ReadOnly Property DownloadVideos As Boolean
Get
Return CH_DOWN_VIDEOS.Checked
End Get
End Property
Friend ReadOnly Property UserDescr As String Friend ReadOnly Property UserDescr As String
Get Get
Return TXT_DESCR.Text Return TXT_DESCR.Text
@@ -62,7 +80,7 @@ Namespace Editors
Me.New Me.New
If Not _Instance Is Nothing Then If Not _Instance Is Nothing Then
UserInstance = _Instance UserInstance = _Instance
User = DirectCast(UserInstance, UserDataBase).User User = DirectCast(UserInstance.Self, UserDataBase).User
End If End If
End Sub End Sub
Private Sub UserCreatorForm_Load(sender As Object, e As EventArgs) Handles Me.Load Private Sub UserCreatorForm_Load(sender As Object, e As EventArgs) Handles Me.Load
@@ -70,12 +88,15 @@ Namespace Editors
With MyDef With MyDef
.MyViewInitialize(Me, Settings.Design, True) .MyViewInitialize(Me, Settings.Design, True)
.AddOkCancelToolbar() .AddOkCancelToolbar()
CH_AUTO_DETECT_SITE.Enabled = False
If User.Name.IsEmptyString Then If User.Name.IsEmptyString Then
OPT_REDDIT.Checked = False OPT_REDDIT.Checked = False
OPT_TWITTER.Checked = False OPT_TWITTER.Checked = False
CH_PARSE_USER_MEDIA.Enabled = False CH_PARSE_USER_MEDIA.Enabled = False
CH_READY_FOR_DOWN.Checked = True CH_READY_FOR_DOWN.Checked = True
CH_TEMP.Checked = Settings.DefaultTemporary.Value CH_TEMP.Checked = Settings.DefaultTemporary
CH_DOWN_IMAGES.Checked = Settings.DefaultDownloadImages
CH_DOWN_VIDEOS.Checked = Settings.DefaultDownloadVideos
Else Else
TP_ADD_BY_LIST.Enabled = False TP_ADD_BY_LIST.Enabled = False
TXT_USER.Text = User.Name TXT_USER.Text = User.Name
@@ -85,6 +106,8 @@ Namespace Editors
End Select End Select
OPT_REDDIT.Enabled = False OPT_REDDIT.Enabled = False
OPT_TWITTER.Enabled = False OPT_TWITTER.Enabled = False
CH_IS_CHANNEL.Checked = User.IsChannel
CH_IS_CHANNEL.Enabled = False
If Not UserInstance Is Nothing Then If Not UserInstance Is Nothing Then
TXT_USER.Enabled = False TXT_USER.Enabled = False
With UserInstance With UserInstance
@@ -93,16 +116,25 @@ Namespace Editors
CH_TEMP.Checked = .Temporary CH_TEMP.Checked = .Temporary
CH_PARSE_USER_MEDIA.Checked = .ParseUserMediaOnly CH_PARSE_USER_MEDIA.Checked = .ParseUserMediaOnly
CH_READY_FOR_DOWN.Checked = .ReadyForDownload CH_READY_FOR_DOWN.Checked = .ReadyForDownload
CH_DOWN_IMAGES.Checked = .DownloadImages
CH_DOWN_VIDEOS.Checked = .DownloadVideos
TXT_DESCR.Text = .Description TXT_DESCR.Text = .Description
UserLabels.ListAddList(.Labels) UserLabels.ListAddList(.Labels)
If UserLabels.ListExists Then TXT_LABELS.Text = UserLabels.ListToString If UserLabels.ListExists Then TXT_LABELS.Text = UserLabels.ListToString
End With End With
CH_ADD_BY_LIST.Enabled = False
Else
CH_TEMP.Checked = Settings.DefaultTemporary
CH_READY_FOR_DOWN.Checked = Not Settings.DefaultTemporary
CH_DOWN_IMAGES.Checked = Settings.DefaultDownloadImages
CH_DOWN_VIDEOS.Checked = Settings.DefaultDownloadVideos
End If End If
End If End If
.MyFieldsChecker = New FieldsChecker .MyFieldsChecker = New FieldsChecker
.MyFieldsChecker.AddControl(Of String)(TXT_USER, TXT_USER.CaptionText) .MyFieldsChecker.AddControl(Of String)(TXT_USER, TXT_USER.CaptionText)
.MyFieldsChecker.EndLoaderOperations() .MyFieldsChecker.EndLoaderOperations()
TextBoxExtended.SetFalseDetector(Me, True, AddressOf .Detector) SetParamsBySite()
.AppendDetectors()
.EndLoaderOperations() .EndLoaderOperations()
End With End With
Catch ex As Exception Catch ex As Exception
@@ -117,7 +149,6 @@ Namespace Editors
e.Cancel = True e.Cancel = True
Else Else
MyDef.Dispose() MyDef.Dispose()
If Not DialogResult = DialogResult.OK And Not DialogResult = DialogResult.Cancel And StartIndex >= 0 Then DialogResult = DialogResult.OK
End If End If
End Sub End Sub
Private Sub UserCreatorForm_Disposed(sender As Object, e As EventArgs) Handles Me.Disposed Private Sub UserCreatorForm_Disposed(sender As Object, e As EventArgs) Handles Me.Disposed
@@ -131,16 +162,19 @@ Namespace Editors
With tmpUser With tmpUser
.Name = TXT_USER.Text .Name = TXT_USER.Text
.Site = IIf(OPT_REDDIT.Checked, Sites.Reddit, Sites.Twitter) .Site = IIf(OPT_REDDIT.Checked, Sites.Reddit, Sites.Twitter)
.IsChannel = CH_IS_CHANNEL.Checked
.UpdateUserFile() .UpdateUserFile()
End With End With
User = tmpUser User = tmpUser
If Not UserInstance Is Nothing Then If Not UserInstance Is Nothing Then
With DirectCast(UserInstance, UserDataBase) With DirectCast(UserInstance.Self, UserDataBase)
.User = User .User = User
.FriendlyName = TXT_USER_FRIENDLY.Text .FriendlyName = TXT_USER_FRIENDLY.Text
.Favorite = CH_FAV.Checked .Favorite = CH_FAV.Checked
.Temporary = CH_TEMP.Checked .Temporary = CH_TEMP.Checked
.ReadyForDownload = CH_READY_FOR_DOWN.Checked .ReadyForDownload = CH_READY_FOR_DOWN.Checked
.DownloadImages = CH_DOWN_IMAGES.Checked
.DownloadVideos = CH_DOWN_VIDEOS.Checked
.UserDescription = TXT_DESCR.Text .UserDescription = TXT_DESCR.Text
Dim l As New ListAddParams(LAP.NotContainsOnly + LAP.ClearBeforeAdd) Dim l As New ListAddParams(LAP.NotContainsOnly + LAP.ClearBeforeAdd)
If .IsCollection Then If .IsCollection Then
@@ -172,72 +206,88 @@ CloseForm:
Private ReadOnly TwitterRegEx As New RegexStructure("[htps:/]{7,8}.*?twitter.com/([^/]+)", 1) Private ReadOnly TwitterRegEx As New RegexStructure("[htps:/]{7,8}.*?twitter.com/([^/]+)", 1)
Private ReadOnly RedditRegEx1 As New RegexStructure("[htps:/]{7,8}.*?reddit.com/user/([^/]+)", 1) Private ReadOnly RedditRegEx1 As New RegexStructure("[htps:/]{7,8}.*?reddit.com/user/([^/]+)", 1)
Private ReadOnly RedditRegEx2 As New RegexStructure(".?u/([^/]+)", 1) Private ReadOnly RedditRegEx2 As New RegexStructure(".?u/([^/]+)", 1)
Private ReadOnly RedditChannelRegEx1 As New RegexStructure("[htps:/]{7,8}.*?reddit.com/r/([^/]+)", 1)
Private ReadOnly RedditChannelRegEx2 As New RegexStructure(".?r/([^/]+)", 1)
Private _TextChangeInvoked As Boolean = False Private _TextChangeInvoked As Boolean = False
Private Sub TXT_USER_ActionOnTextChange() Handles TXT_USER.ActionOnTextChange Private Sub TXT_USER_ActionOnTextChange() Handles TXT_USER.ActionOnTextChange
Try Try
If Not _TextChangeInvoked Then If Not _TextChangeInvoked Then
_TextChangeInvoked = True _TextChangeInvoked = True
If Not CH_ADD_BY_LIST.Checked Then If Not CH_ADD_BY_LIST.Checked Then
Select Case GetSiteByText(TXT_USER.Text) Dim s() As Object = GetSiteByText(TXT_USER.Text)
Select Case s(0)
Case Sites.Twitter : OPT_TWITTER.Checked = True Case Sites.Twitter : OPT_TWITTER.Checked = True
Case Sites.Reddit : OPT_REDDIT.Checked = True Case Sites.Reddit : OPT_REDDIT.Checked = True
Case Else : OPT_TWITTER.Checked = False : OPT_REDDIT.Checked = False Case Else : OPT_TWITTER.Checked = False : OPT_REDDIT.Checked = False
End Select End Select
CH_IS_CHANNEL.Checked = CBool(s(1))
End If End If
MyDef.Detector()
_TextChangeInvoked = False _TextChangeInvoked = False
End If End If
Catch ex As Exception Catch ex As Exception
End Try End Try
End Sub End Sub
Private Function GetSiteByText(ByRef TXT As String) As Sites Private Function GetSiteByText(ByRef TXT As String) As Object()
If Not TXT.IsEmptyString AndAlso TXT.Length > 8 Then If Not TXT.IsEmptyString AndAlso TXT.Length > 8 Then
Dim s$ = RegexReplace(TXT, TwitterRegEx) If CheckRegex(TXT, TwitterRegEx) Then
If Not s.IsEmptyString Then Return {Sites.Twitter, False}
TXT = s ElseIf CheckRegex(TXT, RedditRegEx1) OrElse CheckRegex(TXT, RedditRegEx2) Then
Return Sites.Twitter Return {Sites.Reddit, False}
Else ElseIf CheckRegex(TXT, RedditChannelRegEx1) OrElse CheckRegex(TXT, RedditChannelRegEx2) Then
s = RegexReplace(TXT, RedditRegEx1) Return {Sites.Reddit, True}
If Not s.IsEmptyString Then
TXT = s
Return Sites.Reddit
Else
s = RegexReplace(TXT, RedditRegEx2)
If Not s.IsEmptyString Then
TXT = s
Return Sites.Reddit
End If End If
End If End If
End If Return {Sites.Undefined, False}
End If End Function
Return Sites.Undefined Private Function CheckRegex(ByRef TXT As String, ByVal r As RegexStructure) As Boolean
Dim s$ = RegexReplace(TXT, r)
If Not s.IsEmptyString Then TXT = s : Return True Else Return False
End Function End Function
Private Sub OPT_REDDIT_CheckedChanged(sender As Object, e As EventArgs) Handles OPT_REDDIT.CheckedChanged Private Sub OPT_REDDIT_CheckedChanged(sender As Object, e As EventArgs) Handles OPT_REDDIT.CheckedChanged
MyDef.Detector() If OPT_REDDIT.Checked Then CH_IS_CHANNEL.Enabled = True : SetParamsBySite()
End Sub End Sub
Private Sub OPT_TWITTER_CheckedChanged(sender As Object, e As EventArgs) Handles OPT_TWITTER.CheckedChanged Private Sub OPT_TWITTER_CheckedChanged(sender As Object, e As EventArgs) Handles OPT_TWITTER.CheckedChanged
MyDef.Detector() If OPT_TWITTER.Checked Then CH_IS_CHANNEL.Checked = False : CH_IS_CHANNEL.Enabled = False : SetParamsBySite()
CH_PARSE_USER_MEDIA.Enabled = OPT_TWITTER.Checked
End Sub End Sub
Private Sub CH_TEMP_CheckedChanged(sender As Object, e As EventArgs) Handles CH_TEMP.CheckedChanged Private Sub CH_TEMP_CheckedChanged(sender As Object, e As EventArgs) Handles CH_TEMP.CheckedChanged
If CH_TEMP.Checked Then CH_FAV.Checked = False If CH_TEMP.Checked Then CH_FAV.Checked = False : CH_READY_FOR_DOWN.Checked = False
MyDef.Detector()
End Sub End Sub
Private Sub CH_FAV_CheckedChanged(sender As Object, e As EventArgs) Handles CH_FAV.CheckedChanged Private Sub CH_FAV_CheckedChanged(sender As Object, e As EventArgs) Handles CH_FAV.CheckedChanged
If CH_FAV.Checked Then CH_TEMP.Checked = False If CH_FAV.Checked Then CH_TEMP.Checked = False
MyDef.Detector()
End Sub End Sub
Private Sub CH_READY_FOR_DOWN_CheckedChanged(sender As Object, e As EventArgs) Handles CH_READY_FOR_DOWN.CheckedChanged Private Sub SetParamsBySite()
MyDef.Detector() Dim s As Sites = Sites.Undefined
End Sub Select Case True
Private Sub CH_PARSE_USER_MADIA_CheckedChanged(sender As Object, e As EventArgs) Handles CH_PARSE_USER_MEDIA.CheckedChanged Case OPT_REDDIT.Checked : s = Sites.Reddit
MyDef.Detector() Case OPT_TWITTER.Checked : s = Sites.Twitter
End Select
With Settings
Select Case s
Case Sites.Reddit
CH_TEMP.Checked = .RedditTemporary
CH_DOWN_IMAGES.Checked = .RedditDownloadImages
CH_DOWN_VIDEOS.Checked = .RedditDownloadVideos
CH_PARSE_USER_MEDIA.Checked = False
CH_PARSE_USER_MEDIA.Enabled = False
Case Sites.Twitter
CH_TEMP.Checked = .TwitterTemporary
CH_DOWN_IMAGES.Checked = .TwitterDownloadImages
CH_DOWN_VIDEOS.Checked = .TwitterDownloadVideos
CH_PARSE_USER_MEDIA.Enabled = True
CH_PARSE_USER_MEDIA.Checked = .TwitterDefaultGetUserMedia
End Select
End With
End Sub End Sub
Private Sub CH_ADD_BY_LIST_CheckedChanged(sender As Object, e As EventArgs) Handles CH_ADD_BY_LIST.CheckedChanged Private Sub CH_ADD_BY_LIST_CheckedChanged(sender As Object, e As EventArgs) Handles CH_ADD_BY_LIST.CheckedChanged
If CH_ADD_BY_LIST.Checked Then If CH_ADD_BY_LIST.Checked Then
TXT_DESCR.GroupBoxText = "Users list" TXT_DESCR.GroupBoxText = "Users list"
CH_AUTO_DETECT_SITE.Enabled = True
CH_PARSE_USER_MEDIA.Enabled = True
Else Else
TXT_DESCR.GroupBoxText = "Description" TXT_DESCR.GroupBoxText = "Description"
CH_AUTO_DETECT_SITE.Checked = False
CH_AUTO_DETECT_SITE.Enabled = False
SetParamsBySite()
End If End If
TXT_USER.Enabled = Not CH_ADD_BY_LIST.Checked TXT_USER.Enabled = Not CH_ADD_BY_LIST.Checked
TXT_USER_FRIENDLY.Enabled = Not CH_ADD_BY_LIST.Checked TXT_USER_FRIENDLY.Enabled = Not CH_ADD_BY_LIST.Checked
@@ -245,6 +295,7 @@ CloseForm:
Private Sub CH_AUTO_DETECT_SITE_CheckedChanged(sender As Object, e As EventArgs) Handles CH_AUTO_DETECT_SITE.CheckedChanged Private Sub CH_AUTO_DETECT_SITE_CheckedChanged(sender As Object, e As EventArgs) Handles CH_AUTO_DETECT_SITE.CheckedChanged
OPT_REDDIT.Enabled = Not CH_AUTO_DETECT_SITE.Checked OPT_REDDIT.Enabled = Not CH_AUTO_DETECT_SITE.Checked
OPT_TWITTER.Enabled = Not CH_AUTO_DETECT_SITE.Checked OPT_TWITTER.Enabled = Not CH_AUTO_DETECT_SITE.Checked
CH_IS_CHANNEL.Enabled = Not CH_AUTO_DETECT_SITE.Checked
End Sub End Sub
Private Function CreateUsersByList() As Boolean Private Function CreateUsersByList() As Boolean
Try Try
@@ -258,6 +309,8 @@ CloseForm:
Dim uu$ Dim uu$
Dim tmpUser As UserInfo Dim tmpUser As UserInfo
Dim s As Sites Dim s As Sites
Dim sObj() As Object
Dim _IsChannel As Boolean = CH_IS_CHANNEL.Checked
Dim Added% = 0 Dim Added% = 0
Dim Skipped% = 0 Dim Skipped% = 0
Dim uid% Dim uid%
@@ -270,10 +323,14 @@ CloseForm:
For i% = 0 To u.Count - 1 For i% = 0 To u.Count - 1
uu = u(i) uu = u(i)
If CH_AUTO_DETECT_SITE.Checked Then s = GetSiteByText(uu) If CH_AUTO_DETECT_SITE.Checked Then
sObj = GetSiteByText(uu)
s = sObj(0)
_IsChannel = CBool(sObj(1))
End If
If Not s = Sites.Undefined Then If Not s = Sites.Undefined Then
tmpUser = New UserInfo(uu, s) tmpUser = New UserInfo(uu, s) With {.IsChannel = _IsChannel}
uid = -1 uid = -1
If Settings.UsersList.Count > 0 Then uid = Settings.UsersList.IndexOf(tmpUser) If Settings.UsersList.Count > 0 Then uid = Settings.UsersList.IndexOf(tmpUser)
If uid < 0 And Not UsersForCreate.Contains(tmpUser) Then If uid < 0 And Not UsersForCreate.Contains(tmpUser) Then
@@ -299,6 +356,8 @@ CloseForm:
.Favorite = CH_FAV.Checked .Favorite = CH_FAV.Checked
.Temporary = CH_TEMP.Checked .Temporary = CH_TEMP.Checked
.ReadyForDownload = CH_READY_FOR_DOWN.Checked .ReadyForDownload = CH_READY_FOR_DOWN.Checked
.DownloadImages = CH_DOWN_IMAGES.Checked
.DownloadVideos = CH_DOWN_VIDEOS.Checked
.Labels.ListAddList(UserLabels) .Labels.ListAddList(UserLabels)
If s = Sites.Twitter Then .ParseUserMediaOnly = CH_PARSE_USER_MEDIA.Checked If s = Sites.Twitter Then .ParseUserMediaOnly = CH_PARSE_USER_MEDIA.Checked
.UpdateUserInformation() .UpdateUserInformation()
@@ -322,6 +381,7 @@ CloseForm:
End If End If
MsgBoxE(m) MsgBoxE(m)
If Added > 0 Then MyDef.ChangesDetected = False
Return Added > 0 And Not BannedUsers.ListExists And NonIdentified.Count = 0 Return Added > 0 And Not BannedUsers.ListExists And NonIdentified.Count = 0
Else Else
MsgBoxE("No one user can not recognized", MsgBoxStyle.Exclamation) MsgBoxE("No one user can not recognized", MsgBoxStyle.Exclamation)

View File

@@ -1,4 +1,12 @@
Imports PersonalUtilities.Tools ' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports PersonalUtilities.Tools
Friend Class LabelsKeeper : Implements ICollection(Of String), IMyEnumerator(Of String), IDisposable Friend Class LabelsKeeper : Implements ICollection(Of String), IMyEnumerator(Of String), IDisposable
Friend Event NewLabelAdded() Friend Event NewLabelAdded()
Friend Const NoLabeledName As String = "No Label" Friend Const NoLabeledName As String = "No Label"

View File

@@ -71,6 +71,7 @@ Partial Class MainFrame
Me.LIST_PROFILES = New System.Windows.Forms.ListView() Me.LIST_PROFILES = New System.Windows.Forms.ListView()
Me.USER_CONTEXT = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.USER_CONTEXT = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.BTT_CONTEXT_DOWN = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_CONTEXT_DOWN = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_CONTEXT_DOWN_LIMITED = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_CONTEXT_EDIT = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_CONTEXT_EDIT = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_CONTEXT_DELETE = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_CONTEXT_DELETE = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_CONTEXT_FAV = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_CONTEXT_FAV = New System.Windows.Forms.ToolStripMenuItem()
@@ -82,7 +83,7 @@ Partial Class MainFrame
Me.BTT_CONTEXT_OPEN_PATH = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_CONTEXT_OPEN_PATH = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_CONTEXT_OPEN_SITE = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_CONTEXT_OPEN_SITE = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_CONTEXT_INFO = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_CONTEXT_INFO = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_CONTEXT_DOWN_LIMITED = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_CONTEXT_READY = New System.Windows.Forms.ToolStripMenuItem()
SEP_1 = New System.Windows.Forms.ToolStripSeparator() SEP_1 = New System.Windows.Forms.ToolStripSeparator()
SEP_2 = New System.Windows.Forms.ToolStripSeparator() SEP_2 = New System.Windows.Forms.ToolStripSeparator()
CONTEXT_SEP_1 = New System.Windows.Forms.ToolStripSeparator() CONTEXT_SEP_1 = New System.Windows.Forms.ToolStripSeparator()
@@ -114,7 +115,7 @@ Partial Class MainFrame
'CONTEXT_SEP_1 'CONTEXT_SEP_1
' '
CONTEXT_SEP_1.Name = "CONTEXT_SEP_1" CONTEXT_SEP_1.Name = "CONTEXT_SEP_1"
CONTEXT_SEP_1.Size = New System.Drawing.Size(192, 6) CONTEXT_SEP_1.Size = New System.Drawing.Size(218, 6)
' '
'MENU_SETTINGS 'MENU_SETTINGS
' '
@@ -158,22 +159,22 @@ Partial Class MainFrame
'CONTEXT_SEP_2 'CONTEXT_SEP_2
' '
CONTEXT_SEP_2.Name = "CONTEXT_SEP_2" CONTEXT_SEP_2.Name = "CONTEXT_SEP_2"
CONTEXT_SEP_2.Size = New System.Drawing.Size(192, 6) CONTEXT_SEP_2.Size = New System.Drawing.Size(218, 6)
' '
'CONTEXT_SEP_3 'CONTEXT_SEP_3
' '
CONTEXT_SEP_3.Name = "CONTEXT_SEP_3" CONTEXT_SEP_3.Name = "CONTEXT_SEP_3"
CONTEXT_SEP_3.Size = New System.Drawing.Size(192, 6) CONTEXT_SEP_3.Size = New System.Drawing.Size(218, 6)
' '
'CONTEXT_SEP_4 'CONTEXT_SEP_4
' '
CONTEXT_SEP_4.Name = "CONTEXT_SEP_4" CONTEXT_SEP_4.Name = "CONTEXT_SEP_4"
CONTEXT_SEP_4.Size = New System.Drawing.Size(192, 6) CONTEXT_SEP_4.Size = New System.Drawing.Size(218, 6)
' '
'CONTEXT_SEP_5 'CONTEXT_SEP_5
' '
CONTEXT_SEP_5.Name = "CONTEXT_SEP_5" CONTEXT_SEP_5.Name = "CONTEXT_SEP_5"
CONTEXT_SEP_5.Size = New System.Drawing.Size(192, 6) CONTEXT_SEP_5.Size = New System.Drawing.Size(218, 6)
' '
'SEP_4 'SEP_4
' '
@@ -422,101 +423,107 @@ Partial Class MainFrame
' '
'USER_CONTEXT 'USER_CONTEXT
' '
Me.USER_CONTEXT.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BTT_CONTEXT_DOWN, Me.BTT_CONTEXT_DOWN_LIMITED, Me.BTT_CONTEXT_EDIT, Me.BTT_CONTEXT_DELETE, CONTEXT_SEP_1, Me.BTT_CONTEXT_FAV, Me.BTT_CONTEXT_TEMP, Me.BTT_CONTEXT_GROUPS, Me.BTT_CONTEXT_ADD_TO_COL, Me.BTT_CONTEXT_COL_MERGE, CONTEXT_SEP_2, Me.BTT_CHANGE_IMAGE, CONTEXT_SEP_3, Me.BTT_CONTEXT_OPEN_PATH, CONTEXT_SEP_4, Me.BTT_CONTEXT_OPEN_SITE, CONTEXT_SEP_5, Me.BTT_CONTEXT_INFO}) Me.USER_CONTEXT.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BTT_CONTEXT_DOWN, Me.BTT_CONTEXT_DOWN_LIMITED, Me.BTT_CONTEXT_EDIT, Me.BTT_CONTEXT_DELETE, CONTEXT_SEP_1, Me.BTT_CONTEXT_FAV, Me.BTT_CONTEXT_TEMP, Me.BTT_CONTEXT_READY, Me.BTT_CONTEXT_GROUPS, Me.BTT_CONTEXT_ADD_TO_COL, Me.BTT_CONTEXT_COL_MERGE, CONTEXT_SEP_2, Me.BTT_CHANGE_IMAGE, CONTEXT_SEP_3, Me.BTT_CONTEXT_OPEN_PATH, CONTEXT_SEP_4, Me.BTT_CONTEXT_OPEN_SITE, CONTEXT_SEP_5, Me.BTT_CONTEXT_INFO})
Me.USER_CONTEXT.Name = "USER_CONTEXT" Me.USER_CONTEXT.Name = "USER_CONTEXT"
Me.USER_CONTEXT.Size = New System.Drawing.Size(196, 342) Me.USER_CONTEXT.Size = New System.Drawing.Size(222, 364)
' '
'BTT_CONTEXT_DOWN 'BTT_CONTEXT_DOWN
' '
Me.BTT_CONTEXT_DOWN.Image = Global.SCrawler.My.Resources.Resources.StartPic_01_Green_16 Me.BTT_CONTEXT_DOWN.Image = Global.SCrawler.My.Resources.Resources.StartPic_01_Green_16
Me.BTT_CONTEXT_DOWN.Name = "BTT_CONTEXT_DOWN" Me.BTT_CONTEXT_DOWN.Name = "BTT_CONTEXT_DOWN"
Me.BTT_CONTEXT_DOWN.Size = New System.Drawing.Size(195, 22) Me.BTT_CONTEXT_DOWN.Size = New System.Drawing.Size(221, 22)
Me.BTT_CONTEXT_DOWN.Text = "Download data" Me.BTT_CONTEXT_DOWN.Text = "Download data"
' '
'BTT_CONTEXT_EDIT
'
Me.BTT_CONTEXT_EDIT.Image = Global.SCrawler.My.Resources.Resources.PencilPic_01_16
Me.BTT_CONTEXT_EDIT.Name = "BTT_CONTEXT_EDIT"
Me.BTT_CONTEXT_EDIT.Size = New System.Drawing.Size(195, 22)
Me.BTT_CONTEXT_EDIT.Text = "Edit user information"
'
'BTT_CONTEXT_DELETE
'
Me.BTT_CONTEXT_DELETE.Image = Global.SCrawler.My.Resources.Resources.Delete
Me.BTT_CONTEXT_DELETE.Name = "BTT_CONTEXT_DELETE"
Me.BTT_CONTEXT_DELETE.Size = New System.Drawing.Size(195, 22)
Me.BTT_CONTEXT_DELETE.Text = "Delete user / collection"
'
'BTT_CONTEXT_FAV
'
Me.BTT_CONTEXT_FAV.Image = Global.SCrawler.My.Resources.Resources.StarPic_24
Me.BTT_CONTEXT_FAV.Name = "BTT_CONTEXT_FAV"
Me.BTT_CONTEXT_FAV.Size = New System.Drawing.Size(195, 22)
Me.BTT_CONTEXT_FAV.Text = "Change favorite"
'
'BTT_CONTEXT_TEMP
'
Me.BTT_CONTEXT_TEMP.Image = CType(resources.GetObject("BTT_CONTEXT_TEMP.Image"), System.Drawing.Image)
Me.BTT_CONTEXT_TEMP.Name = "BTT_CONTEXT_TEMP"
Me.BTT_CONTEXT_TEMP.Size = New System.Drawing.Size(195, 22)
Me.BTT_CONTEXT_TEMP.Text = "Change temporary"
'
'BTT_CONTEXT_GROUPS
'
Me.BTT_CONTEXT_GROUPS.Name = "BTT_CONTEXT_GROUPS"
Me.BTT_CONTEXT_GROUPS.Size = New System.Drawing.Size(195, 22)
Me.BTT_CONTEXT_GROUPS.Text = "Change labels"
'
'BTT_CONTEXT_ADD_TO_COL
'
Me.BTT_CONTEXT_ADD_TO_COL.Image = Global.SCrawler.My.Resources.Resources.DBPic_32
Me.BTT_CONTEXT_ADD_TO_COL.Name = "BTT_CONTEXT_ADD_TO_COL"
Me.BTT_CONTEXT_ADD_TO_COL.Size = New System.Drawing.Size(195, 22)
Me.BTT_CONTEXT_ADD_TO_COL.Text = "Add to collection"
'
'BTT_CONTEXT_COL_MERGE
'
Me.BTT_CONTEXT_COL_MERGE.Name = "BTT_CONTEXT_COL_MERGE"
Me.BTT_CONTEXT_COL_MERGE.Size = New System.Drawing.Size(195, 22)
Me.BTT_CONTEXT_COL_MERGE.Text = "Merge collection files"
'
'BTT_CHANGE_IMAGE
'
Me.BTT_CHANGE_IMAGE.Image = Global.SCrawler.My.Resources.Resources.PicturePic_32
Me.BTT_CHANGE_IMAGE.Name = "BTT_CHANGE_IMAGE"
Me.BTT_CHANGE_IMAGE.Size = New System.Drawing.Size(195, 22)
Me.BTT_CHANGE_IMAGE.Text = "Change image"
'
'BTT_CONTEXT_OPEN_PATH
'
Me.BTT_CONTEXT_OPEN_PATH.Image = Global.SCrawler.My.Resources.Resources.Folder_32
Me.BTT_CONTEXT_OPEN_PATH.Name = "BTT_CONTEXT_OPEN_PATH"
Me.BTT_CONTEXT_OPEN_PATH.Size = New System.Drawing.Size(195, 22)
Me.BTT_CONTEXT_OPEN_PATH.Text = "Open contains folder"
'
'BTT_CONTEXT_OPEN_SITE
'
Me.BTT_CONTEXT_OPEN_SITE.Image = Global.SCrawler.My.Resources.Resources.GlobeBlue_32
Me.BTT_CONTEXT_OPEN_SITE.Name = "BTT_CONTEXT_OPEN_SITE"
Me.BTT_CONTEXT_OPEN_SITE.Size = New System.Drawing.Size(195, 22)
Me.BTT_CONTEXT_OPEN_SITE.Text = "Open site"
'
'BTT_CONTEXT_INFO
'
Me.BTT_CONTEXT_INFO.Image = Global.SCrawler.My.Resources.Resources.InfoPic_32
Me.BTT_CONTEXT_INFO.Name = "BTT_CONTEXT_INFO"
Me.BTT_CONTEXT_INFO.Size = New System.Drawing.Size(195, 22)
Me.BTT_CONTEXT_INFO.Text = "Information"
'
'BTT_CONTEXT_DOWN_LIMITED 'BTT_CONTEXT_DOWN_LIMITED
' '
Me.BTT_CONTEXT_DOWN_LIMITED.AutoToolTip = True Me.BTT_CONTEXT_DOWN_LIMITED.AutoToolTip = True
Me.BTT_CONTEXT_DOWN_LIMITED.Image = Global.SCrawler.My.Resources.Resources.StartPic_01_Green_16 Me.BTT_CONTEXT_DOWN_LIMITED.Image = Global.SCrawler.My.Resources.Resources.StartPic_01_Green_16
Me.BTT_CONTEXT_DOWN_LIMITED.Name = "BTT_CONTEXT_DOWN_LIMITED" Me.BTT_CONTEXT_DOWN_LIMITED.Name = "BTT_CONTEXT_DOWN_LIMITED"
Me.BTT_CONTEXT_DOWN_LIMITED.Size = New System.Drawing.Size(195, 22) Me.BTT_CONTEXT_DOWN_LIMITED.Size = New System.Drawing.Size(221, 22)
Me.BTT_CONTEXT_DOWN_LIMITED.Text = "Download data limited" Me.BTT_CONTEXT_DOWN_LIMITED.Text = "Download data limited"
Me.BTT_CONTEXT_DOWN_LIMITED.ToolTipText = "Download top ... posts" Me.BTT_CONTEXT_DOWN_LIMITED.ToolTipText = "Download top ... posts"
' '
'BTT_CONTEXT_EDIT
'
Me.BTT_CONTEXT_EDIT.Image = Global.SCrawler.My.Resources.Resources.PencilPic_01_16
Me.BTT_CONTEXT_EDIT.Name = "BTT_CONTEXT_EDIT"
Me.BTT_CONTEXT_EDIT.Size = New System.Drawing.Size(221, 22)
Me.BTT_CONTEXT_EDIT.Text = "Edit user information"
'
'BTT_CONTEXT_DELETE
'
Me.BTT_CONTEXT_DELETE.Image = Global.SCrawler.My.Resources.Resources.Delete
Me.BTT_CONTEXT_DELETE.Name = "BTT_CONTEXT_DELETE"
Me.BTT_CONTEXT_DELETE.Size = New System.Drawing.Size(221, 22)
Me.BTT_CONTEXT_DELETE.Text = "Delete user / collection"
'
'BTT_CONTEXT_FAV
'
Me.BTT_CONTEXT_FAV.Image = Global.SCrawler.My.Resources.Resources.StarPic_24
Me.BTT_CONTEXT_FAV.Name = "BTT_CONTEXT_FAV"
Me.BTT_CONTEXT_FAV.Size = New System.Drawing.Size(221, 22)
Me.BTT_CONTEXT_FAV.Text = "Change favorite"
'
'BTT_CONTEXT_TEMP
'
Me.BTT_CONTEXT_TEMP.Image = CType(resources.GetObject("BTT_CONTEXT_TEMP.Image"), System.Drawing.Image)
Me.BTT_CONTEXT_TEMP.Name = "BTT_CONTEXT_TEMP"
Me.BTT_CONTEXT_TEMP.Size = New System.Drawing.Size(221, 22)
Me.BTT_CONTEXT_TEMP.Text = "Change temporary"
'
'BTT_CONTEXT_GROUPS
'
Me.BTT_CONTEXT_GROUPS.Name = "BTT_CONTEXT_GROUPS"
Me.BTT_CONTEXT_GROUPS.Size = New System.Drawing.Size(221, 22)
Me.BTT_CONTEXT_GROUPS.Text = "Change labels"
'
'BTT_CONTEXT_ADD_TO_COL
'
Me.BTT_CONTEXT_ADD_TO_COL.Image = Global.SCrawler.My.Resources.Resources.DBPic_32
Me.BTT_CONTEXT_ADD_TO_COL.Name = "BTT_CONTEXT_ADD_TO_COL"
Me.BTT_CONTEXT_ADD_TO_COL.Size = New System.Drawing.Size(221, 22)
Me.BTT_CONTEXT_ADD_TO_COL.Text = "Add to collection"
'
'BTT_CONTEXT_COL_MERGE
'
Me.BTT_CONTEXT_COL_MERGE.Name = "BTT_CONTEXT_COL_MERGE"
Me.BTT_CONTEXT_COL_MERGE.Size = New System.Drawing.Size(221, 22)
Me.BTT_CONTEXT_COL_MERGE.Text = "Merge collection files"
'
'BTT_CHANGE_IMAGE
'
Me.BTT_CHANGE_IMAGE.Image = Global.SCrawler.My.Resources.Resources.PicturePic_32
Me.BTT_CHANGE_IMAGE.Name = "BTT_CHANGE_IMAGE"
Me.BTT_CHANGE_IMAGE.Size = New System.Drawing.Size(221, 22)
Me.BTT_CHANGE_IMAGE.Text = "Change image"
'
'BTT_CONTEXT_OPEN_PATH
'
Me.BTT_CONTEXT_OPEN_PATH.Image = Global.SCrawler.My.Resources.Resources.Folder_32
Me.BTT_CONTEXT_OPEN_PATH.Name = "BTT_CONTEXT_OPEN_PATH"
Me.BTT_CONTEXT_OPEN_PATH.Size = New System.Drawing.Size(221, 22)
Me.BTT_CONTEXT_OPEN_PATH.Text = "Open contains folder"
'
'BTT_CONTEXT_OPEN_SITE
'
Me.BTT_CONTEXT_OPEN_SITE.Image = Global.SCrawler.My.Resources.Resources.GlobeBlue_32
Me.BTT_CONTEXT_OPEN_SITE.Name = "BTT_CONTEXT_OPEN_SITE"
Me.BTT_CONTEXT_OPEN_SITE.Size = New System.Drawing.Size(221, 22)
Me.BTT_CONTEXT_OPEN_SITE.Text = "Open site"
'
'BTT_CONTEXT_INFO
'
Me.BTT_CONTEXT_INFO.Image = Global.SCrawler.My.Resources.Resources.InfoPic_32
Me.BTT_CONTEXT_INFO.Name = "BTT_CONTEXT_INFO"
Me.BTT_CONTEXT_INFO.Size = New System.Drawing.Size(221, 22)
Me.BTT_CONTEXT_INFO.Text = "Information"
'
'BTT_CONTEXT_READY
'
Me.BTT_CONTEXT_READY.Name = "BTT_CONTEXT_READY"
Me.BTT_CONTEXT_READY.Size = New System.Drawing.Size(221, 22)
Me.BTT_CONTEXT_READY.Text = "Change ready for download"
'
'MainFrame 'MainFrame
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@@ -586,4 +593,5 @@ Partial Class MainFrame
Private WithEvents BTT_CONTEXT_GROUPS As ToolStripMenuItem Private WithEvents BTT_CONTEXT_GROUPS As ToolStripMenuItem
Private WithEvents BTT_VERSION_INFO As ToolStripButton Private WithEvents BTT_VERSION_INFO As ToolStripButton
Private WithEvents BTT_CONTEXT_DOWN_LIMITED As ToolStripMenuItem Private WithEvents BTT_CONTEXT_DOWN_LIMITED As ToolStripMenuItem
Private WithEvents BTT_CONTEXT_READY As ToolStripMenuItem
End Class End Class

View File

@@ -1,4 +1,12 @@
Imports System.ComponentModel ' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports System.ComponentModel
Imports System.Globalization Imports System.Globalization
Imports System.Threading Imports System.Threading
Imports PersonalUtilities.Forms Imports PersonalUtilities.Forms
@@ -162,6 +170,17 @@ CloseResume:
Case View.SmallIcon : .SmallImageList.Images.Add(User.LVIKey, User.GetPicture()) Case View.SmallIcon : .SmallImageList.Images.Add(User.LVIKey, User.GetPicture())
End Select End Select
.Items.Add(User.GetLVI(LIST_PROFILES)) .Items.Add(User.GetLVI(LIST_PROFILES))
If Not User.Exists Then
With .Items(.Items.Count - 1)
.BackColor = ColorBttDeleteBack
.ForeColor = ColorBttDeleteFore
End With
ElseIf User.Suspended Then
With .Items(.Items.Count - 1)
.BackColor = ColorBttEditBack
.ForeColor = ColorBttEditFore
End With
End If
End With End With
End Sub End Sub
Else Else
@@ -180,6 +199,16 @@ CloseResume:
End Select End Select
.Items(i).Text = User.ToString .Items(i).Text = User.ToString
.Items(i).Group = User.GetLVIGroup(LIST_PROFILES) .Items(i).Group = User.GetLVIGroup(LIST_PROFILES)
If Not User.Exists Then
.Items(i).BackColor = ColorBttDeleteBack
.Items(i).ForeColor = ColorBttDeleteFore
ElseIf User.Suspended Then
.Items(i).BackColor = ColorBttEditBack
.Items(i).ForeColor = ColorBttEditFore
Else
.Items(i).BackColor = SystemColors.Window
.Items(i).ForeColor = SystemColors.WindowText
End If
End If End If
End With End With
End Sub End Sub
@@ -231,7 +260,7 @@ CloseResume:
Private Sub BTT_ADD_USER_Click(sender As Object, e As EventArgs) Handles BTT_ADD_USER.Click Private Sub BTT_ADD_USER_Click(sender As Object, e As EventArgs) Handles BTT_ADD_USER.Click
Using f As New UserCreatorForm Using f As New UserCreatorForm
f.ShowDialog() f.ShowDialog()
If f.DialogResult = DialogResult.OK Then If f.DialogResult = DialogResult.OK Or f.StartIndex >= 0 Then
Dim i% Dim i%
If f.StartIndex >= 0 Then If f.StartIndex >= 0 Then
OnUsersAddedHandler(f.StartIndex) OnUsersAddedHandler(f.StartIndex)
@@ -246,9 +275,11 @@ CloseResume:
.Temporary = f.UserTemporary .Temporary = f.UserTemporary
.ParseUserMediaOnly = f.UserMediaOnly .ParseUserMediaOnly = f.UserMediaOnly
.ReadyForDownload = f.UserReady .ReadyForDownload = f.UserReady
.DownloadImages = f.DownloadImages
.DownloadVideos = f.DownloadVideos
.FriendlyName = f.UserFriendly .FriendlyName = f.UserFriendly
.Description = f.UserDescr .Description = f.UserDescr
.Labels.ListAddList(f.UserLabels, LAP.ClearBeforeAdd, LAP.NotContainsOnly) .Self.Labels.ListAddList(f.UserLabels, LAP.ClearBeforeAdd, LAP.NotContainsOnly)
.UpdateUserInformation() .UpdateUserInformation()
End With End With
UserListUpdate(Settings.Users(Settings.Users.Count - 1), True) UserListUpdate(Settings.Users(Settings.Users.Count - 1), True)
@@ -403,7 +434,7 @@ CloseResume:
End If End If
End If End If
Settings.ShowingMode.Value = m Settings.ShowingMode.Value = m
If Not m = ShowingModes.All Then BTT_DOWN_ALL.Enabled = False BTT_DOWN_ALL.Enabled = m = ShowingModes.All
End Sub End Sub
Private Sub BTT_SELECT_LABELS_Click(sender As Object, e As EventArgs) Handles BTT_SELECT_LABELS.Click Private Sub BTT_SELECT_LABELS_Click(sender As Object, e As EventArgs) Handles BTT_SELECT_LABELS.Click
OpenLabelsForm() OpenLabelsForm()
@@ -483,6 +514,16 @@ CloseResume:
End Sub) End Sub)
End If End If
End Sub End Sub
Private Sub BTT_CONTEXT_READY_Click(sender As Object, e As EventArgs) Handles BTT_CONTEXT_READY.Click
Dim users As List(Of IUserData) = GetSelectedUserArray()
If AskForMassReplace(users, "Ready for download") Then
Dim r As Boolean = MsgBoxE({"What state do you want to set for selected users", "Select ready state"}, vbQuestion,,, {"Not Ready", "Ready"}).Index
users.ForEach(Sub(u)
u.ReadyForDownload = r
u.UpdateUserInformation()
End Sub)
End If
End Sub
Private Sub BTT_CONTEXT_GROUPS_Click(sender As Object, e As EventArgs) Handles BTT_CONTEXT_GROUPS.Click Private Sub BTT_CONTEXT_GROUPS_Click(sender As Object, e As EventArgs) Handles BTT_CONTEXT_GROUPS.Click
Try Try
Dim users As List(Of IUserData) = GetSelectedUserArray() Dim users As List(Of IUserData) = GetSelectedUserArray()
@@ -500,7 +541,7 @@ CloseResume:
If .Count > 0 Then .Collections.ForEach(Sub(uu) uu.Labels.ListAddList(f.LabelsList, lp)) If .Count > 0 Then .Collections.ForEach(Sub(uu) uu.Labels.ListAddList(f.LabelsList, lp))
End With End With
Else Else
u.Labels.ListAddList(f.LabelsList, lp) u.Self.Labels.ListAddList(f.LabelsList, lp)
End If End If
u.UpdateUserInformation() u.UpdateUserInformation()
End Sub) End Sub)
@@ -599,7 +640,7 @@ CloseResume:
End Sub End Sub
Private Sub BTT_CONTEXT_INFO_Click(sender As Object, e As EventArgs) Handles BTT_CONTEXT_INFO.Click Private Sub BTT_CONTEXT_INFO_Click(sender As Object, e As EventArgs) Handles BTT_CONTEXT_INFO.Click
Dim user As IUserData = GetSelectedUser() Dim user As IUserData = GetSelectedUser()
If Not user Is Nothing Then MsgBoxE(DirectCast(user, UserDataBase).GetUserInformation()) If Not user Is Nothing Then MsgBoxE(DirectCast(user.Self, UserDataBase).GetUserInformation())
End Sub End Sub
Private Sub USER_CONTEXT_VisibleChanged(sender As Object, e As EventArgs) Handles USER_CONTEXT.VisibleChanged Private Sub USER_CONTEXT_VisibleChanged(sender As Object, e As EventArgs) Handles USER_CONTEXT.VisibleChanged
Try Try
@@ -688,7 +729,7 @@ CloseResume:
On Error Resume Next On Error Resume Next
If user.IsCollection Then If user.IsCollection Then
If USER_CONTEXT.Visible Then USER_CONTEXT.Hide() If USER_CONTEXT.Visible Then USER_CONTEXT.Hide()
MsgBoxE("This is collection!{vbNewLine}Edit collections does not allowed!", vbExclamation) MsgBoxE($"This is collection!{vbNewLine}Edit collections does not allowed!", vbExclamation)
Else Else
Using f As New UserCreatorForm(user) Using f As New UserCreatorForm(user)
f.ShowDialog() f.ShowDialog()
@@ -798,7 +839,7 @@ ResumeDownloadingOperation:
If Not user Is Nothing Then user.OpenFolder() If Not user Is Nothing Then user.OpenFolder()
End Sub End Sub
#End Region #End Region
Friend Sub User_OnPictureUpdated(ByVal User As IUserData) Friend Sub User_OnUserUpdated(ByVal User As IUserData)
UserListUpdate(User, False) UserListUpdate(User, False)
End Sub End Sub
Private _LogVisible As Boolean = False Private _LogVisible As Boolean = False
@@ -812,7 +853,7 @@ ResumeDownloadingOperation:
End If End If
End Sub End Sub
Private Sub Downloader_OnDownloading(ByVal Value As Boolean) Private Sub Downloader_OnDownloading(ByVal Value As Boolean)
Dim a As Action = Sub() BTT_DOWN_STOP.Enabled = Not Value Dim a As Action = Sub() BTT_DOWN_STOP.Enabled = Value
If Toolbar_TOP.InvokeRequired Then Toolbar_TOP.Invoke(a) Else a.Invoke If Toolbar_TOP.InvokeRequired Then Toolbar_TOP.Invoke(a) Else a.Invoke
End Sub End Sub
End Class End Class

View File

@@ -1,11 +1,19 @@
Imports PersonalUtilities.Functions.XML ' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports PersonalUtilities.Functions.XML
Imports SCrawler.API Imports SCrawler.API
Imports SCrawler.API.Base Imports SCrawler.API.Base
Friend Module MainMod Friend Module MainMod
Friend Settings As SettingsCLS Friend Settings As SettingsCLS
Friend Const SettingsFolderName As String = "Settings" Friend Const SettingsFolderName As String = "Settings"
Friend ReadOnly LinkPattern As New RegexStructure("[htps:]{0,6}[/]{0,2}(.+)", 1) Friend ReadOnly LinkPattern As New RegexStructure("[htps:]{0,6}[/]{0,2}(.+)", 1)
Friend ReadOnly FilesPattern As New RegexStructure("[^\./]+?\.\w+", True, False, 1) Friend ReadOnly FilesPattern As New RegexStructure("[^\./]+?\.\w+", True, False, 1,,,, String.Empty, EDP.ReturnValue)
Friend Const LVI_TempOption As String = "Temp" Friend Const LVI_TempOption As String = "Temp"
Friend Const LVI_FavOption As String = "Favorite" Friend Const LVI_FavOption As String = "Favorite"
Friend Const CannelsLabelName As String = "Channels" Friend Const CannelsLabelName As String = "Channels"
@@ -27,6 +35,17 @@ Friend Module MainMod
Friend InfoForm As DownloadedInfoForm Friend InfoForm As DownloadedInfoForm
Friend VideoDownloader As VideosDownloaderForm Friend VideoDownloader As VideosDownloaderForm
Friend ReadOnly ParsersDataDateProvider As New ADateTime(ADateTime.Formats.BaseDateTime) Friend ReadOnly ParsersDataDateProvider As New ADateTime(ADateTime.Formats.BaseDateTime)
#Region "File name operations"
Friend FileDateAppenderProvider As IFormatProvider
''' <summary>File, Date</summary>
Friend FileDateAppenderPattern As String
Friend Class NumberedFile : Inherits SFileNumbers
Friend Sub New(ByVal f As SFile)
FileName = f.Name
NumberProvider = New ANumbers With {.FormatMode = ANumbers.Formats.NumberGroup, .GroupSize = 5}
End Sub
End Class
#End Region
Friend Property MainProgress As PersonalUtilities.Forms.Toolbars.MyProgress Friend Property MainProgress As PersonalUtilities.Forms.Toolbars.MyProgress
Friend Function GetLviGroupName(ByVal Site As Sites, ByVal Temp As Boolean, ByVal Fav As Boolean, ByVal IsCollection As Boolean) As String Friend Function GetLviGroupName(ByVal Site As Sites, ByVal Temp As Boolean, ByVal Fav As Boolean, ByVal IsCollection As Boolean) As String
Dim Opt$ = String.Empty Dim Opt$ = String.Empty
@@ -144,6 +163,7 @@ Friend Module MainMod
} }
End Function End Function
End Structure End Structure
#Region "Image Handlers management"
Friend Sub ImageHandler(ByVal User As IUserData) Friend Sub ImageHandler(ByVal User As IUserData)
ImageHandler(User, False) ImageHandler(User, False)
ImageHandler(User, True) ImageHandler(User, True)
@@ -151,9 +171,9 @@ Friend Module MainMod
Friend Sub ImageHandler(ByVal User As IUserData, ByVal Add As Boolean) Friend Sub ImageHandler(ByVal User As IUserData, ByVal Add As Boolean)
Try Try
If Add Then If Add Then
AddHandler User.OnPictureUpdated, AddressOf MainFrame.User_OnPictureUpdated AddHandler User.Self.OnUserUpdated, AddressOf MainFrame.User_OnUserUpdated
Else Else
RemoveHandler User.OnPictureUpdated, AddressOf MainFrame.User_OnPictureUpdated RemoveHandler User.Self.OnUserUpdated, AddressOf MainFrame.User_OnUserUpdated
End If End If
Catch ex As Exception Catch ex As Exception
End Try End Try
@@ -164,6 +184,8 @@ Friend Module MainMod
Catch ex As Exception Catch ex As Exception
End Try End Try
End Sub End Sub
#End Region
#Region "Standalone video download functions"
Friend Function GetCurrentBuffer() As String Friend Function GetCurrentBuffer() As String
Dim b$ = BufferText Dim b$ = BufferText
If Not (Not b.IsEmptyString AndAlso b.Length > 4 AndAlso b.StartsWith("http")) Then b = String.Empty If Not (Not b.IsEmptyString AndAlso b.Length > 4 AndAlso b.StartsWith("http")) Then b = String.Empty
@@ -245,6 +267,8 @@ Friend Module MainMod
Return ErrorsDescriber.Execute(e, ex, "Downloading video by URL error", False) Return ErrorsDescriber.Execute(e, ex, "Downloading video by URL error", False)
End Try End Try
End Function End Function
#End Region
#Region "Blacklist Support"
Friend Structure UserBan Friend Structure UserBan
Friend ReadOnly Name As String Friend ReadOnly Name As String
Friend ReadOnly Reason As String Friend ReadOnly Reason As String
@@ -330,4 +354,5 @@ Friend Module MainMod
Friend Function UserBanned(ByVal UserName As String) As Boolean Friend Function UserBanned(ByVal UserName As String) As Boolean
Return UserBanned({UserName}).ListExists Return UserBanned({UserName}).ListExists
End Function End Function
#End Region
End Module End Module

View File

@@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below: ' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.0.1")> <Assembly: AssemblyVersion("1.0.1.0")>
<Assembly: AssemblyFileVersion("1.0.0.1")> <Assembly: AssemblyFileVersion("1.0.1.0")>
<Assembly: NeutralResourcesLanguage("en")> <Assembly: NeutralResourcesLanguage("en")>

View File

@@ -14,6 +14,7 @@
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl> <PublishUrl>publish\</PublishUrl>
<Install>true</Install> <Install>true</Install>
<InstallFrom>Disk</InstallFrom> <InstallFrom>Disk</InstallFrom>
@@ -26,7 +27,6 @@
<MapFileExtensions>true</MapFileExtensions> <MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision> <ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion> <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled> <BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup> </PropertyGroup>
@@ -267,6 +267,7 @@
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include=".editorconfig" />
<None Include="My Project\app.manifest" /> <None Include="My Project\app.manifest" />
<None Include="My Project\Application.myapp"> <None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator> <Generator>MyApplicationCodeGenerator</Generator>

View File

@@ -1,9 +1,18 @@
Imports PersonalUtilities.Functions.XML ' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports PersonalUtilities.Functions.XML
Imports PersonalUtilities.Functions.XML.Base Imports PersonalUtilities.Functions.XML.Base
Imports SCrawler.API Imports SCrawler.API
Imports SCrawler.API.Base Imports SCrawler.API.Base
Friend Class SettingsCLS : Implements IDisposable Friend Class SettingsCLS : Implements IDisposable
Friend Const DefaultMaxDownloadingTasks As Integer = 5 Friend Const DefaultMaxDownloadingTasks As Integer = 5
Friend Const Name_Node_Sites As String = "Sites"
Friend ReadOnly Design As XmlFile Friend ReadOnly Design As XmlFile
Private ReadOnly MyXML As XmlFile Private ReadOnly MyXML As XmlFile
Friend ReadOnly OS64 As Boolean Friend ReadOnly OS64 As Boolean
@@ -27,8 +36,7 @@ Friend Class SettingsCLS : Implements IDisposable
FfmpegFile = "ffmpeg.exe" FfmpegFile = "ffmpeg.exe"
FfmpegExists = FfmpegFile.Exists FfmpegExists = FfmpegFile.Exists
If OS64 And Not FfmpegExists Then MsgBoxE("[ffmpeg.exe] is missing", vbExclamation) If OS64 And Not FfmpegExists Then MsgBoxE("[ffmpeg.exe] is missing", vbExclamation)
Design = New XmlFile("Settings\Design.xml") Design = New XmlFile("Settings\Design.xml", Protector.Modes.All)
Design.DefaultsLoading(False)
MyXML = New XmlFile(Nothing) With {.AutoUpdateFile = True} MyXML = New XmlFile(Nothing) With {.AutoUpdateFile = True}
Users = New List(Of IUserData) Users = New List(Of IUserData)
UsersList = New List(Of UserInfo) UsersList = New List(Of UserInfo)
@@ -44,8 +52,43 @@ Friend Class SettingsCLS : Implements IDisposable
SeparateVideoFolder = New XMLValue(Of Boolean)("SeparateVideoFolder", True, MyXML) SeparateVideoFolder = New XMLValue(Of Boolean)("SeparateVideoFolder", True, MyXML)
CollectionsPath = New XMLValue(Of String)("CollectionsPath", "Collections", MyXML) CollectionsPath = New XMLValue(Of String)("CollectionsPath", "Collections", MyXML)
DefaultTemporary = New XMLValue(Of Boolean)("DefaultTemporary", False, MyXML)
MaxUsersJobsCount = New XMLValue(Of Integer)("MaxUsersJobsCount", DefaultMaxDownloadingTasks, MyXML) Dim n() As String = {"Defaults"}
DefaultTemporary = New XMLValue(Of Boolean)("Temporary", False, MyXML, n)
DefaultTemporary.ReplaceByValue("DefaultTemporary")
DefaultDownloadImages = New XMLValue(Of Boolean)("DownloadImages", True, MyXML, n)
DefaultDownloadImages.ReplaceByValue("DefaultDownloadImages")
DefaultDownloadVideos = New XMLValue(Of Boolean)("DownloadVideos", True, MyXML, n)
DefaultDownloadVideos.ReplaceByValue("DefaultDownloadVideos")
ChangeReadyForDownOnTempChange = New XMLValue(Of Boolean)("ChangeReadyForDownOnTempChange", True, MyXML, n)
n = {Name_Node_Sites, Sites.Reddit.ToString}
RedditTemporary = New XMLValue(Of Boolean)
RedditTemporary.SetExtended("Temporary", False, MyXML, n)
RedditTemporary.SetDefault(DefaultTemporary)
RedditDownloadImages = New XMLValue(Of Boolean)
RedditDownloadImages.SetExtended("DownloadImages", True, MyXML, n)
RedditDownloadImages.SetDefault(DefaultDownloadImages)
RedditDownloadVideos = New XMLValue(Of Boolean)
RedditDownloadVideos.SetExtended("DownloadVideos", True, MyXML, n)
RedditDownloadVideos.SetDefault(DefaultDownloadVideos)
n = {Name_Node_Sites, Sites.Twitter.ToString}
TwitterTemporary = New XMLValue(Of Boolean)
TwitterTemporary.SetExtended("Temporary", False, MyXML, n)
TwitterTemporary.SetDefault(DefaultTemporary)
TwitterDownloadImages = New XMLValue(Of Boolean)
TwitterDownloadImages.SetExtended("DownloadImages", True, MyXML, n)
TwitterDownloadImages.SetDefault(DefaultDownloadImages)
TwitterDownloadVideos = New XMLValue(Of Boolean)
TwitterDownloadVideos.SetExtended("DownloadVideos", True, MyXML, n)
TwitterDownloadVideos.SetDefault(DefaultDownloadVideos)
TwitterDefaultGetUserMedia = New XMLValue(Of Boolean)("TwitterDefaultGetUserMedia", True, MyXML, n)
MaxLargeImageHeigh = New XMLValue(Of Integer)("MaxLargeImageHeigh", 150, MyXML) MaxLargeImageHeigh = New XMLValue(Of Integer)("MaxLargeImageHeigh", 150, MyXML)
MaxSmallImageHeigh = New XMLValue(Of Integer)("MaxSmallImageHeigh", 15, MyXML) MaxSmallImageHeigh = New XMLValue(Of Integer)("MaxSmallImageHeigh", 15, MyXML)
@@ -57,48 +100,91 @@ Friend Class SettingsCLS : Implements IDisposable
LatestSelectedLabels = New XMLValue(Of String)("LatestSelectedLabels",, MyXML) LatestSelectedLabels = New XMLValue(Of String)("LatestSelectedLabels",, MyXML)
LatestSelectedChannel = New XMLValue(Of String)("LatestSelectedChannel",, MyXML) LatestSelectedChannel = New XMLValue(Of String)("LatestSelectedChannel",, MyXML)
ChannelsImagesRows = New XMLValue(Of Integer)("ChannelsImagesRows", 2, MyXML) n = {Name_Node_Sites, "Channels"}
ChannelsImagesColumns = New XMLValue(Of Integer)("ChannelsImagesColumns", 5, MyXML) ChannelsDefaultReadyForDownload = New XMLValue(Of Boolean)("ChannelsDefaultReadyForDownload", False, MyXML, n)
ChannelsHideExistsUser = New XMLValue(Of Boolean)("ChannelsHideExistsUser", True, MyXML) ChannelsDefaultTemporary = New XMLValue(Of Boolean)("ChannelsDefaultTemporary", True, MyXML, n)
ChannelsMaxJobsCount = New XMLValue(Of Integer)("ChannelsMaxJobsCount", DefaultMaxDownloadingTasks, MyXML) ChannelsRegularCheckMD5 = New XMLValue(Of Boolean)("ChannelsRegularCheckMD5", False, MyXML, n)
FromChannelDownloadTop = New XMLValue(Of Integer)("FromChannelDownloadTop", 10, MyXML) ChannelsImagesRows = New XMLValue(Of Integer)("ImagesRows", 2, MyXML, n)
FromChannelDownloadTopUse = New XMLValue(Of Boolean)("FromChannelDownloadTopUse", False, MyXML) ChannelsImagesRows.ReplaceByValue("ChannelsImagesRows")
FromChannelCopyImageToUser = New XMLValue(Of Boolean)("FromChannelCopyImageToUser", True, MyXML) ChannelsImagesColumns = New XMLValue(Of Integer)("ImagesColumns", 5, MyXML, n)
ChannelsImagesColumns.ReplaceByValue("ChannelsImagesColumns")
ChannelsHideExistsUser = New XMLValue(Of Boolean)("HideExistsUser", True, MyXML, n)
ChannelsHideExistsUser.ReplaceByValue("ChannelsHideExistsUser")
ChannelsMaxJobsCount = New XMLValue(Of Integer)("MaxJobsCount", DefaultMaxDownloadingTasks, MyXML, n)
ChannelsMaxJobsCount.ReplaceByValue("ChannelsMaxJobsCount")
n = {"Users"}
FromChannelDownloadTop = New XMLValue(Of Integer)("FromChannelDownloadTop", 10, MyXML, n)
FromChannelDownloadTop.ReplaceByValue("FromChannelDownloadTop")
FromChannelDownloadTopUse = New XMLValue(Of Boolean)("FromChannelDownloadTopUse", False, MyXML, n)
FromChannelDownloadTopUse.ReplaceByValue("FromChannelDownloadTopUse")
FromChannelCopyImageToUser = New XMLValue(Of Boolean)("FromChannelCopyImageToUser", True, MyXML, n)
FromChannelCopyImageToUser.ReplaceByValue("FromChannelCopyImageToUser")
n = {"Users", "FileName"}
MaxUsersJobsCount = New XMLValue(Of Integer)("MaxJobsCount", DefaultMaxDownloadingTasks, MyXML, n)
MaxUsersJobsCount.ReplaceByValue("MaxUsersJobsCount")
FileAddDateToFileName = New XMLValue(Of Boolean)("FileAddDateToFileName", False, MyXML, n) With {.OnChangeFunction = AddressOf ChangeDateProvider}
FileAddDateToFileName.ReplaceByValue("FileAddDateToFileName")
FileAddTimeToFileName = New XMLValue(Of Boolean)("FileAddTimeToFileName", False, MyXML, n) With {.OnChangeFunction = AddressOf ChangeDateProvider}
FileAddTimeToFileName.ReplaceByValue("FileAddTimeToFileName")
FileDateTimePositionEnd = New XMLValue(Of Boolean)("FileDateTimePositionEnd", True, MyXML, n) With {.OnChangeFunction = AddressOf ChangeDateProvider}
FileDateTimePositionEnd.ReplaceByValue("FileDateTimePositionEnd")
FileReplaceNameByDate = New XMLValue(Of Boolean)("FileReplaceNameByDate", False, MyXML, n)
FileReplaceNameByDate.ReplaceByValue("FileReplaceNameByDate")
CheckUpdatesAtStart = New XMLValue(Of Boolean)("CheckUpdatesAtStart", True, MyXML) CheckUpdatesAtStart = New XMLValue(Of Boolean)("CheckUpdatesAtStart", True, MyXML)
ShowNewVersionNotification = New XMLValue(Of Boolean)("ShowNewVersionNotification", True, MyXML) ShowNewVersionNotification = New XMLValue(Of Boolean)("ShowNewVersionNotification", True, MyXML)
LatestVersion = New XMLValue(Of String)("LatestVersion", String.Empty, MyXML) LatestVersion = New XMLValue(Of String)("LatestVersion", String.Empty, MyXML)
MyXML.DefaultsLoading(False) If MyXML.ChangesDetected Then MyXML.Sort() : MyXML.UpdateData()
If MyXML.ChangesDetected Then MyXML.UpdateData()
Labels = New LabelsKeeper Labels = New LabelsKeeper
If Not LatestSelectedLabels.IsEmptyString Then Labels.CurrentSelection.ListAddList(LatestSelectedLabels.Value.StringToList(Of String, List(Of String))("|")) If Not LatestSelectedLabels.IsEmptyString Then Labels.CurrentSelection.ListAddList(LatestSelectedLabels.Value.StringToList(Of String, List(Of String))("|"))
If BlackListFile.Exists Then If BlackListFile.Exists Then
BlackList.ListAddList(IO.File.ReadAllLines(BlackListFile), LAP.NotContainsOnly) BlackList.ListAddList(IO.File.ReadAllLines(BlackListFile), LAP.NotContainsOnly)
If BlackList.Count > 0 Then BlackList.RemoveAll(Function(b) Not b.Exists) If BlackList.Count > 0 Then BlackList.RemoveAll(Function(b) Not b.Exists)
End If End If
_UpdatesSuspended = False
ChangeDateProvider(Nothing, Nothing, Nothing)
End Sub
Private Sub ChangeDateProvider(ByVal Sender As Object, ByVal Name As String, ByVal Value As Object)
If Not _UpdatesSuspended Then
Dim p$ = String.Empty
If FileAddDateToFileName Then p = "yyyyMMdd"
If FileAddTimeToFileName Then p.StringAppend("HHmmss", "_")
If Not p.IsEmptyString Then FileDateAppenderProvider = New ADateTime(p) Else FileDateAppenderProvider = New ADateTime("yyyyMMdd_HHmmss")
If FileDateTimePositionEnd Then FileDateAppenderPattern = "{0}_{1}" Else FileDateAppenderPattern = "{1}_{0}"
End If
End Sub End Sub
Friend Sub LoadUsers() Friend Sub LoadUsers()
Try Try
Users.Clear() Users.Clear()
If UsersSettingsFile.Exists Then If UsersSettingsFile.Exists Then
Using x As New XmlFile(UsersSettingsFile, ProtectionLevels.All, False) With {.AllowSameNames = True} Using x As New XmlFile(UsersSettingsFile, Protector.Modes.All, False) With {.AllowSameNames = True}
x.LoadData() x.LoadData()
x.DefaultsLoading(False)
If x.Count > 0 Then x.ForEach(Sub(xx) UsersList.Add(xx)) If x.Count > 0 Then x.ForEach(Sub(xx) UsersList.Add(xx))
End Using End Using
Dim PNC As Func(Of UserInfo, Boolean) = Function(u) Not u.IncludedInCollection Dim PNC As Func(Of UserInfo, Boolean) = Function(u) Not u.IncludedInCollection
Dim NeedUpdate As Boolean = False
If UsersList.Count > 0 Then If UsersList.Count > 0 Then
Dim cUsers As List(Of UserInfo) = UsersList.Where(Function(u) u.IncludedInCollection).ToList Dim cUsers As List(Of UserInfo) = UsersList.Where(Function(u) u.IncludedInCollection).ToList
If cUsers.ListExists Then If cUsers.ListExists Then
Dim d As New Dictionary(Of SFile, List(Of UserInfo)) Dim d As New Dictionary(Of SFile, List(Of UserInfo))
cUsers = cUsers.ListForEachCopy(Of List(Of UserInfo))(Function(ByVal f As UserInfo, ByVal f_indx As Integer) As UserInfo cUsers = cUsers.ListForEachCopy(Of List(Of UserInfo))(Function(ByVal f As UserInfo, ByVal f_indx As Integer) As UserInfo
If Not d.ContainsKey(f.File.CutPath(2).Path) Then Dim m% = IIf(f.Merged, 1, 2)
d.Add(f.File.CutPath(2).Path, New List(Of UserInfo) From {f}) If SFile.GetPath(f.File.CutPath(m - 1).Path).Exists(SFO.Path, False) Then
Dim fp As SFile = SFile.GetPath(f.File.CutPath(m).Path)
If Not d.ContainsKey(fp) Then
d.Add(fp, New List(Of UserInfo) From {f})
Else Else
d(f.File.CutPath(2).Path).Add(f) d(f.File.CutPath(m).Path).Add(f)
End If End If
Return f Return f
Else
NeedUpdate = True
UsersList.Remove(f)
Return Nothing
End If
End Function, True) End Function, True)
Dim v% Dim v%
If d.Count > 0 Then If d.Count > 0 Then
@@ -120,8 +206,8 @@ Friend Class SettingsCLS : Implements IDisposable
t.Clear() t.Clear()
Dim du As List(Of UserInfo) = (From u As IUserData In Users Dim du As List(Of UserInfo) = (From u As IUserData In Users
Where Not u.IsCollection AndAlso Not u.FileExists Where Not u.IsCollection AndAlso Not u.FileExists
Select DirectCast(u, UserDataBase).User).ToList Select DirectCast(u.Self, UserDataBase).User).ToList
If Not du Is Nothing AndAlso du.Count > 0 Then du.ForEach(Sub(u) UsersList.Remove(u)) : du.Clear() If du.ListExists Then du.ForEach(Sub(u) UsersList.Remove(u)) : du.Clear()
Users.ListDisposeRemoveAll(Function(ByVal u As IUserData) As Boolean Users.ListDisposeRemoveAll(Function(ByVal u As IUserData) As Boolean
If u.IsCollection Then If u.IsCollection Then
With DirectCast(u, UserDataBind) With DirectCast(u, UserDataBind)
@@ -140,6 +226,7 @@ Friend Class SettingsCLS : Implements IDisposable
End If End If
End Function) End Function)
End If End If
If NeedUpdate Then UpdateUsersList()
End If End If
If Users.Count > 0 Then If Users.Count > 0 Then
Labels.ToList.ListAddList(Users.SelectMany(Function(u) u.Labels), LAP.NotContainsOnly) Labels.ToList.ListAddList(Users.SelectMany(Function(u) u.Labels), LAP.NotContainsOnly)
@@ -148,6 +235,12 @@ Friend Class SettingsCLS : Implements IDisposable
Catch ex As Exception Catch ex As Exception
End Try End Try
End Sub End Sub
Private _UserListUpdateRequired As Boolean = False
Friend ReadOnly Property UserListUpdateRequired As Boolean
Get
Return _UserListUpdateRequired
End Get
End Property
Friend Overloads Sub UpdateUsersList(ByVal u As UserInfo) Friend Overloads Sub UpdateUsersList(ByVal u As UserInfo)
Dim i% = UsersList.IndexOf(u) Dim i% = UsersList.IndexOf(u)
If i >= 0 Then If i >= 0 Then
@@ -158,13 +251,17 @@ Friend Class SettingsCLS : Implements IDisposable
UpdateUsersList() UpdateUsersList()
End Sub End Sub
Friend Overloads Sub UpdateUsersList() Friend Overloads Sub UpdateUsersList()
Try
If UsersList.Count > 0 Then If UsersList.Count > 0 Then
Using x As New XmlFile With {.AllowSameNames = True, .Name = "Users"} Using x As New XmlFile With {.AllowSameNames = True, .Name = "Users"}
x.DefaultsLoading(False)
UsersList.ForEach(Sub(u) x.Add(u.GetContainer())) UsersList.ForEach(Sub(u) x.Add(u.GetContainer()))
x.Save(UsersSettingsFile) x.Save(UsersSettingsFile)
End Using End Using
End If End If
_UserListUpdateRequired = False
Catch ex As Exception
_UserListUpdateRequired = True
End Try
End Sub End Sub
Friend Sub UpdateBlackList() Friend Sub UpdateBlackList()
If BlackList.Count > 0 Then If BlackList.Count > 0 Then
@@ -192,12 +289,16 @@ Friend Class SettingsCLS : Implements IDisposable
Friend Overloads Function UserExists(ByVal _User As UserInfo) As Boolean Friend Overloads Function UserExists(ByVal _User As UserInfo) As Boolean
Return UserExists(_User.Site, _User.Name) Return UserExists(_User.Site, _User.Name)
End Function End Function
Private _UpdatesSuspended As Boolean = True
Friend Sub BeginUpdate() Friend Sub BeginUpdate()
MyXML.BeginUpdate() MyXML.BeginUpdate()
_UpdatesSuspended = True
End Sub End Sub
Friend Sub EndUpdate() Friend Sub EndUpdate()
MyXML.EndUpdate() MyXML.EndUpdate()
If MyXML.ChangesDetected Then MyXML.UpdateData() If MyXML.ChangesDetected Then MyXML.UpdateData()
_UpdatesSuspended = False
ChangeDateProvider(Nothing, Nothing, Nothing)
End Sub End Sub
Friend ReadOnly Property Site(ByVal s As Sites) As SiteSettings Friend ReadOnly Property Site(ByVal s As Sites) As SiteSettings
Get Get
@@ -216,8 +317,35 @@ Friend Class SettingsCLS : Implements IDisposable
End If End If
End Get End Get
End Property End Property
Friend ReadOnly Property DefaultTemporary As XMLValue(Of Boolean)
Friend ReadOnly Property MaxUsersJobsCount As XMLValue(Of Integer) Friend ReadOnly Property MaxUsersJobsCount As XMLValue(Of Integer)
#Region "Defaults"
Friend ReadOnly Property DefaultTemporary As XMLValue(Of Boolean)
Friend ReadOnly Property DefaultDownloadImages As XMLValue(Of Boolean)
Friend ReadOnly Property DefaultDownloadVideos As XMLValue(Of Boolean)
Friend ReadOnly Property ChangeReadyForDownOnTempChange As XMLValue(Of Boolean)
#Region "Reddit"
Friend ReadOnly Property RedditTemporary As XMLValue(Of Boolean)
Friend ReadOnly Property RedditDownloadImages As XMLValue(Of Boolean)
Friend ReadOnly Property RedditDownloadVideos As XMLValue(Of Boolean)
#End Region
#Region "Twitter"
Friend ReadOnly Property TwitterTemporary As XMLValue(Of Boolean)
Friend ReadOnly Property TwitterDownloadImages As XMLValue(Of Boolean)
Friend ReadOnly Property TwitterDownloadVideos As XMLValue(Of Boolean)
Friend ReadOnly Property TwitterDefaultGetUserMedia As XMLValue(Of Boolean)
#End Region
#End Region
#Region "User data"
Friend ReadOnly Property FromChannelDownloadTop As XMLValue(Of Integer)
Friend ReadOnly Property FromChannelDownloadTopUse As XMLValue(Of Boolean)
Friend ReadOnly Property FromChannelCopyImageToUser As XMLValue(Of Boolean)
#Region "File naming"
Friend ReadOnly Property FileAddDateToFileName As XMLValue(Of Boolean)
Friend ReadOnly Property FileAddTimeToFileName As XMLValue(Of Boolean)
Friend ReadOnly Property FileDateTimePositionEnd As XMLValue(Of Boolean)
Friend ReadOnly Property FileReplaceNameByDate As XMLValue(Of Boolean)
#End Region
#End Region
#Region "View" #Region "View"
Friend ReadOnly Property MaxLargeImageHeigh As XMLValue(Of Integer) Friend ReadOnly Property MaxLargeImageHeigh As XMLValue(Of Integer)
Friend ReadOnly Property MaxSmallImageHeigh As XMLValue(Of Integer) Friend ReadOnly Property MaxSmallImageHeigh As XMLValue(Of Integer)
@@ -239,13 +367,13 @@ Friend Class SettingsCLS : Implements IDisposable
Friend ReadOnly Property LatestSelectedChannel As XMLValue(Of String) Friend ReadOnly Property LatestSelectedChannel As XMLValue(Of String)
#End Region #End Region
#Region "Channels properties" #Region "Channels properties"
Friend ReadOnly Property ChannelsDefaultReadyForDownload As XMLValue(Of Boolean)
Friend ReadOnly Property ChannelsDefaultTemporary As XMLValue(Of Boolean)
Friend ReadOnly Property ChannelsRegularCheckMD5 As XMLValue(Of Boolean)
Friend ReadOnly Property ChannelsImagesRows As XMLValue(Of Integer) Friend ReadOnly Property ChannelsImagesRows As XMLValue(Of Integer)
Friend ReadOnly Property ChannelsImagesColumns As XMLValue(Of Integer) Friend ReadOnly Property ChannelsImagesColumns As XMLValue(Of Integer)
Friend ReadOnly Property ChannelsHideExistsUser As XMLValue(Of Boolean) Friend ReadOnly Property ChannelsHideExistsUser As XMLValue(Of Boolean)
Friend ReadOnly Property ChannelsMaxJobsCount As XMLValue(Of Integer) Friend ReadOnly Property ChannelsMaxJobsCount As XMLValue(Of Integer)
Friend ReadOnly Property FromChannelDownloadTop As XMLValue(Of Integer)
Friend ReadOnly Property FromChannelDownloadTopUse As XMLValue(Of Boolean)
Friend ReadOnly Property FromChannelCopyImageToUser As XMLValue(Of Boolean)
#End Region #End Region
#Region "New version properties" #Region "New version properties"
Friend ReadOnly Property CheckUpdatesAtStart As XMLValue(Of Boolean) Friend ReadOnly Property CheckUpdatesAtStart As XMLValue(Of Boolean)
@@ -257,6 +385,7 @@ Friend Class SettingsCLS : Implements IDisposable
Protected Overridable Overloads Sub Dispose(ByVal disposing As Boolean) Protected Overridable Overloads Sub Dispose(ByVal disposing As Boolean)
If Not disposedValue Then If Not disposedValue Then
If disposing Then If disposing Then
If UserListUpdateRequired Then UpdateUsersList()
If Not Channels Is Nothing Then If Not Channels Is Nothing Then
Channels.Dispose() Channels.Dispose()
If Reddit.ChannelsCollection.ChannelsPathCache.Exists(SFO.Path, False) Then _ If Reddit.ChannelsCollection.ChannelsPathCache.Exists(SFO.Path, False) Then _

View File

@@ -1,4 +1,12 @@
Imports System.Threading ' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports System.Threading
Imports EOptions = PersonalUtilities.Forms.Toolbars.MyProgress.EnableOptions Imports EOptions = PersonalUtilities.Forms.Toolbars.MyProgress.EnableOptions
Imports SCrawler.API Imports SCrawler.API
Imports SCrawler.API.Base Imports SCrawler.API.Base
@@ -99,8 +107,7 @@ Friend Class TDownloader : Implements IDisposable
.Information = $"Downloading {_CurrentDownloadingTasks.NumToString(nf, NProv)}/{Items.Count.NumToString(nf, NProv)} profiles' data" .Information = $"Downloading {_CurrentDownloadingTasks.NumToString(nf, NProv)}/{Items.Count.NumToString(nf, NProv)} profiles' data"
.InformationTemporary = .Information .InformationTemporary = .Information
End With End With
Token.ThrowIfCancellationRequested() Task.WaitAll(t.ToArray)
Task.WaitAll(t.ToArray, Token)
Dim dcc As Boolean = False Dim dcc As Boolean = False
If Keys.Count > 0 Then If Keys.Count > 0 Then
For Each k$ In Keys For Each k$ In Keys
@@ -129,11 +136,15 @@ Friend Class TDownloader : Implements IDisposable
Catch ex As Exception Catch ex As Exception
ErrorsDescriber.Execute(EDP.SendInLog, ex, "TDownloader.DownloadData") ErrorsDescriber.Execute(EDP.SendInLog, ex, "TDownloader.DownloadData")
Finally Finally
If Settings.UserListUpdateRequired Then _
Task.WaitAll(Task.Run(Sub()
While Settings.UserListUpdateRequired : Settings.UpdateUsersList() : End While
End Sub))
MainProgress.Enabled(EOptions.ProgressBar) = False MainProgress.Enabled(EOptions.ProgressBar) = False
End Try End Try
End Sub End Sub
Private Function GetUserFromMainCollection(ByVal User As IUserData) As IUserData Private Function GetUserFromMainCollection(ByVal User As IUserData) As IUserData
Dim uSimple As Predicate(Of IUserData) = Function(u) u.Equals(DirectCast(User, UserDataBase)) Dim uSimple As Predicate(Of IUserData) = Function(u) u.Equals(DirectCast(User.Self, UserDataBase))
Dim uCol As Predicate(Of IUserData) = Function(ByVal u As IUserData) As Boolean Dim uCol As Predicate(Of IUserData) = Function(ByVal u As IUserData) As Boolean
If u.IsCollection Then If u.IsCollection Then
Return DirectCast(u, UserDataBind).Collections.Exists(uSimple) Return DirectCast(u, UserDataBind).Collections.Exists(uSimple)
@@ -160,8 +171,8 @@ Friend Class TDownloader : Implements IDisposable
If Not Items.Contains(Item) Then If Not Items.Contains(Item) Then
If Item.IsCollection Then Item.DownloadData(Nothing) Else Items.Add(Item) If Item.IsCollection Then Item.DownloadData(Nothing) Else Items.Add(Item)
UpdateJobsLabel() UpdateJobsLabel()
If Not _Working Then Start()
End If End If
If Items.Count > 0 Then Start()
End Sub End Sub
Friend Sub AddRange(ByVal _Items As IEnumerable(Of IUserData)) Friend Sub AddRange(ByVal _Items As IEnumerable(Of IUserData))
If _Items.ListExists Then If _Items.ListExists Then
@@ -170,8 +181,8 @@ Friend Class TDownloader : Implements IDisposable
If _Items(i).IsCollection Then _Items(i).DownloadData(Nothing) Else Items.Add(_Items(i)) If _Items(i).IsCollection Then _Items(i).DownloadData(Nothing) Else Items.Add(_Items(i))
Next Next
UpdateJobsLabel() UpdateJobsLabel()
Start()
End If End If
If Items.Count > 0 Then Start()
End Sub End Sub
Friend Sub UserRemove(ByVal _Item As IUserData) Friend Sub UserRemove(ByVal _Item As IUserData)
If Downloaded.Count > 0 AndAlso Downloaded.Contains(_Item) Then Downloaded.Remove(_Item) : RaiseEvent OnDownloadCountChange() If Downloaded.Count > 0 AndAlso Downloaded.Contains(_Item) Then Downloaded.Remove(_Item) : RaiseEvent OnDownloadCountChange()

View File

@@ -1,4 +1,12 @@
Imports PersonalUtilities.Tools ' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports PersonalUtilities.Tools
Friend Class UserImage : Inherits ImageRenderer Friend Class UserImage : Inherits ImageRenderer
Friend Const ImagePrefix As String = "UserPicture" Friend Const ImagePrefix As String = "UserPicture"
Friend Const ImagePostfix_Large As String = "_Large" Friend Const ImagePostfix_Large As String = "_Large"

View File

@@ -1,4 +1,12 @@
Imports System.ComponentModel ' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports System.ComponentModel
Imports PersonalUtilities.Forms Imports PersonalUtilities.Forms
Friend Class VideosDownloaderForm Friend Class VideosDownloaderForm
Private MyView As FormsView Private MyView As FormsView