WWW-YouTube-Download-0.62/000755 000765 000024 00000000000 13547625436 016562 5ustar00olafaldersstaff000000 000000 WWW-YouTube-Download-0.62/perltidyrc000644 000765 000024 00000000325 13547625436 020666 0ustar00olafaldersstaff000000 000000 --blank-lines-before-packages=0 --iterations=2 --no-outdent-long-comments -bar -boc -ci=4 -i=4 -l=78 -nolq -se -wbb="% + - * / x != == >= <= =~ !~ < > | & >= < = **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^= x=" WWW-YouTube-Download-0.62/perlcriticrc000644 000765 000024 00000005000 13547625436 021165 0ustar00olafaldersstaff000000 000000 severity = 3 verbose = 11 theme = core + pbp + bugs + maintenance + cosmetic + complexity + security + tests + moose program-extensions = pl psgi t exclude = Subroutines::ProhibitCallsToUndeclaredSubs [BuiltinFunctions::ProhibitStringySplit] severity = 3 [CodeLayout::RequireTrailingCommas] severity = 3 [ControlStructures::ProhibitCStyleForLoops] severity = 3 [Documentation::RequirePackageMatchesPodName] severity = 3 [Freenode::WhileDiamondDefaultAssignment] set_themes = core [InputOutput::RequireCheckedSyscalls] functions = :builtins exclude_functions = sleep severity = 3 [Moose::RequireCleanNamespace] modules = Moose Moose::Role MooseX::Role::Parameterized Moose::Util::TypeConstraints cleaners = namespace::autoclean [NamingConventions::Capitalization] package_exemptions = [A-Z]\w+|main file_lexical_variables = [A-Z]\w+|[^A-Z]+ global_variables = :starts_with_upper scoped_lexical_variables = [A-Z]\w+|[^A-Z]+ severity = 3 # Given our code base, leaving this at 5 would be a huge pain [Subroutines::ProhibitManyArgs] max_arguments = 10 [RegularExpressions::ProhibitComplexRegexes] max_characters = 200 [RegularExpressions::ProhibitUnusualDelimiters] severity = 3 [Subroutines::ProhibitUnusedPrivateSubroutines] private_name_regex = _(?!build)\w+ [TestingAndDebugging::ProhibitNoWarnings] allow = redefine [ValuesAndExpressions::ProhibitEmptyQuotes] severity = 3 [ValuesAndExpressions::ProhibitInterpolationOfLiterals] severity = 3 [ValuesAndExpressions::RequireUpperCaseHeredocTerminator] severity = 3 [Variables::ProhibitPackageVars] add_packages = Test::Builder [-ControlStructures::ProhibitCascadingIfElse] [-ErrorHandling::RequireCarping] [-InputOutput::RequireBriefOpen] [-ValuesAndExpressions::ProhibitConstantPragma] # No need for /xsm everywhere [-RegularExpressions::RequireDotMatchAnything] [-RegularExpressions::RequireExtendedFormatting] [-RegularExpressions::RequireLineBoundaryMatching] # by concensus in standup 2015-05-12 we decided to allow return undef # this is mainly so bar can be written to return undef so that # foo( bar => bar(), bazz => baz() ) won't cause problems [-Subroutines::ProhibitExplicitReturnUndef] # This incorrectly thinks signatures are prototypes. [-Subroutines::ProhibitSubroutinePrototypes] # http://stackoverflow.com/questions/2275317/why-does-perlcritic-dislike-using-shift-to-populate-subroutine-variables [-Subroutines::RequireArgUnpacking] [-Subroutines::RequireFinalReturn] # "use v5.14" is more readable than "use 5.014" [-ValuesAndExpressions::ProhibitVersionStrings] WWW-YouTube-Download-0.62/cpanfile000644 000765 000024 00000003237 13547625436 020273 0ustar00olafaldersstaff000000 000000 requires "Carp" => "0"; requires "Encode" => "0"; requires "Getopt::Long" => "0"; requires "HTML::Entities" => "0"; requires "HTTP::Request" => "0"; requires "JSON::MaybeXS" => "0"; requires "LWP::UserAgent" => "0"; requires "Pod::Usage" => "0"; requires "Term::ANSIColor" => "0"; requires "Time::HiRes" => "0"; requires "URI" => "0"; requires "URI::QueryParam" => "0"; requires "XML::TreePP" => "0"; requires "constant" => "0"; requires "perl" => "5.008001"; requires "strict" => "0"; requires "warnings" => "0"; on 'test' => sub { requires "ExtUtils::MakeMaker" => "0"; requires "File::Spec" => "0"; requires "Test::More" => "0"; requires "perl" => "5.008001"; }; on 'test' => sub { recommends "CPAN::Meta" => "2.120900"; }; on 'configure' => sub { requires "ExtUtils::MakeMaker" => "0"; requires "perl" => "5.008001"; }; on 'develop' => sub { requires "Code::TidyAll" => "0.71"; requires "Code::TidyAll::Plugin::SortLines::Naturally" => "0.000003"; requires "Code::TidyAll::Plugin::Test::Vars" => "0.04"; requires "Code::TidyAll::Plugin::UniqueLines" => "0.000003"; requires "File::Find" => "0"; requires "Parallel::ForkManager" => "1.19"; requires "Perl::Critic" => "1.132"; requires "Perl::Tidy" => "20180220"; requires "Pod::Wordlist" => "0"; requires "Test::CPAN::Changes" => "0.19"; requires "Test::More" => "0.96"; requires "Test::Perl::Critic" => "0"; requires "Test::Pod" => "1.41"; requires "Test::Requires" => "0"; requires "Test::Script::Shebang" => "0"; requires "Test::Spelling" => "0.12"; requires "Test::Vars" => "0.014"; }; on 'develop' => sub { recommends "Dist::Zilla::PluginBundle::Git::VersionManager" => "0.007"; }; WWW-YouTube-Download-0.62/Changes000644 000765 000024 00000012402 13547625436 020054 0ustar00olafaldersstaff000000 000000 Revision history for Perl module WWW::YouTube::Download 0.62 2019-10-10 12:59:04Z - Remove Build.PL. Fixes #53 (GH#54) (Olaf Alders) 0.61 2019-10-09 01:48:27Z - Document that youtube-playlists is currently broken (GH#52) (Olaf Alders) - Add progress bar display with Term::ProgressBar. (GH#10 and GH#50) (Ryo Okamoto and Mohammad S Anwar) - Fix typo (GH#48) (Alexandr Ciornii) - use JSON::MaybeXS instead of JSON (GH#43) (Dan Book) 0.60 2018-07-10T20:08:49Z - Fix regexp warning with perl 5.28 GH#42 (gregor herrmann) 0.59 2016-06-23T16:07:09Z - Fixed test failures (B. Estrade) 0.58 2015-06-17T22:29:38Z - Added a user-agent override switch (isync) 0.57 2015-03-15T02:29:02Z - Updated signature decoding function (kucharskim++) - Fixed parsing of 'user' (isync++) - Added an "interactive" mode (switch -a/ --interactive) (isync++) - Fixed JSON parser error (tsibley++) - Fixed failure if signature not found (tsibley++) 0.56 2013-07-30T07:14:40Z - Fixed typo: $Carp::Intrenal -> $Carp::Internal (Syaltut++) - Changes file reformatted as per CPAN::Changes::Spec (neilbowers++) 0.55 2013-07-27T09:21:38Z - Changed signature encoding (kucharskim++) 0.54 2013-07-05T18:29:31Z - If unavailable video, croak with an appropriate error message. (kucharskim++) - Support encrypted signature video. (kucharskim++) 0.53 2013-06-05T16:05:56Z - Various improvements to youtube-playlists (kucharskim++) 0.52 2013-05-05T16:18:54Z - Added playlist_id() and video_id() method (kucharskim++) 0.51 2013-05-03T07:49:29Z - Support new url (mikolaj++) 0.50 2013-04-19T17:50:39Z - repackaging 0.49 2013-04-09T21:13:56Z - repacking 0.48 2013-04-09T21:09:55Z - Fixed parsing problem on youtube-playlists (mikolaj++) 0.47 2013-04-02 02:06:07 - Added some documentation and added eg/menu.pl (polettix++) 0.46 2013-03-24 15:34:27 - YouTube's design was changed (vjp++, yusukebe++) 0.45 2013-02-10 02:14:09 - New substitution variable {user} (isync++) 0.44 2013-01-19 18:29:58 - added proxy support (isync++) 0.43 2013-01-05 01:43:17 - fixed grammar (mokko++) - using Module::Build 0.42 2012-11-16 21:35:31 - fixed "failed to extract JSON data" (ks0608++) - fixed RT: 81068 (panic83++) 0.41 2012-10-04 00:44:13 - follow the change of site (mikolaj++, yusukebe++) - fixed color problems on scripts (mikolaj++) - fixed RT 79931 (HMBRAND++) 0.40 2012-01-22 16:54:53 - Fixed a problem that did not works, because YouTube's design was changed. (ks0608++, zentooo++) 0.39 2012-01-18 01:28:00 - remove suffix from youtube-download.pl and youtube-playlists.pl (mikolaj++) 0.38 2011-12-08 00:44:52 - fix typo (mikolaj++) - remove wrong code (mikolaj++) 0.37 2011-12-07 02:33:23 - fix wrong characters in filename in youtube-download.pl (mikolaj++) - fix doc in youtube-download.pl (mikolaj++) - file_name option is DEPRECATED 0.36 2011-10-31 02:45:48 - fix default filename problem in youtube-download.pl 0.35 2011-10-18 00:28:58 - fix typo in youtube-playlists.pl (rt:71721) 0.34 2011-10-15 16:14:57 - workaround for win32 - fix suffix problem 0.33 2011-10-12 01:17:34 - added youtube-download.pl and youtube-playlist.pl (request by st3vil++) - fix doc 0.32 2011-08-23 01:52:20 - added LICENSE file (no code change) 0.31 2011-08-23 00:25:02 - added fmt 38 to .mp4 (mikolaj++) 0.30 2011-08-07 15:25:11 - cleanup (mikolaj++) 0.29 2011-08-05 01:29:27 - fixed a problem that did not works, becouse changed YouTube's design. (katsuhito konishi++) 0.28 2011-08-04 00:03:58 - fixed a problem that did not works, becouse changed YouTube's design. (mikolaj++) 0.27 2011-05-29 23:32:31 - fixed garbled (akiym++) - fixed typo (akiym++) 0.26 2011-04-20 01:34:55 - fixed scrape problem (reported by Octavian++) 0.25 2011-03-19 00:39:41 - added few more match URLs (mikolaj++) 0.24 2011-03-04 01:45:20 - fixed could not fetch json data problem (akiym++) 0.23 2011-02-22 00:00:22 - supported any video urls (mikolaj++) 0.22 2011-01-05 00:17:54 - Fixed a problem that can not download videos there. (reported by Octavian) 0.21 2010-12-30 15:28:51 - fixed bug for _video_id(). If already had $1 is defined, was returned $1 without matches. (woremacx++) 0.20 2010-12-15 00:57:43 - YouTube's API had change, maybe fixed it. 0.16 2010-10-17 18:17:57 - Required Text::More 0.96 later - fixed POD spell miss 0.15 2010-08-11 00:14:53 - YouTube's API has changed so I fixed it. (reported by Bruce David) 0.14 2010-05-07 02:50:42 - typo fix - wrote pod 0.13 2010-04-10 18:20:05 - Each instance to create a LWP::UserAgent. # thx kuniyoshi 0.12 2010-04-03 16:06:33 - upload miss X( 0.11 2010-04-03 15:02:25 - added ua setter/getter. using CGI. 0.10 2010-04-03 02:56:18 - rewrite all 0.07 2010-03-01 00:11:55 - supported FULL HD quality 0.06 2009-11-08 00:46:55 - Youtube respond to changes in 0.05 2009-10-12 14:58:23 - Youtube respond to changes in 0.04 2011-08-14 - Changes unknown 0.03 2011-08-12 - Changes unknown 0.02 2009-06-06 21:04:17 - added 'fmt' field 0.01 2009-04-04 16:26:29 - original version WWW-YouTube-Download-0.62/INSTALL000644 000765 000024 00000004415 13547625436 017617 0ustar00olafaldersstaff000000 000000 This is the Perl distribution WWW-YouTube-Download. Installing WWW-YouTube-Download is straightforward. ## Installation with cpanm If you have cpanm, you only need one line: % cpanm WWW::YouTube::Download If it does not have permission to install modules to the current perl, cpanm will automatically set up and install to a local::lib in your home directory. See the local::lib documentation (https://metacpan.org/pod/local::lib) for details on enabling it in your environment. ## Installing with the CPAN shell Alternatively, if your CPAN shell is set up, you should just be able to do: % cpan WWW::YouTube::Download ## Manual installation As a last resort, you can manually install it. Download the tarball, untar it, install configure prerequisites (see below), then build it: % perl Makefile.PL % make && make test Then install it: % make install On Windows platforms, you should use `dmake` or `nmake`, instead of `make`. If your perl is system-managed, you can create a local::lib in your home directory to install modules to. For details, see the local::lib documentation: https://metacpan.org/pod/local::lib The prerequisites of this distribution will also have to be installed manually. The prerequisites are listed in one of the files: `MYMETA.yml` or `MYMETA.json` generated by running the manual build process described above. ## Configure Prerequisites This distribution requires other modules to be installed before this distribution's installer can be run. They can be found under the "configure_requires" key of META.yml or the "{prereqs}{configure}{requires}" key of META.json. ## Other Prerequisites This distribution may require additional modules to be installed after running Makefile.PL. Look for prerequisites in the following phases: * to run make, PHASE = build * to use the module code itself, PHASE = runtime * to run tests, PHASE = test They can all be found in the "PHASE_requires" key of MYMETA.yml or the "{prereqs}{PHASE}{requires}" key of MYMETA.json. ## Documentation WWW-YouTube-Download documentation is available as POD. You can run `perldoc` from a shell to read the documentation: % perldoc WWW::YouTube::Download For more information on installing Perl modules via CPAN, please see: https://www.cpan.org/modules/INSTALL.html WWW-YouTube-Download-0.62/MANIFEST000644 000765 000024 00000001177 13547625436 017721 0ustar00olafaldersstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.012. CONTRIBUTORS Changes INSTALL LICENSE MANIFEST META.json META.yml Makefile.PL README.md contrib/gencode.pl cpanfile dist.ini eg/cb.pl eg/menu.pl eg/parallel.pl lib/WWW/YouTube/Download.pm minil.toml perlcriticrc perltidyrc script/youtube-download script/youtube-playlists t/00-report-prereqs.dd t/00-report-prereqs.t t/00_compile.t t/playlist_id.t t/user_id.t t/video_id.t t/video_user.t t/youtube.t tidyall.ini xt/02_perlcritic.t xt/05_script-shebang.t xt/07_cpan_meta.t xt/author/pod-spell.t xt/author/pod-syntax.t xt/perlcriticrc xt/release/cpan-changes.t WWW-YouTube-Download-0.62/LICENSE000644 000765 000024 00000043702 13547625436 017575 0ustar00olafaldersstaff000000 000000 This software is copyright (c) 2013 - 2019 by Yuji Shimada. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2013 - 2019 by Yuji Shimada. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, 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 make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the 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 a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE 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. END OF TERMS AND CONDITIONS Appendix: 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 humanity, 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 convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy 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 1, 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision 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, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2013 - 2019 by Yuji Shimada. This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End WWW-YouTube-Download-0.62/t/000755 000765 000024 00000000000 13547625436 017025 5ustar00olafaldersstaff000000 000000 WWW-YouTube-Download-0.62/contrib/000755 000765 000024 00000000000 13547625436 020222 5ustar00olafaldersstaff000000 000000 WWW-YouTube-Download-0.62/xt/000755 000765 000024 00000000000 13547625436 017215 5ustar00olafaldersstaff000000 000000 WWW-YouTube-Download-0.62/META.yml000644 000765 000024 00000041657 13547625436 020050 0ustar00olafaldersstaff000000 000000 --- abstract: 'WWW::YouTube::Download - Very simple YouTube video download interface' author: - 'xaicron ' build_requires: ExtUtils::MakeMaker: '0' File::Spec: '0' Test::More: '0' perl: '5.008001' configure_requires: ExtUtils::MakeMaker: '0' perl: '5.008001' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: WWW-YouTube-Download no_index: directory: - examples - t - xt requires: Carp: '0' Encode: '0' Getopt::Long: '0' HTML::Entities: '0' HTTP::Request: '0' JSON::MaybeXS: '0' LWP::UserAgent: '0' Pod::Usage: '0' Term::ANSIColor: '0' Time::HiRes: '0' URI: '0' URI::QueryParam: '0' XML::TreePP: '0' constant: '0' perl: '5.008001' strict: '0' warnings: '0' resources: bugtracker: https://github.com/xaicron/p5-www-youtube-download/issues homepage: https://github.com/xaicron/p5-www-youtube-download repository: https://github.com/xaicron/p5-www-youtube-download.git version: '0.62' x_Dist_Zilla: perl: version: '5.026001' plugins: - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 0 check_all_prereqs: 0 modules: - Dist::Zilla::PluginBundle::Author::OALDERS phase: build run_under_travis: 0 skip: [] name: '@Author::OALDERS/stale modules, build' version: '0.055' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 1 check_all_prereqs: 1 modules: [] phase: release run_under_travis: 0 skip: [] name: '@Author::OALDERS/stale modules, release' version: '0.055' - class: Dist::Zilla::Plugin::MAXMIND::TidyAll name: '@Author::OALDERS/MAXMIND::TidyAll' version: '0.83' - class: Dist::Zilla::Plugin::AutoPrereqs name: '@Author::OALDERS/AutoPrereqs' version: '6.012' - class: Dist::Zilla::Plugin::CheckChangesHasContent name: '@Author::OALDERS/CheckChangesHasContent' version: '0.011' - class: Dist::Zilla::Plugin::MakeMaker config: Dist::Zilla::Role::TestRunner: default_jobs: 1 name: '@Author::OALDERS/MakeMaker' version: '6.012' - class: Dist::Zilla::Plugin::CPANFile name: '@Author::OALDERS/CPANFile' version: '6.012' - class: Dist::Zilla::Plugin::ContributorsFile name: '@Author::OALDERS/ContributorsFile' version: 0.3.0 - class: Dist::Zilla::Plugin::MetaJSON name: '@Author::OALDERS/MetaJSON' version: '6.012' - class: Dist::Zilla::Plugin::MetaYAML name: '@Author::OALDERS/MetaYAML' version: '6.012' - class: Dist::Zilla::Plugin::Manifest name: '@Author::OALDERS/Manifest' version: '6.012' - class: Dist::Zilla::Plugin::MetaNoIndex name: '@Author::OALDERS/MetaNoIndex' version: '6.012' - class: Dist::Zilla::Plugin::MetaConfig name: '@Author::OALDERS/MetaConfig' version: '6.012' - class: Dist::Zilla::Plugin::MetaResources name: '@Author::OALDERS/MetaResources' version: '6.012' - class: Dist::Zilla::Plugin::License name: '@Author::OALDERS/License' version: '6.012' - class: Dist::Zilla::Plugin::InstallGuide config: Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000036' version: '0.006' name: '@Author::OALDERS/InstallGuide' version: '1.200013' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: requires name: '@Author::OALDERS/Modules for use with tidyall' version: '6.012' - class: Dist::Zilla::Plugin::ExecDir name: '@Author::OALDERS/ExecDir' version: '6.012' - class: Dist::Zilla::Plugin::Test::PodSpelling config: Dist::Zilla::Plugin::Test::PodSpelling: directories: - bin - lib spell_cmd: '' stopwords: - Alders - "Alders'" - flv - playlist - webm - webpage - widthxheight - yusukebe wordlist: Pod::Wordlist name: '@Author::OALDERS/Test::PodSpelling' version: '2.007005' - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@Author::OALDERS/PodSyntaxTests' version: '6.012' - class: Dist::Zilla::Plugin::Test::CPAN::Changes config: Dist::Zilla::Plugin::Test::CPAN::Changes: changelog: Changes name: '@Author::OALDERS/Test::CPAN::Changes' version: '0.012' - class: Dist::Zilla::Plugin::TestRelease name: '@Author::OALDERS/TestRelease' version: '6.012' - class: Dist::Zilla::Plugin::Test::ReportPrereqs name: '@Author::OALDERS/Test::ReportPrereqs' version: '0.027' - class: Dist::Zilla::Plugin::RunExtraTests config: Dist::Zilla::Role::TestRunner: default_jobs: 1 name: '@Author::OALDERS/RunExtraTests' version: '0.029' - class: Dist::Zilla::Plugin::MinimumPerl name: '@Author::OALDERS/MinimumPerl' version: '1.006' - class: Dist::Zilla::Plugin::PodWeaver config: Dist::Zilla::Plugin::PodWeaver: finder: - ':InstallModules' - ':ExecFiles' plugins: - class: Pod::Weaver::Plugin::EnsurePod5 name: '@CorePrep/EnsurePod5' version: '4.015' - class: Pod::Weaver::Plugin::H1Nester name: '@CorePrep/H1Nester' version: '4.015' - class: Pod::Weaver::Plugin::SingleEncoding name: '@Default/SingleEncoding' version: '4.015' - class: Pod::Weaver::Section::Name name: '@Default/Name' version: '4.015' - class: Pod::Weaver::Section::Version name: '@Default/Version' version: '4.015' - class: Pod::Weaver::Section::Region name: '@Default/prelude' version: '4.015' - class: Pod::Weaver::Section::Generic name: SYNOPSIS version: '4.015' - class: Pod::Weaver::Section::Generic name: DESCRIPTION version: '4.015' - class: Pod::Weaver::Section::Generic name: OVERVIEW version: '4.015' - class: Pod::Weaver::Section::Collect name: ATTRIBUTES version: '4.015' - class: Pod::Weaver::Section::Collect name: METHODS version: '4.015' - class: Pod::Weaver::Section::Collect name: FUNCTIONS version: '4.015' - class: Pod::Weaver::Section::Leftovers name: '@Default/Leftovers' version: '4.015' - class: Pod::Weaver::Section::Region name: '@Default/postlude' version: '4.015' - class: Pod::Weaver::Section::Authors name: '@Default/Authors' version: '4.015' - class: Pod::Weaver::Section::Legal name: '@Default/Legal' version: '4.015' name: '@Author::OALDERS/PodWeaver' version: '4.008' - class: Dist::Zilla::Plugin::PruneCruft name: '@Author::OALDERS/PruneCruft' version: '6.012' - class: Dist::Zilla::Plugin::CopyFilesFromBuild name: '@Author::OALDERS/CopyFilesFromBuild' version: '0.170880' - class: Dist::Zilla::Plugin::GithubMeta name: '@Author::OALDERS/GithubMeta' version: '0.58' - class: Dist::Zilla::Plugin::Git::GatherDir config: Dist::Zilla::Plugin::GatherDir: exclude_filename: - Install - LICENSE - META.json - Makefile.PL - README.md - cpanfile exclude_match: [] follow_symlinks: 0 include_dotfiles: 0 prefix: '' prune_directory: [] root: . Dist::Zilla::Plugin::Git::GatherDir: include_untracked: 0 name: '@Author::OALDERS/Git::GatherDir' version: '2.046' - class: Dist::Zilla::Plugin::CopyFilesFromRelease config: Dist::Zilla::Plugin::CopyFilesFromRelease: filename: - Install match: [] name: '@Author::OALDERS/CopyFilesFromRelease' version: '0.006' - class: Dist::Zilla::Plugin::Git::Check config: Dist::Zilla::Plugin::Git::Check: untracked_files: die Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Changes - Install - LICENSE - META.json - Makefile.PL - README.md - cpanfile - dist.ini allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.23.0 repo_root: . name: '@Author::OALDERS/Git::Check' version: '2.046' - class: Dist::Zilla::Plugin::Git::Contributors config: Dist::Zilla::Plugin::Git::Contributors: git_version: 2.23.0 include_authors: 0 include_releaser: 1 order_by: name paths: [] name: '@Author::OALDERS/Git::Contributors' version: '0.035' - class: Dist::Zilla::Plugin::ReadmeAnyFromPod config: Dist::Zilla::Role::FileWatcher: version: '0.006' name: '@Author::OALDERS/ReadmeMdInBuild' version: '0.163250' - class: Dist::Zilla::Plugin::StaticInstall config: Dist::Zilla::Plugin::StaticInstall: dry_run: 0 mode: on name: '@Author::OALDERS/StaticInstall' version: '0.012' - class: Dist::Zilla::Plugin::ShareDir name: '@Author::OALDERS/ShareDir' version: '6.012' - class: Dist::Zilla::Plugin::TravisCI::StatusBadge name: '@Author::OALDERS/TravisCI::StatusBadge' version: '0.007' - class: Dist::Zilla::Plugin::CheckIssues name: '@Author::OALDERS/CheckIssues' version: '0.011' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@Author::OALDERS/ConfirmRelease' version: '6.012' - class: Dist::Zilla::Plugin::UploadToCPAN name: '@Author::OALDERS/UploadToCPAN' version: '6.012' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: recommends name: '@Author::OALDERS/@Git::VersionManager/pluginbundle version' version: '6.012' - class: Dist::Zilla::Plugin::RewriteVersion::Transitional config: Dist::Zilla::Plugin::RewriteVersion: add_tarball_name: 0 finders: - ':ExecFiles' - ':InstallModules' global: 0 skip_version_provider: 0 Dist::Zilla::Plugin::RewriteVersion::Transitional: {} name: '@Author::OALDERS/@Git::VersionManager/RewriteVersion::Transitional' version: '0.009' - class: Dist::Zilla::Plugin::MetaProvides::Update name: '@Author::OALDERS/@Git::VersionManager/MetaProvides::Update' version: '0.007' - class: Dist::Zilla::Plugin::CopyFilesFromRelease config: Dist::Zilla::Plugin::CopyFilesFromRelease: filename: - Changes match: [] name: '@Author::OALDERS/@Git::VersionManager/CopyFilesFromRelease' version: '0.006' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: [] commit_msg: v%V%n%n%c Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Changes - Install - LICENSE - META.json - Makefile.PL - README.md - cpanfile - dist.ini allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.23.0 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Author::OALDERS/@Git::VersionManager/release snapshot' version: '2.046' - class: Dist::Zilla::Plugin::Git::Tag config: Dist::Zilla::Plugin::Git::Tag: branch: ~ changelog: Changes signed: 0 tag: v0.62 tag_format: v%V tag_message: v%V Dist::Zilla::Role::Git::Repo: git_version: 2.23.0 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Author::OALDERS/@Git::VersionManager/Git::Tag' version: '2.046' - class: Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional config: Dist::Zilla::Plugin::BumpVersionAfterRelease: finders: - ':ExecFiles' - ':InstallModules' global: 0 munge_makefile_pl: 1 Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional: {} name: '@Author::OALDERS/@Git::VersionManager/BumpVersionAfterRelease::Transitional' version: '0.009' - class: Dist::Zilla::Plugin::NextRelease name: '@Author::OALDERS/@Git::VersionManager/NextRelease' version: '6.012' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: [] commit_msg: 'increment $VERSION after %v release' Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Build.PL - Changes - Makefile.PL allow_dirty_match: - (?^:^lib/.*\.pm$) changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.23.0 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Author::OALDERS/@Git::VersionManager/post-release commit' version: '2.046' - class: Dist::Zilla::Plugin::Git::Push config: Dist::Zilla::Plugin::Git::Push: push_to: - origin remotes_must_exist: 1 Dist::Zilla::Role::Git::Repo: git_version: 2.23.0 repo_root: . name: '@Author::OALDERS/Git::Push' version: '2.046' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: requires name: DevelopRequires version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '6.012' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' version: '6.012' x_contributors: - 'Ahmad Syaltut ' - 'akiym ' - 'Alexandr Ciornii ' - 'B. Estrade ' - 'Dan Book ' - 'Flavio Poletti ' - 'gregor herrmann ' - 'isync ' - 'ks ' - 'Maurice ' - 'Mikolaj Kucharski ' - 'Mohammad S Anwar ' - 'Neil Bowers ' - 'Olaf Alders ' - 'Paulo Custodio ' - 'TANIGUCHI Takaki ' - 'Thomas Sibley ' - 'Yuji Shimada ' - 'Yusuke Wada ' x_generated_by_perl: v5.26.1 x_serialization_backend: 'YAML::Tiny version 1.73' x_static_install: 1 WWW-YouTube-Download-0.62/script/000755 000765 000024 00000000000 13547625436 020066 5ustar00olafaldersstaff000000 000000 WWW-YouTube-Download-0.62/minil.toml000644 000765 000024 00000000036 13547625436 020566 0ustar00olafaldersstaff000000 000000 name = "WWW-YouTube-Download" WWW-YouTube-Download-0.62/CONTRIBUTORS000644 000765 000024 00000001143 13547625436 020441 0ustar00olafaldersstaff000000 000000 # WWW-YOUTUBE-DOWNLOAD CONTRIBUTORS # This is the (likely incomplete) list of people who have helped make this distribution what it is, either via code contributions, patches, bug reports, help with troubleshooting, etc. A huge 'thank you' to all of them. * Ahmad Syaltut * akiym * Alexandr Ciornii * B. Estrade * Dan Book * Flavio Poletti * gregor herrmann * isync * ks * Maurice * Mikolaj Kucharski * Mohammad S Anwar * Neil Bowers * Olaf Alders * Paulo Custodio * TANIGUCHI Takaki * Thomas Sibley * Yuji Shimada * Yusuke Wada WWW-YouTube-Download-0.62/META.json000644 000765 000024 00000064776 13547625436 020227 0ustar00olafaldersstaff000000 000000 { "abstract" : "WWW::YouTube::Download - Very simple YouTube video download interface", "author" : [ "xaicron " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "WWW-YouTube-Download", "no_index" : { "directory" : [ "examples", "t", "xt" ] }, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0", "perl" : "5.008001" } }, "develop" : { "recommends" : { "Dist::Zilla::PluginBundle::Git::VersionManager" : "0.007" }, "requires" : { "Code::TidyAll" : "0.71", "Code::TidyAll::Plugin::SortLines::Naturally" : "0.000003", "Code::TidyAll::Plugin::Test::Vars" : "0.04", "Code::TidyAll::Plugin::UniqueLines" : "0.000003", "File::Find" : "0", "Parallel::ForkManager" : "1.19", "Perl::Critic" : "1.132", "Perl::Tidy" : "20180220", "Pod::Wordlist" : "0", "Test::CPAN::Changes" : "0.19", "Test::More" : "0.96", "Test::Perl::Critic" : "0", "Test::Pod" : "1.41", "Test::Requires" : "0", "Test::Script::Shebang" : "0", "Test::Spelling" : "0.12", "Test::Vars" : "0.014" } }, "runtime" : { "requires" : { "Carp" : "0", "Encode" : "0", "Getopt::Long" : "0", "HTML::Entities" : "0", "HTTP::Request" : "0", "JSON::MaybeXS" : "0", "LWP::UserAgent" : "0", "Pod::Usage" : "0", "Term::ANSIColor" : "0", "Time::HiRes" : "0", "URI" : "0", "URI::QueryParam" : "0", "XML::TreePP" : "0", "constant" : "0", "perl" : "5.008001", "strict" : "0", "warnings" : "0" } }, "test" : { "recommends" : { "CPAN::Meta" : "2.120900" }, "requires" : { "ExtUtils::MakeMaker" : "0", "File::Spec" : "0", "Test::More" : "0", "perl" : "5.008001" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/xaicron/p5-www-youtube-download/issues" }, "homepage" : "https://github.com/xaicron/p5-www-youtube-download", "repository" : { "type" : "git", "url" : "https://github.com/xaicron/p5-www-youtube-download.git", "web" : "https://github.com/xaicron/p5-www-youtube-download" } }, "version" : "0.62", "x_Dist_Zilla" : { "perl" : { "version" : "5.026001" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 0, "check_all_prereqs" : 0, "modules" : [ "Dist::Zilla::PluginBundle::Author::OALDERS" ], "phase" : "build", "run_under_travis" : 0, "skip" : [] } }, "name" : "@Author::OALDERS/stale modules, build", "version" : "0.055" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 1, "check_all_prereqs" : 1, "modules" : [], "phase" : "release", "run_under_travis" : 0, "skip" : [] } }, "name" : "@Author::OALDERS/stale modules, release", "version" : "0.055" }, { "class" : "Dist::Zilla::Plugin::MAXMIND::TidyAll", "name" : "@Author::OALDERS/MAXMIND::TidyAll", "version" : "0.83" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@Author::OALDERS/AutoPrereqs", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::CheckChangesHasContent", "name" : "@Author::OALDERS/CheckChangesHasContent", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 1 } }, "name" : "@Author::OALDERS/MakeMaker", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::CPANFile", "name" : "@Author::OALDERS/CPANFile", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::ContributorsFile", "name" : "@Author::OALDERS/ContributorsFile", "version" : "0.3.0" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@Author::OALDERS/MetaJSON", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@Author::OALDERS/MetaYAML", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@Author::OALDERS/Manifest", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::MetaNoIndex", "name" : "@Author::OALDERS/MetaNoIndex", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@Author::OALDERS/MetaConfig", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::MetaResources", "name" : "@Author::OALDERS/MetaResources", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@Author::OALDERS/License", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::InstallGuide", "config" : { "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000036", "version" : "0.006" } }, "name" : "@Author::OALDERS/InstallGuide", "version" : "1.200013" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "requires" } }, "name" : "@Author::OALDERS/Modules for use with tidyall", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@Author::OALDERS/ExecDir", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Test::PodSpelling", "config" : { "Dist::Zilla::Plugin::Test::PodSpelling" : { "directories" : [ "bin", "lib" ], "spell_cmd" : "", "stopwords" : [ "Alders", "Alders'", "flv", "playlist", "webm", "webpage", "widthxheight", "yusukebe" ], "wordlist" : "Pod::Wordlist" } }, "name" : "@Author::OALDERS/Test::PodSpelling", "version" : "2.007005" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@Author::OALDERS/PodSyntaxTests", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Test::CPAN::Changes", "config" : { "Dist::Zilla::Plugin::Test::CPAN::Changes" : { "changelog" : "Changes" } }, "name" : "@Author::OALDERS/Test::CPAN::Changes", "version" : "0.012" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@Author::OALDERS/TestRelease", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Test::ReportPrereqs", "name" : "@Author::OALDERS/Test::ReportPrereqs", "version" : "0.027" }, { "class" : "Dist::Zilla::Plugin::RunExtraTests", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 1 } }, "name" : "@Author::OALDERS/RunExtraTests", "version" : "0.029" }, { "class" : "Dist::Zilla::Plugin::MinimumPerl", "name" : "@Author::OALDERS/MinimumPerl", "version" : "1.006" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "config" : { "Dist::Zilla::Plugin::PodWeaver" : { "finder" : [ ":InstallModules", ":ExecFiles" ], "plugins" : [ { "class" : "Pod::Weaver::Plugin::EnsurePod5", "name" : "@CorePrep/EnsurePod5", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::H1Nester", "name" : "@CorePrep/H1Nester", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::SingleEncoding", "name" : "@Default/SingleEncoding", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Name", "name" : "@Default/Name", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Version", "name" : "@Default/Version", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Default/prelude", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "SYNOPSIS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "DESCRIPTION", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "OVERVIEW", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "ATTRIBUTES", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "METHODS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "FUNCTIONS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Leftovers", "name" : "@Default/Leftovers", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Default/postlude", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Authors", "name" : "@Default/Authors", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Legal", "name" : "@Default/Legal", "version" : "4.015" } ] } }, "name" : "@Author::OALDERS/PodWeaver", "version" : "4.008" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@Author::OALDERS/PruneCruft", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::CopyFilesFromBuild", "name" : "@Author::OALDERS/CopyFilesFromBuild", "version" : "0.170880" }, { "class" : "Dist::Zilla::Plugin::GithubMeta", "name" : "@Author::OALDERS/GithubMeta", "version" : "0.58" }, { "class" : "Dist::Zilla::Plugin::Git::GatherDir", "config" : { "Dist::Zilla::Plugin::GatherDir" : { "exclude_filename" : [ "Install", "LICENSE", "META.json", "Makefile.PL", "README.md", "cpanfile" ], "exclude_match" : [], "follow_symlinks" : 0, "include_dotfiles" : 0, "prefix" : "", "prune_directory" : [], "root" : "." }, "Dist::Zilla::Plugin::Git::GatherDir" : { "include_untracked" : 0 } }, "name" : "@Author::OALDERS/Git::GatherDir", "version" : "2.046" }, { "class" : "Dist::Zilla::Plugin::CopyFilesFromRelease", "config" : { "Dist::Zilla::Plugin::CopyFilesFromRelease" : { "filename" : [ "Install" ], "match" : [] } }, "name" : "@Author::OALDERS/CopyFilesFromRelease", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "config" : { "Dist::Zilla::Plugin::Git::Check" : { "untracked_files" : "die" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Changes", "Install", "LICENSE", "META.json", "Makefile.PL", "README.md", "cpanfile", "dist.ini" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.23.0", "repo_root" : "." } }, "name" : "@Author::OALDERS/Git::Check", "version" : "2.046" }, { "class" : "Dist::Zilla::Plugin::Git::Contributors", "config" : { "Dist::Zilla::Plugin::Git::Contributors" : { "git_version" : "2.23.0", "include_authors" : 0, "include_releaser" : 1, "order_by" : "name", "paths" : [] } }, "name" : "@Author::OALDERS/Git::Contributors", "version" : "0.035" }, { "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", "config" : { "Dist::Zilla::Role::FileWatcher" : { "version" : "0.006" } }, "name" : "@Author::OALDERS/ReadmeMdInBuild", "version" : "0.163250" }, { "class" : "Dist::Zilla::Plugin::StaticInstall", "config" : { "Dist::Zilla::Plugin::StaticInstall" : { "dry_run" : 0, "mode" : "on" } }, "name" : "@Author::OALDERS/StaticInstall", "version" : "0.012" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@Author::OALDERS/ShareDir", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::TravisCI::StatusBadge", "name" : "@Author::OALDERS/TravisCI::StatusBadge", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::CheckIssues", "name" : "@Author::OALDERS/CheckIssues", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@Author::OALDERS/ConfirmRelease", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@Author::OALDERS/UploadToCPAN", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "recommends" } }, "name" : "@Author::OALDERS/@Git::VersionManager/pluginbundle version", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::RewriteVersion::Transitional", "config" : { "Dist::Zilla::Plugin::RewriteVersion" : { "add_tarball_name" : 0, "finders" : [ ":ExecFiles", ":InstallModules" ], "global" : 0, "skip_version_provider" : 0 }, "Dist::Zilla::Plugin::RewriteVersion::Transitional" : {} }, "name" : "@Author::OALDERS/@Git::VersionManager/RewriteVersion::Transitional", "version" : "0.009" }, { "class" : "Dist::Zilla::Plugin::MetaProvides::Update", "name" : "@Author::OALDERS/@Git::VersionManager/MetaProvides::Update", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::CopyFilesFromRelease", "config" : { "Dist::Zilla::Plugin::CopyFilesFromRelease" : { "filename" : [ "Changes" ], "match" : [] } }, "name" : "@Author::OALDERS/@Git::VersionManager/CopyFilesFromRelease", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [], "commit_msg" : "v%V%n%n%c" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Changes", "Install", "LICENSE", "META.json", "Makefile.PL", "README.md", "cpanfile", "dist.ini" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.23.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Author::OALDERS/@Git::VersionManager/release snapshot", "version" : "2.046" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "config" : { "Dist::Zilla::Plugin::Git::Tag" : { "branch" : null, "changelog" : "Changes", "signed" : 0, "tag" : "v0.62", "tag_format" : "v%V", "tag_message" : "v%V" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.23.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Author::OALDERS/@Git::VersionManager/Git::Tag", "version" : "2.046" }, { "class" : "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional", "config" : { "Dist::Zilla::Plugin::BumpVersionAfterRelease" : { "finders" : [ ":ExecFiles", ":InstallModules" ], "global" : 0, "munge_makefile_pl" : 1 }, "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional" : {} }, "name" : "@Author::OALDERS/@Git::VersionManager/BumpVersionAfterRelease::Transitional", "version" : "0.009" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@Author::OALDERS/@Git::VersionManager/NextRelease", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [], "commit_msg" : "increment $VERSION after %v release" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Build.PL", "Changes", "Makefile.PL" ], "allow_dirty_match" : [ "(?^:^lib/.*\\.pm$)" ], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.23.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Author::OALDERS/@Git::VersionManager/post-release commit", "version" : "2.046" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "config" : { "Dist::Zilla::Plugin::Git::Push" : { "push_to" : [ "origin" ], "remotes_must_exist" : 1 }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.23.0", "repo_root" : "." } }, "name" : "@Author::OALDERS/Git::Push", "version" : "2.046" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "requires" } }, "name" : "DevelopRequires", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "6.012" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : 0 }, "version" : "6.012" } }, "x_contributors" : [ "Ahmad Syaltut ", "akiym ", "Alexandr Ciornii ", "B. Estrade ", "Dan Book ", "Flavio Poletti ", "gregor herrmann ", "isync ", "ks ", "Maurice ", "Mikolaj Kucharski ", "Mohammad S Anwar ", "Neil Bowers ", "Olaf Alders ", "Paulo Custodio ", "TANIGUCHI Takaki ", "Thomas Sibley ", "Yuji Shimada ", "Yusuke Wada " ], "x_generated_by_perl" : "v5.26.1", "x_serialization_backend" : "Cpanel::JSON::XS version 4.10", "x_static_install" : 1 } WWW-YouTube-Download-0.62/README.md000644 000765 000024 00000011723 13547625436 020045 0ustar00olafaldersstaff000000 000000 # NAME WWW::YouTube::Download - WWW::YouTube::Download - Very simple YouTube video download interface # VERSION version 0.62 # SYNOPSIS use WWW::YouTube::Download; my $client = WWW::YouTube::Download->new; $client->download($video_id); my $video_url = $client->get_video_url($video_id); my $title = $client->get_title($video_id); # maybe encoded utf8 string. my $fmt = $client->get_fmt($video_id); # maybe highest quality. my $suffix = $client->get_suffix($video_id); # maybe highest quality file suffix # DESCRIPTION WWW::YouTube::Download is a library to download videos from YouTube. It relies entirely on scraping a video's webpage and does not use YT's /get\_video\_info URL space. # METHODS - **new()** $client = WWW::YouTube::Download->new; Creates a WWW::YouTube::Download instance. - **download($video\_id \[, \\%args\])** $client->download($video_id); $client->download($video_id, { fmt => 37, filename => 'sample.mp4', # save file name }); $client->download($video_id, { filename => '{title}.{suffix}', # maybe `video_title.mp4` }); $client->download($video_id, { cb => \&callback, }); Download the video file. The first parameter is passed to YouTube video url. Allowed arguments: - `cb` Set a callback subroutine, SEE [LWP::UserAgent](https://metacpan.org/pod/LWP::UserAgent) ':content\_cb' for details. - `filename` Set the filename, possibly using placeholders to be filled with information gathered about the video. `filename` supported format placeholders: {video_id} {title} {user} {fmt} {suffix} {resolution} Output filename is set to `{video_id}.{suffix}` by default. - `file_name` **DEPRECATED** alternative for `filename`. - `fmt` set the format to download. Defaults to the best video quality (inferred by the available resolutions). - **playback\_url($video\_id, \[, \\%args\])** $client->playback_url($video_id); $client->playback_url($video_id, { fmt => 37 }); Return playback URL of the video. This is direct link to the movie file. Function supports only "fmt" option. - **prepare\_download($video\_id)** Gather data about the video. A hash reference is returned, with the following keys: - `fmt` the default, suggested format. It is inferred by selecting the alternative with the highest resolution. - `fmt_list` the list of available formats, as an array reference. - `suffix` the filename extension associated to the default format (see `fmt` above). - `title` the title of the video - `user` the YouTube user owning the video - `video_id` the video identifier - `video_url` the URL of the video associated to the default format (see `fmt` above). - `video_url_map` an hash reference containing details about all available formats. The `video_url_map` has one key/value pair for each available format, where the key is the format identifier (can be used as `fmt` parameter for ["download"](#download), for example) and the value is a hash reference with the following data: - `fmt` the format specifier, that can be passed to ["download"](#download) - `resolution` the resolution as _width_x_height_ - `suffix` the suffix, providing a hint about the video format (e.g. webm, flv, ...) - `url` the URL where the video can be found - **ua(\[$ua\])** $self->ua->agent(); $self->ua($LWP_LIKE_OBJECT); Sets and gets LWP::UserAgent object. - **video\_id($url)** Parses given URL and returns video ID. - **playlist\_id($url)** Parses given URL and returns playlist ID. - **user\_id($url)** Parses given URL and returns YouTube username. - **get\_video\_url($video\_id)** - **get\_title($video\_id)** - **get\_user($video\_id)** - **get\_fmt($video\_id)** - **get\_fmt\_list($video\_id)** - **get\_suffix($video\_id)** # CONTRIBUTORS yusukebe # BUG REPORTING Please use github issues: [https://github.com/xaicron/p5-www-youtube-download/issues](https://github.com/xaicron/p5-www-youtube-download/issues). # SEE ALSO [WWW::YouTube::Info](https://metacpan.org/pod/WWW::YouTube::Info) and [WWW::YouTube::Info::Simple](https://metacpan.org/pod/WWW::YouTube::Info::Simple). [WWW::NicoVideo::Download](https://metacpan.org/pod/WWW::NicoVideo::Download) [http://rg3.github.io/youtube-dl/](http://rg3.github.io/youtube-dl/) # AUTHOR xaicron <xaicron {@} cpan.org> # COPYRIGHT AND LICENSE This software is copyright (c) 2013 - 2019 by Yuji Shimada. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. WWW-YouTube-Download-0.62/tidyall.ini000644 000765 000024 00000001752 13547625436 020732 0ustar00olafaldersstaff000000 000000 [PerlCritic] select = **/*.{pl,pm,t,psgi} ignore = .build/**/* ignore = WWW-YouTube-Download-*/**/* ignore = blib/**/* ignore = t/00-* ignore = t/author-* ignore = t/release-* ignore = t/zzz-* ignore = xt/**/* argv = --profile=$ROOT/perlcriticrc [PerlCritic non-auto-generated xt] select = xt/02_perlcritic.t select = xt/05_script-shebang.t select = xt/07_cpan_meta.t argv = --profile=$ROOT/perlcriticrc [PerlTidy] select = **/*.{pl,pm,t,psgi} ignore = .build/**/* ignore = WWW-YouTube-Download-*/**/* ignore = blib/**/* ignore = t/00-* ignore = t/author-* ignore = t/release-* ignore = t/zzz-* ignore = xt/**/* argv = --profile=$ROOT/perltidyrc [PerlTidy non-auto-generated xt] select = xt/02_perlcritic.t select = xt/05_script-shebang.t select = xt/07_cpan_meta.t argv = --profile=$ROOT/perltidyrc [Test::Vars] select = **/*.pm ignore = .build/**/* ignore = WWW-YouTube-Download-*/**/* ignore = blib/**/* ignore = t/00-* ignore = t/author-* ignore = t/release-* ignore = t/zzz-* ignore = xt/**/* WWW-YouTube-Download-0.62/lib/000755 000765 000024 00000000000 13547625436 017330 5ustar00olafaldersstaff000000 000000 WWW-YouTube-Download-0.62/eg/000755 000765 000024 00000000000 13547625436 017155 5ustar00olafaldersstaff000000 000000 WWW-YouTube-Download-0.62/Makefile.PL000644 000765 000024 00000003635 13547625436 020543 0ustar00olafaldersstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.012. use strict; use warnings; use 5.008001; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "WWW::YouTube::Download - Very simple YouTube video download interface", "AUTHOR" => "xaicron ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "WWW-YouTube-Download", "EXE_FILES" => [ "script/youtube-download", "script/youtube-playlists" ], "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.008001", "NAME" => "WWW::YouTube::Download", "PREREQ_PM" => { "Carp" => 0, "Encode" => 0, "Getopt::Long" => 0, "HTML::Entities" => 0, "HTTP::Request" => 0, "JSON::MaybeXS" => 0, "LWP::UserAgent" => 0, "Pod::Usage" => 0, "Term::ANSIColor" => 0, "Time::HiRes" => 0, "URI" => 0, "URI::QueryParam" => 0, "XML::TreePP" => 0, "constant" => 0, "strict" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "Test::More" => 0 }, "VERSION" => "0.62", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Carp" => 0, "Encode" => 0, "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "Getopt::Long" => 0, "HTML::Entities" => 0, "HTTP::Request" => 0, "JSON::MaybeXS" => 0, "LWP::UserAgent" => 0, "Pod::Usage" => 0, "Term::ANSIColor" => 0, "Test::More" => 0, "Time::HiRes" => 0, "URI" => 0, "URI::QueryParam" => 0, "XML::TreePP" => 0, "constant" => 0, "strict" => 0, "warnings" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); WWW-YouTube-Download-0.62/dist.ini000644 000765 000024 00000000651 13547625436 020230 0ustar00olafaldersstaff000000 000000 name = WWW-YouTube-Download author = xaicron license = Perl_5 copyright_holder = Yuji Shimada copyright_year = 2013 - 2019 main_module = lib/WWW/YouTube/Download.pm [@Author::OALDERS] ;-remove = Test::Perl::Critic -remove = Test::TidyAll -remove = Test::Synopsis -remove = PodCoverageTests StaticInstall.mode = on StaticInstall.dry_run = 0 [Prereqs / DevelopRequires] Test::Script::Shebang = 0 WWW-YouTube-Download-0.62/eg/cb.pl000644 000765 000024 00000000643 13547625436 020101 0ustar00olafaldersstaff000000 000000 use strict; use warnings; use WWW::YouTube::Download; my $video_id = shift || die "Usage: $0 [video_id|video_url]"; my $client = WWW::YouTube::Download->new; $client->download($video_id, { cb => \&cb, fmt => 18 }); my $fh; sub cb { my ($data, $res, $proto) = @_; unless ($fh) { open $fh, '>', "$video_id.mp4" or die "$video_id.mp4", " $!"; binmode $fh; } print $fh $data; } WWW-YouTube-Download-0.62/eg/menu.pl000644 000765 000024 00000001754 13547625436 020465 0ustar00olafaldersstaff000000 000000 use strict; use warnings; use WWW::YouTube::Download; my $url = shift || 'http://www.youtube.com/watch?v=w1IJiAXjj7k'; my $client = WWW::YouTube::Download->new(); my $data = $client->prepare_download($url); my $umap = $data->{video_url_map}; my @alternatives = @{$umap}{sort { $a <=> $b } keys %$umap}; $|++; my $choice; while (!defined $choice) { print {*STDOUT} "Available choices:\n"; for my $alt (@alternatives) { printf {*STDOUT} "%3d - %4s - resolution %s\n", @{$alt}{qw< fmt suffix resolution >}; } print {*STDOUT} "Your choice: "; (my $input = ) =~ s/\s+//gmxs; if (($input =~ m{^(?: 0 | [1-9]\d*)$}mxs) && exists $umap->{$input}) { $choice = $input; } else { print {*STDOUT} "Invalid choice\n\n"; } } ## end while (!defined $choice) # Ready to download my $filename = "$data->{video_id}.$umap->{$choice}{suffix}"; $client->download($url, {fmt => $choice, filename => $filename}); print "saved '$filename'\n"; WWW-YouTube-Download-0.62/eg/parallel.pl000644 000765 000024 00000000733 13547625436 021311 0ustar00olafaldersstaff000000 000000 use strict; use warnings; use WWW::YouTube::Download; use Parallel::ForkManager; my $urls = [qw{ http://www.youtube.com/watch?v=kKVYVj5-wQ0 http://www.youtube.com/watch?v=gtezI4QriS0 http://www.youtube.com/watch?v=rTJbGp8og7g }]; my $pm = Parallel::ForkManager->new(scalar @$urls); for my $url (@$urls) { my $pid = $pm->start and next; my $client = WWW::YouTube::Download->new; $client->download($url); $pm->finish; } $pm->wait_all_children; WWW-YouTube-Download-0.62/lib/WWW/000755 000765 000024 00000000000 13547625436 020014 5ustar00olafaldersstaff000000 000000 WWW-YouTube-Download-0.62/lib/WWW/YouTube/000755 000765 000024 00000000000 13547625436 021410 5ustar00olafaldersstaff000000 000000 WWW-YouTube-Download-0.62/lib/WWW/YouTube/Download.pm000644 000765 000024 00000040276 13547625436 023526 0ustar00olafaldersstaff000000 000000 package WWW::YouTube::Download; use strict; use warnings; use 5.008001; our $VERSION = '0.62'; use Carp qw(croak); use URI (); use LWP::UserAgent; use JSON::MaybeXS 'JSON'; use HTML::Entities qw/decode_entities/; use HTTP::Request; $Carp::Internal{ (__PACKAGE__) }++; use constant DEFAULT_FMT => 18; my $base_url = 'http://www.youtube.com/watch?v='; sub new { my $class = shift; my %args = @_; $args{ua} = LWP::UserAgent->new( agent => __PACKAGE__.'/'.$VERSION, parse_head => 0, ) unless exists $args{ua}; bless \%args, $class; } for my $name (qw[video_id video_url title user fmt fmt_list suffix]) { no strict 'refs'; *{"get_$name"} = sub { use strict 'refs'; my ($self, $video_id) = @_; croak "Usage: $self->get_$name(\$video_id|\$watch_url)" unless $video_id; my $data = $self->prepare_download($video_id); return $data->{$name}; }; } sub playback_url { my ($self, $video_id, $args) = @_; croak "Usage: $self->playback_url('[video_id|video_url]')" unless $video_id; $args ||= {}; my $data = $self->prepare_download($video_id); my $fmt = $args->{fmt} || $data->{fmt} || DEFAULT_FMT; my $video_url = $data->{video_url_map}{$fmt}{url} || croak "this video does not offer format (fmt) $fmt"; return $video_url; } sub download { my ($self, $video_id, $args) = @_; croak "Usage: $self->download('[video_id|video_url]')" unless $video_id; $args ||= {}; my $data = $self->prepare_download($video_id); my $fmt = $args->{fmt} || $data->{fmt} || DEFAULT_FMT; my $video_url = $data->{video_url_map}{$fmt}{url} || croak "this video has not supported fmt: $fmt"; $args->{filename} ||= $args->{file_name}; my $filename = $self->_format_filename($args->{filename}, { video_id => $data->{video_id}, title => $data->{title}, user => $data->{user}, fmt => $fmt, suffix => $data->{video_url_map}{$fmt}{suffix} || _suffix($fmt), resolution => $data->{video_url_map}{$fmt}{resolution} || '0x0', }); $args->{cb} = $self->_default_cb({ filename => $filename, verbose => $args->{verbose}, progress => $args->{progress}, overwrite => defined $args->{overwrite} ? $args->{overwrite} : 1, }) unless ref $args->{cb} eq 'CODE'; my $res = $self->ua->get($video_url, ':content_cb' => $args->{cb}); croak "!! $video_id download failed: ", $res->status_line if $res->is_error; } sub _format_filename { my ($self, $filename, $data) = @_; return "$data->{video_id}.$data->{suffix}" unless defined $filename; $filename =~ s#{([^}]+)}#$data->{$1} || "{$1}"#eg; return $filename; } sub _is_supported_fmt { my ($self, $video_id, $fmt) = @_; my $data = $self->prepare_download($video_id); defined($data->{video_url_map}{$fmt}{url}) ? 1 : 0; } sub _progress { my ($self, $args, $total) = @_; if (not defined $args->{_progress}) { eval "require Term::ProgressBar" or return; ## no critic $args->{_progress} = Term::ProgressBar->new( { count => $total, ETA => 'linear', remove => 0, fh => \*STDOUT } ); $args->{_progress}->minor( $total > 50_000_000 ? 1 : 0 ); $args->{_progress}->max_update_rate(1); $args->{_progress}->message("Total $total"); } return $args->{_progress}; } sub _default_cb { my ($self, $args) = @_; my ($file, $verbose, $overwrite, $progress) = @$args{qw/filename verbose overwrite progress/}; croak "file exists! $file" if -f $file and !$overwrite; open my $wfh, '>', $file or croak $file, " $!"; binmode $wfh; print "Downloading `$file`\n" if $verbose; return sub { my ($chunk, $res, $proto) = @_; print $wfh $chunk; # write file if ($verbose || $self->{verbose}) { my $size = tell $wfh; my $total = $res->header('Content-Length'); if ($progress) { if (my $p = $self->_progress($args, $total)){ $p->update($size); return; } else{ print "(You need Term::ProgressBar module to show progress bar with -P switch)\n"; $progress = 0; } } printf "%d/%d (%.2f%%)\r", $size, $total, $size / $total * 100; print "\n" if $total == $size; } }; } sub prepare_download { my ($self, $video_id) = @_; croak "Usage: $self->prepare_download('[video_id|watch_url]')" unless $video_id; $video_id = $self->video_id($video_id); return $self->{cache}{$video_id} if ref $self->{cache}{$video_id} eq 'HASH'; my $content = $self->_get_content($video_id); my $title = $self->_fetch_title($content); my $user = $self->_fetch_user($content); my $video_url_map = $self->_fetch_video_url_map($content); my $fmt_list = []; my $sorted = [ map { push @$fmt_list, $_->[0]->{fmt}; $_->[0] } sort { $b->[1] <=> $a->[1] } map { my $resolution = $_->{resolution}; $resolution =~ s/(\d+)x(\d+)/$1 * $2/e; [ $_, $resolution ] } values %$video_url_map, ]; my $hq_data = $sorted->[0]; return $self->{cache}{$video_id} = { video_id => $video_id, video_url => $hq_data->{url}, title => $title, user => $user, video_url_map => $video_url_map, fmt => $hq_data->{fmt}, fmt_list => $fmt_list, suffix => $hq_data->{suffix}, resolution => $hq_data->{resolution}, }; } sub _fetch_title { my ($self, $content) = @_; my ($title) = $content =~ // or return; return decode_entities($title); } sub _fetch_user { my ($self, $content) = @_; if( $content =~ /_get_args($content); unless ($args->{fmt_list} and $args->{url_encoded_fmt_stream_map}) { croak 'failed to find video urls'; } my $fmt_map = _parse_fmt_map($args->{fmt_list}); my $fmt_url_map = _parse_stream_map($args->{url_encoded_fmt_stream_map}); my $video_url_map = +{ map { $_->{fmt} => $_, } map +{ fmt => $_, resolution => $fmt_map->{$_}, url => $fmt_url_map->{$_}, suffix => _suffix($_), }, keys %$fmt_map }; return $video_url_map; } sub _get_content { my ($self, $video_id) = @_; my $url = "$base_url$video_id"; my $req = HTTP::Request->new; $req->method('GET'); $req->uri($url); $req->header('Accept-Language' => 'en-US'); my $res = $self->ua->request($req); croak "GET $url failed. status: ", $res->status_line if $res->is_error; return $res->content; } sub _get_args { my ($self, $content) = @_; my $data; for my $line (split "\n", $content) { next unless $line; if ($line =~ /the uploader has not made this video available in your country/i) { croak 'Video not available in your country'; } elsif ($line =~ /^.+ytplayer\.config\s*=\s*(\{.*})/) { ($data, undef) = JSON->new->utf8(1)->decode_prefix($1); last; } } croak 'failed to extract JSON data' unless $data->{args}; return $data->{args}; } sub _parse_fmt_map { my $param = shift; my $fmt_map = {}; for my $stuff (split ',', $param) { my ($fmt, $resolution) = split '/', $stuff; $fmt_map->{$fmt} = $resolution; } return $fmt_map; } sub _sigdecode { my @s = @_; # based on youtube_dl/extractor/youtube.py from yt-dl.org if (@s == 93) { return (reverse(@s[30..86]), $s[88], reverse(@s[6..28])); } elsif (@s == 92) { return ($s[25], @s[3..24], $s[0], @s[26..41], $s[79], @s[43..78], $s[91], @s[80..82]); } elsif (@s == 91) { return (reverse(@s[28..84]), $s[86], reverse(@s[6..26])); } elsif (@s == 90) { return ($s[25], @s[3..24], $s[2], @s[26..39], $s[77], @s[41..76], $s[89], @s[78..80]); } elsif (@s == 89) { return (reverse(@s[79..84]), $s[87], reverse(@s[61..77]), $s[0], reverse(@s[4..59])); } elsif (@s == 88) { return (@s[7..27], $s[87], @s[29..44], $s[55], @s[46..54], $s[2], @s[56..86], $s[28]); } elsif (@s == 87) { return (@s[6..26], $s[4], @s[28..38], $s[27], @s[40..58], $s[2], @s[60..86]); } elsif (@s == 86) { return (@s[4..30], $s[3], @s[32..84]); } elsif (@s == 85) { return (@s[3..10], $s[0], @s[12..54], $s[84], @s[56..83]); } elsif (@s == 84) { return (reverse(@s[71..78]), $s[14], reverse(@s[38..69]), $s[70], reverse(@s[15..36]), $s[80], reverse(@s[0..13])); } elsif (@s == 83) { return (reverse(@s[64..80]), $s[0], reverse(@s[1..62]), $s[63]); } elsif (@s == 82) { return (reverse(@s[38..80]), $s[7], reverse(@s[8..36]), $s[0], reverse(@s[1..6]), $s[37]); } elsif (@s == 81) { return ($s[56], reverse(@s[57..79]), $s[41], reverse(@s[42..55]), $s[80], reverse(@s[35..40]), $s[0], reverse(@s[30..33]), $s[34], reverse(@s[10..28]), $s[29], reverse(@s[1..8]), $s[9]); } elsif (@s == 80) { return (@s[1..18], $s[0], @s[20..67], $s[19], @s[69..79]); } elsif (@s == 79) { return ($s[54], reverse(@s[55..77]), $s[39], reverse(@s[40..53]), $s[78], reverse(@s[35..38]), $s[0], reverse(@s[30..33]), $s[34], reverse(@s[10..28]), $s[29], reverse(@s[1..8]), $s[9]); } return (); # fail } sub _getsig { my $sig = shift; croak 'Unable to find signature' unless $sig; my @sig = _sigdecode(split(//, $sig)); croak "Unable to decode signature $sig of length " . length($sig) unless @sig; return join('', @sig); } sub _parse_stream_map { my $param = shift; my $fmt_url_map = {}; for my $stuff (split ',', $param) { my $uri = URI->new; $uri->query($stuff); my $query = +{ $uri->query_form }; my $sig = $query->{sig} || ($query->{s} ? _getsig($query->{s}) : undef); my $url = $query->{url}; $fmt_url_map->{$query->{itag}} = $url . ($sig ? '&signature='.$sig : ''); } return $fmt_url_map; } sub ua { my ($self, $ua) = @_; return $self->{ua} unless $ua; croak "Usage: $self->ua(\$LWP_LIKE_OBJECT)" unless eval { $ua->isa('LWP::UserAgent') }; $self->{ua} = $ua; } sub _suffix { my $fmt = shift; return $fmt =~ /43|44|45|46/ ? 'webm' : $fmt =~ /18|22|37|38/ ? 'mp4' : $fmt =~ /13|17/ ? '3gp' : 'flv' ; } sub video_id { my ($self, $stuff) = @_; return unless $stuff; if ($stuff =~ m{/.*?[?&;!](?:v|video_id)=([^&#?=/;]+)}) { return $1; } elsif ($stuff =~ m{/(?:e|v|embed)/([^&#?=/;]+)}) { return $1; } elsif ($stuff =~ m{#p/(?:u|search)/\d+/([^&?/]+)}) { return $1; } elsif ($stuff =~ m{youtu.be/([^&#?=/;]+)}) { return $1; } else { return $stuff; } } sub playlist_id { my ($self, $stuff) = @_; return unless $stuff; if ($stuff =~ m{/.*?[?&;!]list=([^&#?=/;]+)}) { return $1; } elsif ($stuff =~ m{^\s*([FP]L[\w\-]+)\s*$}) { return $1; } return $stuff; } sub user_id { my ($self, $stuff) = @_; return unless $stuff; if ($stuff =~ m{/user/([^&#?=/;]+)}) { return $1; } return $stuff; } 1; =pod =encoding UTF-8 =head1 NAME WWW::YouTube::Download - WWW::YouTube::Download - Very simple YouTube video download interface =head1 VERSION version 0.62 =head1 SYNOPSIS use WWW::YouTube::Download; my $client = WWW::YouTube::Download->new; $client->download($video_id); my $video_url = $client->get_video_url($video_id); my $title = $client->get_title($video_id); # maybe encoded utf8 string. my $fmt = $client->get_fmt($video_id); # maybe highest quality. my $suffix = $client->get_suffix($video_id); # maybe highest quality file suffix =head1 DESCRIPTION WWW::YouTube::Download is a library to download videos from YouTube. It relies entirely on scraping a video's webpage and does not use YT's /get_video_info URL space. =head1 METHODS =over =item B $client = WWW::YouTube::Download->new; Creates a WWW::YouTube::Download instance. =item B $client->download($video_id); $client->download($video_id, { fmt => 37, filename => 'sample.mp4', # save file name }); $client->download($video_id, { filename => '{title}.{suffix}', # maybe `video_title.mp4` }); $client->download($video_id, { cb => \&callback, }); Download the video file. The first parameter is passed to YouTube video url. Allowed arguments: =over =item C Set a callback subroutine, SEE L ':content_cb' for details. =item C Set the filename, possibly using placeholders to be filled with information gathered about the video. C<< filename >> supported format placeholders: {video_id} {title} {user} {fmt} {suffix} {resolution} Output filename is set to C<{video_id}.{suffix}> by default. =item C B<< DEPRECATED >> alternative for C. =item C set the format to download. Defaults to the best video quality (inferred by the available resolutions). =back =item B $client->playback_url($video_id); $client->playback_url($video_id, { fmt => 37 }); Return playback URL of the video. This is direct link to the movie file. Function supports only "fmt" option. =item B Gather data about the video. A hash reference is returned, with the following keys: =over =item C the default, suggested format. It is inferred by selecting the alternative with the highest resolution. =item C the list of available formats, as an array reference. =item C the filename extension associated to the default format (see C above). =item C the title of the video =item C<user> the YouTube user owning the video =item C<video_id> the video identifier =item C<video_url> the URL of the video associated to the default format (see C<fmt> above). =item C<video_url_map> an hash reference containing details about all available formats. =back The C<video_url_map> has one key/value pair for each available format, where the key is the format identifier (can be used as C<fmt> parameter for L</download>, for example) and the value is a hash reference with the following data: =over =item C<fmt> the format specifier, that can be passed to L</download> =item C<resolution> the resolution as I<width>xI<height> =item C<suffix> the suffix, providing a hint about the video format (e.g. webm, flv, ...) =item C<url> the URL where the video can be found =back =item B<ua([$ua])> $self->ua->agent(); $self->ua($LWP_LIKE_OBJECT); Sets and gets LWP::UserAgent object. =item B<video_id($url)> Parses given URL and returns video ID. =item B<playlist_id($url)> Parses given URL and returns playlist ID. =item B<user_id($url)> Parses given URL and returns YouTube username. =item B<get_video_url($video_id)> =item B<get_title($video_id)> =item B<get_user($video_id)> =item B<get_fmt($video_id)> =item B<get_fmt_list($video_id)> =item B<get_suffix($video_id)> =back =head1 CONTRIBUTORS yusukebe =head1 BUG REPORTING Please use github issues: L<< https://github.com/xaicron/p5-www-youtube-download/issues >>. =head1 SEE ALSO L<WWW::YouTube::Info> and L<WWW::YouTube::Info::Simple>. L<WWW::NicoVideo::Download> L<http://rg3.github.io/youtube-dl/> =head1 AUTHOR xaicron <xaicron {@} cpan.org> =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 - 2019 by Yuji Shimada. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut __END__ # ABSTRACT: WWW::YouTube::Download - Very simple YouTube video download interface ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WWW-YouTube-Download-0.62/script/youtube-playlists��������������������������������������������������000755 �000765 �000024 �00000012307 13547625436 023535� 0����������������������������������������������������������������������������������������������������ustar�00olafalders����������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl # PODNAME: youtube-playlists.pl use strict; use warnings; use URI; use URI::QueryParam; use XML::TreePP; use WWW::YouTube::Download; use Getopt::Long qw(GetOptions :config bundling); use Pod::Usage qw(pod2usage); my $EOL = <<'EOF'; This script uses an End Of Lifed API URL. Patches to fix this would be most welcome. See https://github.com/xaicron/p5-www-youtube-download/issues/40 EOF print $EOL, "\n"; exit(1); my $api_url = 'http://gdata.youtube.com/feeds/api'; my $proxy = undef; GetOptions( 'C|no-colors!' => \my $disable_colors, 'i|video-id' => \my $only_id, 'n|normalize' => \my $normalize, 'p|proxy=s' => \$proxy, 'u|users' => \my $user_uploads, 'v|verbose' => \my $verbose, 'h|help' => sub { pod2usage(exitval => 0, -noperldoc => 1, -verbose => 2) }, 'V|version' => sub { show_version() }, ) or pod2usage(2); pod2usage() unless @ARGV; my $yt = WWW::YouTube::Download->new; my $tpp = XML::TreePP->new; if($proxy){ $yt->ua->proxy(['http','https'] => $proxy); print "--> Using proxy $proxy\n"; } main: { for my $id_or_url (@ARGV) { chatty("--> Working on %s\n", $id_or_url); my $id; if ($user_uploads) { $id = $yt->user_id($id_or_url); } else { $id = $yt->playlist_id($id_or_url); } throw('%s is not supported arguments', $id_or_url) unless $id; if ($normalize) { print "$id\n"; next; } my $url = get_api_url($id, $user_uploads); my $xml = fetch_playlist_xml($url); my @urls = find_video_urls($xml); @urls = map { $yt->video_id($_) } @urls if $only_id; print "$_\n" foreach @urls; } } sub get_api_url { my ($id, $uploads) = @_; if ($uploads) { return sprintf('%s/users/%s/uploads?v=2&max-results=50', $api_url, $id); } else { return sprintf('%s/playlists/%s?v=2&max-results=50', $api_url, $id); } } sub fetch_playlist_xml { my $url = shift; chatty('Fetching %s ... ', $url); my $res = $yt->ua->get($url); unless ($res->is_success) { throw('%s: %s', $url, $res->status_line); } chatty(pcolor(['green'], "done\n")); return $res->decoded_content; } sub find_video_urls { my $xml = shift; my @urls = (); chatty('Parsing XML ... '); my $tree = $tpp->parse($xml); my $entries = ref $tree->{feed}{entry} eq 'ARRAY' ? $tree->{feed}{entry} : [ $tree->{feed}{entry} ]; for my $entry (@$entries) { my $uri = URI->new($entry->{'media:group'}{'media:player'}{-url}); $uri->query_param_delete('feature'); push @urls, $uri->as_string; } chatty(pcolor(['green'], "done\n")); return @urls; } sub throw { my $format = shift; die pcolor(['red'], sprintf($format, @_)), "\n"; } sub chatty { return unless $verbose; my $format = shift; print STDERR sprintf $format, @_; } sub pcolor { my ($color, @msg) = @_; if ($^O eq 'MSWin32' || $disable_colors || !-t STDOUT) { return @msg; } eval { require Term::ANSIColor }; return @msg if $@; # module not available return Term::ANSIColor::colored($color, @msg); } sub show_version { print "youtube-playlists (WWW::YouTube::Download) version $WWW::YouTube::Download::VERSION\n"; exit; } =pod =encoding UTF-8 =head1 NAME youtube-playlists.pl - Find a YouTube video URLs from playlist(s) =head1 VERSION version 0.62 =head1 SYNOPSIS # print the list of video URLs $ youtube-playlists http://www.youtube.com/playlist?list=PLB199169FA7413767 $ youtube-playlists PLB199169FA7413767 # with youtube-download $ youtube-playlists PLB199169FA7413767 | youtube-download # with socks proxy $ youtube-playlists -p socks://<some IP>:<some port>/ PLB199169FA7413767 =head1 DESCRIPTION For each given argument B<youtube-playlists> generates list of YouTube video URLs. Arguments can be URL to playlist or to favorite list, or only IDs of a playlist or a favorite list. Because of current implementation number of results is limited to 50 video URLs. Deleted videos are represented as empty lines. =head1 END OF LIFE This script uses an End Of Lifed API URL, so it is currently broken. Patches to fix this would be most welcome. See https://github.com/xaicron/p5-www-youtube-download/issues/40 =head1 OPTIONS =over =item -C, --no-colors Force disable colored output =item -i, --video-id Print only video IDs, not full URLs =item -n, --normalize Print only normalized playlist IDs, but do not fetch anything. You can call it also dry run. =item -p, --proxy Use the given proxy. Note that using a socks proxy requires LWP::protocol::socks to be installed. =item -u, --users Parses given parameters as YouTube usernames and lists their uploaded videos. =item -v, --verbose turns on chatty output =item -h, --help display help =item -V, --version display version =back =head1 AUTHOR xaicron <xaicron {@} cpan.org> =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 - 2019 by Yuji Shimada. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut __END__ # ABSTRACT: Find a YouTube video URLs from playlist(s) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WWW-YouTube-Download-0.62/script/youtube-download���������������������������������������������������000755 �000765 �000024 �00000021454 13547625436 023323� 0����������������������������������������������������������������������������������������������������ustar�00olafalders����������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl # PODNAME: youtube-download.pl use strict; use warnings; use Getopt::Long qw(GetOptions :config bundling); use Pod::Usage qw(pod2usage); use WWW::YouTube::Download; use Encode qw(find_encoding decode_utf8); use Time::HiRes; my $encode = 'utf8'; my $overwrite = 0; my $verbose = -t STDOUT ? 1 : 0; # don't be verbose on dump terminal my $interval = 1; # sec my $proxy = undef; my $interactive = undef; my $progress = 0; GetOptions( 'C|no-colors!' => \my $disable_colors, 'U|url!' => \my $playback_url, 'o|output=s' => \my $output, 'F|fmt=i', => \my $fmt, 's|skip' => \my $skip, 'n|dry-run' => \my $dry_run, 'user-agent=s' => \my $user_agent, 'v|verbose!' => \$verbose, 'i|interval=i' => \$interval, 'a|interactive' => \$interactive, # 'a' for 'ask', 'i' was taken 'e|encode=s' => \$encode, 'f|force!' => \$overwrite, 'p|proxy=s' => \$proxy, 'P|progress!' => \$progress, 'q|quiet!' => sub { $verbose = 0 }, 'h|help' => sub { help() }, 'm|man' => sub { pod2usage(-verbose => 2) }, 'V|version!' => sub { show_version() }, ) or help(); challeng_load_argv_from_fh() unless @ARGV; help() unless @ARGV; my $encoder = find_encoding($encode) or throw("not supported encoding: $encode"); $output = $encoder->decode($output) if $output; my $client = WWW::YouTube::Download->new; if ($proxy) { $client->{ua}->proxy(['http','https'] => $proxy); print "--> Using proxy $proxy\n"; } if ($user_agent) { $client->{ua}->agent($user_agent); print "--> Using user-agent-string: \"".$client->{ua}->agent()."\"\n"; } main: { while (@ARGV) { my $video_id = shift @ARGV; my $meta_data = $client->prepare_download($video_id); chatty("--> Working on $meta_data->{video_id}"); ASK: if($interactive){ print "YouTube tells us these formats are available:\n"; print " format-tag \tresolution \tsuffix\n"; print "-----------------------------------------------\n"; for(sort keys %{ $$meta_data{video_url_map} }){ my $ref = ${ $$meta_data{video_url_map} }{$_}; print " $ref->{fmt} \t\t$ref->{resolution} \t$ref->{suffix}\n"; } print "Your selection (currently: ". ($fmt ? $fmt : '"best"/default' )."): "; $fmt = <>; chomp($fmt); } if ($fmt && !$client->_is_supported_fmt($video_id, $fmt)) { if($interactive){ print "[$meta_data->{video_id}] this video is not offered in fmt: $fmt\n"; goto ASK if $interactive; } throw("[$meta_data->{video_id}] this video is not offered in fmt: $fmt"); } if ($playback_url) { my $p_url = $client->playback_url($video_id, { fmt => $fmt }); chatty("Playback URL: $p_url"); next; } # multibyte fixes my $filename = $client->_format_filename($output, { video_id => $meta_data->{video_id}, user => $meta_data->{user}, resolution => $meta_data->{resolution}, title => decode_utf8($meta_data->{title}), suffix => $fmt ? $meta_data->{video_url_map}{$fmt}{suffix} : $meta_data->{suffix}, fmt => $fmt || $meta_data->{fmt}, }); $filename = filename_normalize($filename); $filename = $encoder->encode($filename, sub { sprintf 'U+%x', shift }); if ($dry_run) { print "$filename\n"; next; } if ($skip && -e $filename) { print "Skipping existing file: $filename\n"; next; } eval { $client->download($video_id, { filename => $filename, fmt => $fmt, verbose => $verbose, overwrite => $overwrite, progress => $progress, }); }; if (my $e = $@) { unlink $filename if -e $filename && !-s $filename; throw("[$meta_data->{video_id}] $e"); } chatty(pcolor(['green'], 'Download successful!')); Time::HiRes::sleep($interval) if @ARGV; } } exit; sub challeng_load_argv_from_fh { return unless $0 ne '-' && !-t STDIN; # e.g. $ youtube-download < video_list while (defined (my $line = <STDIN>)) { chomp $line; $line =~ s/#.*$//; # comment $line =~ s/^\s+|\s+$//g; # trim spaces push @ARGV, $line; } } sub filename_normalize { my $filename = shift; $filename =~ s#[[:cntrl:]]##smg; # remove all control characters $filename =~ s#^\s+|\s+$##g; # trim spaces $filename =~ s#^\.+##; # remove multiple leading dots $filename =~ tr#"/\\:*?<>|#'\-\-\-_____#; # NTFS and FAT unsupported characters return $filename; } sub throw { die pcolor(['red'], 'ERROR: ', @_), "\n"; } sub chatty { print @_, "\n"; } sub pcolor { my ($color, @msg) = @_; if ($^O eq 'MSWin32' || $disable_colors || !-t STDOUT) { return @msg; } eval { require Term::ANSIColor }; return @msg if $@; # module not available return Term::ANSIColor::colored($color, @msg); } sub show_version { print "youtube-download (WWW::YouTube::Download) version $WWW::YouTube::Download::VERSION\n"; exit; } sub help { print << 'HELP'; Usage: youtube-download [options] video_id_or_video_url ... Options: -C, --no-colors Disable colored output -o, --output Output filename, supports `{$value}` format -e, --encode File system encoding (e.g. cp932) -F, --fmt Video quality (SEE ALSO Wikipedia) -f, --force Force overwrite output file -s, --skip Skip download when output file exists -i, --interval Download interval -p, --proxy Use the stated proxy -n, --dry-run Do not download any videos, print target filenames -P, --progress Show progress bar if you have Term::ProgressBar -v, --verbose Turns on chatty output (default: enabled) -q, --quiet Turns off progress -U, --url Display playback URL for a video -h, --help Display help -m, --man Display man page -V, --version Display version --user-agent Supply your own user-agent string supported `{$value}` format are: {video_id} / {user} / {title} / {fmt} / {suffix} / {resolution} Examples: $ youtube-download -o "[{video_id}] {title}.{suffix}" $ youtube-download -p socks://127.0.0.1:4321/ -o "{title} by {user} (youtube {video_id}).{suffix}" HELP exit 1; } =pod =encoding UTF-8 =head1 NAME youtube-download.pl - youtube-download - Download video(s) from YouTube =head1 VERSION version 0.62 =head1 SYNOPSIS $ youtube-download bT8yLWy4B5w $ youtube-download http://www.youtube.com/watch?v=bT8yLWy4B5w $ youtube-download < video_list_file =head1 OPTIONS =over =item -C, --no-colors Force disable colored output =item -o, --output output filename, supports `{$value}` format (default: {video_id}.{suffix}) =item -i, --interval Download interval (default: 1 (sec)) =item -p Use the given proxy. Requires LWP::Protocol::socks to be installed for socks proxies. See examples for syntax. (default: no proxy) =item -e, --encode File system encoding (default: utf8) =item -s, --skip Skip downloading a video, if target file exists. =item -f, --force Force overwrite output file (default: disabled) =item -n, --dry-run Do not download any videos, but print their target filenames, as defined by -o option. This option still sends query to Google servers to fetch details about given video. =item -F, --fmt Video quality (SEE ALSO Wikipedia) =item -v, --verbose Turns on chatty output (default: enabled) =item -U, --url Show playback URL of a video, but do not download it =item -P, --progress Show progress bar if you have Term::ProgressBar =item -q, --quiet Turns off the most output =item -h, --help Display help =item -m, --man Display help page =item -V, --version Display version =item --user-agent Supply your own user agent string =back =head2 supported `{$value}` format {video_id} / {user} / {title} / {fmt} / {suffix} / {resolution} Example: $ youtube-download -o "[{video_id}] {title}.{suffix}" $ youtube-download -p socks://127.0.0.1:4321/ -o "{title} by {user} (youtube {video_id}).{suffix}" =head1 AUTHOR xaicron <xaicron {@} cpan.org> =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2013 - 2019 by Yuji Shimada. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut __END__ # ABSTRACT: youtube-download - Download video(s) from YouTube ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WWW-YouTube-Download-0.62/xt/perlcriticrc�����������������������������������������������������������000644 �000765 �000024 �00000000177 13547625436 021632� 0����������������������������������������������������������������������������������������������������ustar�00olafalders����������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������verbose=11 [TestingAndDebugging::ProhibitNoStrict] allow=refs [ValuesAndExpressions::ProhibitAccessOfPrivateData] severity=4 �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WWW-YouTube-Download-0.62/xt/05_script-shebang.t����������������������������������������������������000644 �000765 �000024 �00000000561 13547625436 022621� 0����������������������������������������������������������������������������������������������������ustar�00olafalders����������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������use strict; use warnings; use Test::More; use Test::Requires 'Test::Script::Shebang'; use File::Find qw/find/; my @files; for my $dir (qw/bin script/) { next unless -d $dir; find { no_chdir => 1, wanted => sub { push @files, $_ if -f }, }, $dir; } plan skip_all => 'script not found' unless @files; check_shebang(@files); done_testing; �����������������������������������������������������������������������������������������������������������������������������������������������WWW-YouTube-Download-0.62/xt/author/����������������������������������������������������������������000755 �000765 �000024 �00000000000 13547625436 020517� 5����������������������������������������������������������������������������������������������������ustar�00olafalders����������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������WWW-YouTube-Download-0.62/xt/release/���������������������������������������������������������������000755 �000765 �000024 �00000000000 13547625436 020635� 5����������������������������������������������������������������������������������������������������ustar�00olafalders����������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������WWW-YouTube-Download-0.62/xt/07_cpan_meta.t���������������������������������������������������������000644 �000765 �000024 �00000000304 13547625436 021634� 0����������������������������������������������������������������������������������������������������ustar�00olafalders����������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������use Test::More; eval "use Test::CPAN::Meta"; plan skip_all => "Test::CPAN::Meta required for testing META.yml" if $@; plan skip_all => "There is no META.yml" unless -f "META.yml"; meta_yaml_ok(); ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WWW-YouTube-Download-0.62/xt/02_perlcritic.t��������������������������������������������������������000644 �000765 �000024 �00000000333 13547625436 022042� 0����������������������������������������������������������������������������������������������������ustar�00olafalders����������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������use strict; use Test::More; eval { require Test::Perl::Critic; Test::Perl::Critic->import( -profile => 'xt/perlcriticrc'); }; plan skip_all => "Test::Perl::Critic is not installed." if $@; all_critic_ok('lib'); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WWW-YouTube-Download-0.62/xt/release/cpan-changes.t�������������������������������������������������000644 �000765 �000024 �00000000344 13547625436 023352� 0����������������������������������������������������������������������������������������������������ustar�00olafalders����������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::CPAN::Changes 0.012 use Test::More 0.96 tests => 1; use Test::CPAN::Changes; subtest 'changes_ok' => sub { changes_file_ok('Changes'); }; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WWW-YouTube-Download-0.62/xt/author/pod-syntax.t����������������������������������������������������000644 �000765 �000024 �00000000252 13547625436 023011� 0����������������������������������������������������������������������������������������������������ustar�00olafalders����������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WWW-YouTube-Download-0.62/xt/author/pod-spell.t�����������������������������������������������������000644 �000765 �000024 �00000001305 13547625436 022602� 0����������������������������������������������������������������������������������������������������ustar�00olafalders����������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::PodSpelling 2.007005 use Test::Spelling 0.12; use Pod::Wordlist; add_stopwords(<DATA>); all_pod_files_spelling_ok( qw( bin lib ) ); __DATA__ Ahmad Alders Alders' Alexandr Anwar Book Bowers Ciornii Custodio Dan Download Estrade Flavio Isyaltut Kucharski Maurice Mikolaj Mohammad Neil Olaf Paulo Poletti Shimada Sibley Syaltut TANIGUCHI Takaki Thomas WWW Wada YouTube Yuji Yusuke Zucker akiyama akiym alexchorny cpan estrabd flavio flv gregoa gregor grinnz herrmann isync ks lib mauricemengel mikolaj mohammad neil olaf pauloscustodio playlist script takaki tsibley webm webpage widthxheight xaicron youtube yusuke yusukebe ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WWW-YouTube-Download-0.62/contrib/gencode.pl��������������������������������������������������������000644 �000765 �000024 �00000002576 13547625436 022175� 0����������������������������������������������������������������������������������������������������ustar�00olafalders����������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/perl # Public Domain # simple script to generate perl code from yt-dl.org python code # perl gencode.pl < youtube.py # or # youtube-dl -v \ # --no-cache-dir \ # --skip-download \ # --youtube-print-sig-code http://youtu.be/cmSbXsFE3l8 | \ # tail -n 3 | perl gencode.pl use warnings; use strict; my $len; my $found; while (<STDIN>) { if (m/if\s+len.\w+.\s+==\s+(\d+)\:/) { $len = $1; printf(" \x7d elsif (\@s == %d) \x7b\n", $len); next; } if ($len && m/return\s+(.*)\s*$/) { my @items = (); for (split(/\s*\+\s*/, $1)) { if (m/^\w+\[(\d+)\]$/) { push @items, "\$s[$1]"; } elsif (m/^\w+\[:(\d+)\]$/) { my $i = $1 - 1; push @items, "\@s[0..$i]"; } elsif (m/^\w+\[(\d+):(\d+)\]$/) { my $i = $2 - 1; push @items, "\@s[$1..$i]"; } elsif (m/^\w+\[(\d+):(\d+):-1\]$/) { my $i = $2 + 1; push @items, "reverse(\@s[$i..$1])"; } elsif (m/^\w+\[(\d+)::-1\]$/) { push @items, "reverse(\@s[0..$1])"; } elsif (m/^\w+\[:(\d+)\]\[::-1\]$/) { my $i = $1 - 1; push @items, "reverse(\@s[0..$i])"; } elsif (m/^\w+\[(\d+):\]$/) { my $i = $len - 1; push @items, "\@s[$1..$i]"; } else { die "Unable to parse: $_"; } } my $str = join(', ', @items); printf(" return (%s);\n", $str); $found = 1 if $str; undef $len; next; } elsif ($found && m/ExtractorError/) { printf(" \x7d\n"); last; } } ����������������������������������������������������������������������������������������������������������������������������������WWW-YouTube-Download-0.62/t/video_user.t������������������������������������������������������������000644 �000765 �000024 �00000000554 13547625436 021362� 0����������������������������������������������������������������������������������������������������ustar�00olafalders����������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������use strict; use warnings; use Test::More; use WWW::YouTube::Download; my $wyd = WWW::YouTube::Download->new; sub test_video_user { my ($content, $expects) = @_; my $user = $wyd->_fetch_user($content); is $user, $expects; } test_video_user( '<span class="yt-user-name " dir="ltr">GoogleTechTalks</span>', 'GoogleTechTalks', ); done_testing; ����������������������������������������������������������������������������������������������������������������������������������������������������WWW-YouTube-Download-0.62/t/user_id.t���������������������������������������������������������������000644 �000765 �000024 �00000001030 13547625436 020636� 0����������������������������������������������������������������������������������������������������ustar�00olafalders����������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������use strict; use warnings; use Test::More; use WWW::YouTube::Download; sub test_user_id { my ($input, $expects) = @_; is +WWW::YouTube::Download->new()->user_id($input), $expects; } test_user_id( 'http://www.youtube.com/user/EpicStepsFromHell/videos?flow=list&view=0', 'EpicStepsFromHell' ); test_user_id( 'http://www.youtube.com/user/ZackHemsey', 'ZackHemsey' ); test_user_id( 'http://www.youtube.com/user/bsdconferences/', 'bsdconferences' ); test_user_id( 'VEVO', 'VEVO' ); done_testing; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WWW-YouTube-Download-0.62/t/video_id.t��������������������������������������������������������������000644 �000765 �000024 �00000003174 13547625436 021001� 0����������������������������������������������������������������������������������������������������ustar�00olafalders����������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������use strict; use warnings; use Test::More; use WWW::YouTube::Download; sub test_video_id { my ($input, $expects) = @_; is +WWW::YouTube::Download->new()->video_id($input), $expects; } test_video_id( 'http://www.youtube.com/watch?feature=player_detailpage&v=jDJg0cnvBFM', 'jDJg0cnvBFM', ); test_video_id( 'http://www.youtube.com/watch?v=_cqgWvFmtz0', '_cqgWvFmtz0', ); test_video_id( 'http://www.youtube.com/watch?v=ooZPKEAaidY&feature=player_profilepage', 'ooZPKEAaidY', ); test_video_id( 'http://www.youtube.com/watch?v=ooZPKEAaidY&feature=player_profilepage#t=191s', 'ooZPKEAaidY', ); test_video_id( 'http://www.youtube.com/watch?v=jDJg0cnvBFM&feature=related', 'jDJg0cnvBFM', ); test_video_id( 'http://www.youtube.com/v/rQ4qoX7GWME', 'rQ4qoX7GWME', ); test_video_id( 'JZcrLTSKHlU', 'JZcrLTSKHlU', ); test_video_id( '38O4rHD_PQs', '38O4rHD_PQs', ); test_video_id( 'http://www.youtube.com/user/Supercali006#p/u/40/ZgDKIyxaK8A', 'ZgDKIyxaK8A', ); test_video_id( 'http://www.youtube.com/e/UpaxndP5G2Y', 'UpaxndP5G2Y', ); test_video_id( 'www.youtube.com/?v=AfooxdRYeJU', 'AfooxdRYeJU', ); test_video_id( 'http://www.youtube.com/embed/0zM3nApSvMg?rel=0', '0zM3nApSvMg', ); test_video_id( 'http://www.youtube.com/v/INsSU8Jnx-4?fs=1&hl=en', 'INsSU8Jnx-4', ); test_video_id( 'http://www.youtube.com/watch#!v=fqNKwF18cq0', 'fqNKwF18cq0', ); test_video_id( 'youtu.be/HyNh3AXegxw', 'HyNh3AXegxw', ); test_video_id( 'http://www.youtube.com/user/MeitalDohanVEVO?video_id=tB9WoMebMEA', 'tB9WoMebMEA', ); done_testing; ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WWW-YouTube-Download-0.62/t/youtube.t���������������������������������������������������������������000644 �000765 �000024 �00000001416 13547625436 020710� 0����������������������������������������������������������������������������������������������������ustar�00olafalders����������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������use strict; use warnings; use Test::More; use WWW::YouTube::Download; use LWP::UserAgent; use HTTP::Request; plan skip_all => 'env P5_YOUTUBE_NETWORK_TESTS not set' unless defined($ENV{'P5_YOUTUBE_NETWORK_TESTS'}); sub check_video_fetch_url { my $video_id = shift; my $yt = WWW::YouTube::Download->new(); my $url = $yt->playback_url($video_id); my $ua = LWP::UserAgent->new(); $ua->agent(''); $ua->timeout('60'); $ua->env_proxy; my $request = HTTP::Request->new; $request->method('HEAD'); $request->uri($url); my $response = $ua->request($request); my $code = $response->code; is $code, 200; } # YAPC video 1 check_video_fetch_url('Y1I1KcKvz9Q'); # YAPC video 2 check_video_fetch_url('oAkasBMJJ18'); done_testing; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WWW-YouTube-Download-0.62/t/00_compile.t������������������������������������������������������������000644 �000765 �000024 �00000000122 13547625436 021134� 0����������������������������������������������������������������������������������������������������ustar�00olafalders����������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������use strict; use Test::More tests => 1; BEGIN { use_ok 'WWW::YouTube::Download' } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WWW-YouTube-Download-0.62/t/00-report-prereqs.t�����������������������������������������������������000644 �000765 �000024 �00000013426 13547625436 022427� 0����������������������������������������������������������������������������������������������������ustar�00olafalders����������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl use strict; use warnings; # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.027 use Test::More tests => 1; use ExtUtils::MakeMaker; use File::Spec; # from $version::LAX my $lax_version_re = qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )? | (?:\.[0-9]+) (?:_[0-9]+)? ) | (?: v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )? | (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)? ) )/x; # hide optional CPAN::Meta modules from prereq scanner # and check if they are available my $cpan_meta = "CPAN::Meta"; my $cpan_meta_pre = "CPAN::Meta::Prereqs"; my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic # Verify requirements? my $DO_VERIFY_PREREQS = 1; sub _max { my $max = shift; $max = ( $_ > $max ) ? $_ : $max for @_; return $max; } sub _merge_prereqs { my ($collector, $prereqs) = @_; # CPAN::Meta::Prereqs object if (ref $collector eq $cpan_meta_pre) { return $collector->with_merged_prereqs( CPAN::Meta::Prereqs->new( $prereqs ) ); } # Raw hashrefs for my $phase ( keys %$prereqs ) { for my $type ( keys %{ $prereqs->{$phase} } ) { for my $module ( keys %{ $prereqs->{$phase}{$type} } ) { $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module}; } } } return $collector; } my @include = qw( ); my @exclude = qw( ); # Add static prereqs to the included modules list my $static_prereqs = do './t/00-report-prereqs.dd'; # Merge all prereqs (either with ::Prereqs or a hashref) my $full_prereqs = _merge_prereqs( ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ), $static_prereqs ); # Add dynamic prereqs to the included modules list (if we can) my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; my $cpan_meta_error; if ( $source && $HAS_CPAN_META && (my $meta = eval { CPAN::Meta->load_file($source) } ) ) { $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); } else { $cpan_meta_error = $@; # capture error from CPAN::Meta->load_file($source) $source = 'static metadata'; } my @full_reports; my @dep_errors; my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs; # Add static includes into a fake section for my $mod (@include) { $req_hash->{other}{modules}{$mod} = 0; } for my $phase ( qw(configure build test runtime develop other) ) { next unless $req_hash->{$phase}; next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING}); for my $type ( qw(requires recommends suggests conflicts modules) ) { next unless $req_hash->{$phase}{$type}; my $title = ucfirst($phase).' '.ucfirst($type); my @reports = [qw/Module Want Have/]; for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) { next if $mod eq 'perl'; next if grep { $_ eq $mod } @exclude; my $file = $mod; $file =~ s{::}{/}g; $file .= ".pm"; my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; my $want = $req_hash->{$phase}{$type}{$mod}; $want = "undef" unless defined $want; $want = "any" if !$want && $want == 0; my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; if ($prefix) { my $have = MM->parse_version( File::Spec->catfile($prefix, $file) ); $have = "undef" unless defined $have; push @reports, [$mod, $want, $have]; if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) { if ( $have !~ /\A$lax_version_re\z/ ) { push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)"; } elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) { push @dep_errors, "$mod version '$have' is not in required range '$want'"; } } } else { push @reports, [$mod, $want, "missing"]; if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) { push @dep_errors, "$mod is not installed ($req_string)"; } } } if ( @reports ) { push @full_reports, "=== $title ===\n\n"; my $ml = _max( map { length $_->[0] } @reports ); my $wl = _max( map { length $_->[1] } @reports ); my $hl = _max( map { length $_->[2] } @reports ); if ($type eq 'modules') { splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports; } else { splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports; } push @full_reports, "\n"; } } } if ( @full_reports ) { diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports; } if ( $cpan_meta_error || @dep_errors ) { diag "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n"; } if ( $cpan_meta_error ) { my ($orig_source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; diag "\nCPAN::Meta->load_file('$orig_source') failed with: $cpan_meta_error\n"; } if ( @dep_errors ) { diag join("\n", "\nThe following REQUIRED prerequisites were not satisfied:\n", @dep_errors, "\n" ); } pass; # vim: ts=4 sts=4 sw=4 et: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WWW-YouTube-Download-0.62/t/playlist_id.t�����������������������������������������������������������000644 �000765 �000024 �00000002411 13547625436 021525� 0����������������������������������������������������������������������������������������������������ustar�00olafalders����������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������use strict; use warnings; use Test::More; use WWW::YouTube::Download; sub test_playlist_id { my ($input, $expects) = @_; is +WWW::YouTube::Download->new()->playlist_id($input), $expects; } test_playlist_id( 'http://www.youtube.com/playlist?list=FLa6SM4ycX9Ltbrhf71es_RA', 'FLa6SM4ycX9Ltbrhf71es_RA' ); test_playlist_id( 'FLbKM5fcSsaEFZRP-bjH8Y9w', 'FLbKM5fcSsaEFZRP-bjH8Y9w' ); test_playlist_id( 'http://www.youtube.com/watch?v=9VV8sgVSZNQ&list=ALHTd1VmZQRNpEtPhKH9FrcB_S6domiCtv', 'ALHTd1VmZQRNpEtPhKH9FrcB_S6domiCtv' ); test_playlist_id( 'http://www.youtube.com/playlist?list=PLUyiyCkoNwG8C_4ljTZWYYxmw7emk0W-f', 'PLUyiyCkoNwG8C_4ljTZWYYxmw7emk0W-f' ); test_playlist_id( 'http://www.youtube.com/watch?v=tAjFnJuk1Aw&list=PL48DBEDD2147DDC46', 'PL48DBEDD2147DDC46' ); test_playlist_id( 'ALHTd1VmZQRNpEtPhKH9FrcB_S6domiCtv', 'ALHTd1VmZQRNpEtPhKH9FrcB_S6domiCtv' ); test_playlist_id( 'PLu-EVkxXzIVQp07QyLO0qFNQjBHkHwPf2', 'PLu-EVkxXzIVQp07QyLO0qFNQjBHkHwPf2' ); test_playlist_id( '3J3dCCJTos-sucVYP7nAWmR97LFbiVNJ', '3J3dCCJTos-sucVYP7nAWmR97LFbiVNJ' ); test_playlist_id( 'PLA0FA2050A02AEFF4', 'PLA0FA2050A02AEFF4' ); test_playlist_id( 'C5353E661DEF8150', 'C5353E661DEF8150' ); done_testing; �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WWW-YouTube-Download-0.62/t/00-report-prereqs.dd����������������������������������������������������000644 �000765 �000024 �00000006472 13547625436 022556� 0����������������������������������������������������������������������������������������������������ustar�00olafalders����������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������do { my $x = { 'configure' => { 'requires' => { 'ExtUtils::MakeMaker' => '0', 'perl' => '5.008001' } }, 'develop' => { 'recommends' => { 'Dist::Zilla::PluginBundle::Git::VersionManager' => '0.007' }, 'requires' => { 'Code::TidyAll' => '0.71', 'Code::TidyAll::Plugin::SortLines::Naturally' => '0.000003', 'Code::TidyAll::Plugin::Test::Vars' => '0.04', 'Code::TidyAll::Plugin::UniqueLines' => '0.000003', 'File::Find' => '0', 'Parallel::ForkManager' => '1.19', 'Perl::Critic' => '1.132', 'Perl::Tidy' => '20180220', 'Pod::Wordlist' => '0', 'Test::CPAN::Changes' => '0.19', 'Test::More' => '0.96', 'Test::Perl::Critic' => '0', 'Test::Pod' => '1.41', 'Test::Requires' => '0', 'Test::Script::Shebang' => '0', 'Test::Spelling' => '0.12', 'Test::Vars' => '0.014' } }, 'runtime' => { 'requires' => { 'Carp' => '0', 'Encode' => '0', 'Getopt::Long' => '0', 'HTML::Entities' => '0', 'HTTP::Request' => '0', 'JSON::MaybeXS' => '0', 'LWP::UserAgent' => '0', 'Pod::Usage' => '0', 'Term::ANSIColor' => '0', 'Time::HiRes' => '0', 'URI' => '0', 'URI::QueryParam' => '0', 'XML::TreePP' => '0', 'constant' => '0', 'perl' => '5.008001', 'strict' => '0', 'warnings' => '0' } }, 'test' => { 'recommends' => { 'CPAN::Meta' => '2.120900' }, 'requires' => { 'ExtUtils::MakeMaker' => '0', 'File::Spec' => '0', 'Test::More' => '0', 'perl' => '5.008001' } } }; $x; }������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������