tubedl 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.idea/.rakeTasks +7 -0
- data/.idea/dictionaries/gokhan.xml +3 -0
- data/.idea/inspectionProfiles/Project_Default.xml +11 -0
- data/.idea/inspectionProfiles/profiles_settings.xml +0 -0
- data/.idea/misc.xml +4 -0
- data/.idea/modules.xml +8 -0
- data/.idea/tubedl.iml +11 -0
- data/.idea/vcs.xml +6 -0
- data/.idea/workspace.xml +207 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +68 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/tubedl.rb +45 -0
- data/lib/tubedl/playlist_parser.rb +48 -0
- data/lib/tubedl/version.rb +3 -0
- data/lib/tubedl/youtube_video.rb +5 -0
- data/tubedl.gemspec +43 -0
- metadata +132 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 9bc12094f42b4d4ab4d60063927c549715f4fe9a
|
|
4
|
+
data.tar.gz: 77e226d742df032c363461f652f4b21063b6e311
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 7b66e6afb13ccb383b8f8323e86473cd4cfacc3db33da002772e07a0ce6ab36be4528ea358b0b358e1edcb864ac2f518f5f4c931869e823ae15271e7e916574a
|
|
7
|
+
data.tar.gz: aab5a344e51fd8d60e7f6b15e88eb56b93f6a7a9aa97cdec30f9fe96c6198d78a59fa759d5d93e7645147ac19b92f9f71c060074847c1a8dd3dfc9f05e9d9cbb
|
data/.gitignore
ADDED
data/.idea/.rakeTasks
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<Settings><!--This file was automatically generated by Ruby plugin.
|
|
3
|
+
You are allowed to:
|
|
4
|
+
1. Remove rake task
|
|
5
|
+
2. Add existing rake tasks
|
|
6
|
+
To add existing rake tasks automatically delete this file and reload the project.
|
|
7
|
+
--><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Build tubedl-0.1.0.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Remove any temporary products" fullCmd="clean" taksId="clean" /><RakeTask description="Remove any generated files" fullCmd="clobber" taksId="clobber" /><RakeTask description="Build and install tubedl-0.1.0.gem into system gems" fullCmd="install" taksId="install" /><RakeGroup description="" fullCmd="" taksId="install"><RakeTask description="Build and install tubedl-0.1.0.gem into system gems without network access" fullCmd="install:local" taksId="local" /></RakeGroup><RakeTask description="Create tag v0.1.0 and build and push tubedl-0.1.0.gem to Rubygems" fullCmd="release[remote]" taksId="release[remote]" /><RakeTask description="Run tests" fullCmd="test" taksId="test" /><RakeTask description="" fullCmd="default" taksId="default" /><RakeTask description="" fullCmd="release" taksId="release" /><RakeGroup description="" fullCmd="" taksId="release"><RakeTask description="" fullCmd="release:guard_clean" taksId="guard_clean" /><RakeTask description="" fullCmd="release:rubygem_push" taksId="rubygem_push" /><RakeTask description="" fullCmd="release:source_control_push" taksId="source_control_push" /></RakeGroup></RakeGroup></Settings>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<component name="InspectionProjectProfileManager">
|
|
2
|
+
<profile version="1.0">
|
|
3
|
+
<option name="myName" value="Project Default" />
|
|
4
|
+
<inspection_tool class="Rubocop" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
5
|
+
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
|
6
|
+
<option name="processCode" value="true" />
|
|
7
|
+
<option name="processLiterals" value="true" />
|
|
8
|
+
<option name="processComments" value="true" />
|
|
9
|
+
</inspection_tool>
|
|
10
|
+
</profile>
|
|
11
|
+
</component>
|
|
File without changes
|
data/.idea/misc.xml
ADDED
data/.idea/modules.xml
ADDED
data/.idea/tubedl.iml
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="RUBY_MODULE" version="4">
|
|
3
|
+
<component name="ModuleRunConfigurationManager">
|
|
4
|
+
<shared />
|
|
5
|
+
</component>
|
|
6
|
+
<component name="NewModuleRootManager">
|
|
7
|
+
<content url="file://$MODULE_DIR$" />
|
|
8
|
+
<orderEntry type="inheritedJdk" />
|
|
9
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
10
|
+
</component>
|
|
11
|
+
</module>
|
data/.idea/vcs.xml
ADDED
data/.idea/workspace.xml
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ChangeListManager">
|
|
4
|
+
<list default="true" id="99bcc018-28a5-4a4a-b8bd-6450101751a9" name="Default" comment="">
|
|
5
|
+
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.gitignore" />
|
|
6
|
+
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/.rakeTasks" />
|
|
7
|
+
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/dictionaries/gokhan.xml" />
|
|
8
|
+
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" />
|
|
9
|
+
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/inspectionProfiles/profiles_settings.xml" />
|
|
10
|
+
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/misc.xml" />
|
|
11
|
+
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/modules.xml" />
|
|
12
|
+
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/tubedl.iml" />
|
|
13
|
+
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/vcs.xml" />
|
|
14
|
+
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.travis.yml" />
|
|
15
|
+
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/CODE_OF_CONDUCT.md" />
|
|
16
|
+
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/Gemfile" />
|
|
17
|
+
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/LICENSE.txt" />
|
|
18
|
+
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/README.md" />
|
|
19
|
+
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/Rakefile" />
|
|
20
|
+
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/bin/console" />
|
|
21
|
+
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/bin/setup" />
|
|
22
|
+
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/tubedl.rb" />
|
|
23
|
+
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/tubedl/version.rb" />
|
|
24
|
+
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/test/test_helper.rb" />
|
|
25
|
+
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/test/tubedl_test.rb" />
|
|
26
|
+
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/tubedl.gemspec" />
|
|
27
|
+
</list>
|
|
28
|
+
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
|
29
|
+
<option name="TRACKING_ENABLED" value="true" />
|
|
30
|
+
<option name="SHOW_DIALOG" value="false" />
|
|
31
|
+
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
32
|
+
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
33
|
+
<option name="LAST_RESOLUTION" value="IGNORE" />
|
|
34
|
+
</component>
|
|
35
|
+
<component name="FileEditorManager">
|
|
36
|
+
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
|
|
37
|
+
<file leaf-file-name="tubedl.rb" pinned="false" current-in-tab="true">
|
|
38
|
+
<entry file="file://$PROJECT_DIR$/lib/tubedl.rb">
|
|
39
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
40
|
+
<state relative-caret-position="102">
|
|
41
|
+
<caret line="6" column="2" lean-forward="false" selection-start-line="6" selection-start-column="2" selection-end-line="6" selection-end-column="2" />
|
|
42
|
+
<folding />
|
|
43
|
+
</state>
|
|
44
|
+
</provider>
|
|
45
|
+
</entry>
|
|
46
|
+
</file>
|
|
47
|
+
</leaf>
|
|
48
|
+
</component>
|
|
49
|
+
<component name="Git.Settings">
|
|
50
|
+
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
|
51
|
+
</component>
|
|
52
|
+
<component name="IdeDocumentHistory">
|
|
53
|
+
<option name="CHANGED_PATHS">
|
|
54
|
+
<list>
|
|
55
|
+
<option value="$PROJECT_DIR$/lib/tubedl.rb" />
|
|
56
|
+
</list>
|
|
57
|
+
</option>
|
|
58
|
+
</component>
|
|
59
|
+
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
|
|
60
|
+
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
|
|
61
|
+
<component name="JsGulpfileManager">
|
|
62
|
+
<detection-done>true</detection-done>
|
|
63
|
+
<sorting>DEFINITION_ORDER</sorting>
|
|
64
|
+
</component>
|
|
65
|
+
<component name="ProjectFrameBounds">
|
|
66
|
+
<option name="y" value="24" />
|
|
67
|
+
<option name="width" value="960" />
|
|
68
|
+
<option name="height" value="1056" />
|
|
69
|
+
</component>
|
|
70
|
+
<component name="ProjectInspectionProfilesVisibleTreeState">
|
|
71
|
+
<entry key="Project Default">
|
|
72
|
+
<profile-state>
|
|
73
|
+
<expanded-state>
|
|
74
|
+
<State>
|
|
75
|
+
<id />
|
|
76
|
+
</State>
|
|
77
|
+
<State>
|
|
78
|
+
<id>Gems</id>
|
|
79
|
+
</State>
|
|
80
|
+
<State>
|
|
81
|
+
<id>Ruby</id>
|
|
82
|
+
</State>
|
|
83
|
+
</expanded-state>
|
|
84
|
+
</profile-state>
|
|
85
|
+
</entry>
|
|
86
|
+
</component>
|
|
87
|
+
<component name="ProjectView">
|
|
88
|
+
<navigator currentView="ProjectPane" proportions="" version="1">
|
|
89
|
+
<flattenPackages />
|
|
90
|
+
<showMembers />
|
|
91
|
+
<showModules />
|
|
92
|
+
<showLibraryContents />
|
|
93
|
+
<hideEmptyPackages />
|
|
94
|
+
<abbreviatePackageNames />
|
|
95
|
+
<autoscrollToSource />
|
|
96
|
+
<autoscrollFromSource />
|
|
97
|
+
<sortByType />
|
|
98
|
+
<manualOrder />
|
|
99
|
+
<foldersAlwaysOnTop value="true" />
|
|
100
|
+
</navigator>
|
|
101
|
+
<panes>
|
|
102
|
+
<pane id="Scope" />
|
|
103
|
+
<pane id="ProjectPane">
|
|
104
|
+
<subPane>
|
|
105
|
+
<expand>
|
|
106
|
+
<path>
|
|
107
|
+
<item name="tubedl" type="b2602c69:ProjectViewProjectNode" />
|
|
108
|
+
<item name="tubedl" type="462c0819:PsiDirectoryNode" />
|
|
109
|
+
</path>
|
|
110
|
+
<path>
|
|
111
|
+
<item name="tubedl" type="b2602c69:ProjectViewProjectNode" />
|
|
112
|
+
<item name="tubedl" type="462c0819:PsiDirectoryNode" />
|
|
113
|
+
<item name="lib" type="462c0819:PsiDirectoryNode" />
|
|
114
|
+
</path>
|
|
115
|
+
</expand>
|
|
116
|
+
<select />
|
|
117
|
+
</subPane>
|
|
118
|
+
</pane>
|
|
119
|
+
<pane id="Scratches" />
|
|
120
|
+
</panes>
|
|
121
|
+
</component>
|
|
122
|
+
<component name="PropertiesComponent">
|
|
123
|
+
<property name="WebServerToolWindowFactoryState" value="false" />
|
|
124
|
+
<property name="settings.editor.selected.configurable" value="org.jetbrains.plugins.ruby.settings.RubyActiveModuleSdkConfigurable" />
|
|
125
|
+
</component>
|
|
126
|
+
<component name="RunDashboard">
|
|
127
|
+
<option name="ruleStates">
|
|
128
|
+
<list>
|
|
129
|
+
<RuleState>
|
|
130
|
+
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
|
|
131
|
+
</RuleState>
|
|
132
|
+
<RuleState>
|
|
133
|
+
<option name="name" value="StatusDashboardGroupingRule" />
|
|
134
|
+
</RuleState>
|
|
135
|
+
</list>
|
|
136
|
+
</option>
|
|
137
|
+
</component>
|
|
138
|
+
<component name="ShelveChangesManager" show_recycled="false">
|
|
139
|
+
<option name="remove_strategy" value="false" />
|
|
140
|
+
</component>
|
|
141
|
+
<component name="SpringUtil" SPRING_PRE_LOADER_OPTION="false" />
|
|
142
|
+
<component name="TaskManager">
|
|
143
|
+
<task active="true" id="Default" summary="Default task">
|
|
144
|
+
<changelist id="99bcc018-28a5-4a4a-b8bd-6450101751a9" name="Default" comment="" />
|
|
145
|
+
<created>1501597537642</created>
|
|
146
|
+
<option name="number" value="Default" />
|
|
147
|
+
<option name="presentableId" value="Default" />
|
|
148
|
+
<updated>1501597537642</updated>
|
|
149
|
+
<workItem from="1501597540110" duration="1025000" />
|
|
150
|
+
<workItem from="1501598575525" duration="688000" />
|
|
151
|
+
</task>
|
|
152
|
+
<servers />
|
|
153
|
+
</component>
|
|
154
|
+
<component name="TimeTrackingManager">
|
|
155
|
+
<option name="totallyTimeSpent" value="1104000" />
|
|
156
|
+
</component>
|
|
157
|
+
<component name="ToolWindowManager">
|
|
158
|
+
<frame x="0" y="24" width="960" height="1056" extended-state="0" />
|
|
159
|
+
<layout>
|
|
160
|
+
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.22173913" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
|
|
161
|
+
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
|
162
|
+
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
|
|
163
|
+
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
|
164
|
+
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
|
165
|
+
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
|
166
|
+
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.18587747" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
|
167
|
+
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
|
|
168
|
+
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
|
|
169
|
+
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
|
170
|
+
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
|
171
|
+
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
|
172
|
+
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33737597" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
|
173
|
+
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
|
|
174
|
+
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
|
175
|
+
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
|
176
|
+
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
|
177
|
+
</layout>
|
|
178
|
+
</component>
|
|
179
|
+
<component name="TypeScriptGeneratedFilesManager">
|
|
180
|
+
<option name="version" value="1" />
|
|
181
|
+
</component>
|
|
182
|
+
<component name="VcsContentAnnotationSettings">
|
|
183
|
+
<option name="myLimit" value="2678400000" />
|
|
184
|
+
</component>
|
|
185
|
+
<component name="XDebuggerManager">
|
|
186
|
+
<breakpoint-manager />
|
|
187
|
+
<watches-manager />
|
|
188
|
+
</component>
|
|
189
|
+
<component name="editorHistoryManager">
|
|
190
|
+
<entry file="file://$PROJECT_DIR$/lib/tubedl.rb">
|
|
191
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
192
|
+
<state relative-caret-position="0">
|
|
193
|
+
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
|
194
|
+
<folding />
|
|
195
|
+
</state>
|
|
196
|
+
</provider>
|
|
197
|
+
</entry>
|
|
198
|
+
<entry file="file://$PROJECT_DIR$/lib/tubedl.rb">
|
|
199
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
200
|
+
<state relative-caret-position="102">
|
|
201
|
+
<caret line="6" column="2" lean-forward="false" selection-start-line="6" selection-start-column="2" selection-end-line="6" selection-end-column="2" />
|
|
202
|
+
<folding />
|
|
203
|
+
</state>
|
|
204
|
+
</provider>
|
|
205
|
+
</entry>
|
|
206
|
+
</component>
|
|
207
|
+
</project>
|
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
|
10
|
+
orientation.
|
|
11
|
+
|
|
12
|
+
## Our Standards
|
|
13
|
+
|
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
|
15
|
+
include:
|
|
16
|
+
|
|
17
|
+
* Using welcoming and inclusive language
|
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
|
19
|
+
* Gracefully accepting constructive criticism
|
|
20
|
+
* Focusing on what is best for the community
|
|
21
|
+
* Showing empathy towards other community members
|
|
22
|
+
|
|
23
|
+
Examples of unacceptable behavior by participants include:
|
|
24
|
+
|
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
|
26
|
+
advances
|
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
|
28
|
+
* Public or private harassment
|
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
|
30
|
+
address, without explicit permission
|
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
32
|
+
professional setting
|
|
33
|
+
|
|
34
|
+
## Our Responsibilities
|
|
35
|
+
|
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
|
38
|
+
response to any instances of unacceptable behavior.
|
|
39
|
+
|
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
|
44
|
+
threatening, offensive, or harmful.
|
|
45
|
+
|
|
46
|
+
## Scope
|
|
47
|
+
|
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
|
49
|
+
when an individual is representing the project or its community. Examples of
|
|
50
|
+
representing a project or community include using an official project e-mail
|
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
|
53
|
+
further defined and clarified by project maintainers.
|
|
54
|
+
|
|
55
|
+
## Enforcement
|
|
56
|
+
|
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
58
|
+
reported by contacting the project team at caglar.gokhan@gmail.com. All
|
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
|
63
|
+
|
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
|
66
|
+
members of the project's leadership.
|
|
67
|
+
|
|
68
|
+
## Attribution
|
|
69
|
+
|
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
|
72
|
+
|
|
73
|
+
[homepage]: http://contributor-covenant.org
|
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 cptangry
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Tubedl
|
|
2
|
+
|
|
3
|
+
Welcome to your Tubedl gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/tubedl`. To experiment with that code, run `bin/console` for an interactive prompt.
|
|
4
|
+
|
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Add this line to your application's Gemfile:
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
gem 'tubedl'
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
And then execute:
|
|
16
|
+
|
|
17
|
+
$ bundle
|
|
18
|
+
|
|
19
|
+
Or install it yourself as:
|
|
20
|
+
|
|
21
|
+
$ gem install tubedl
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```ruby
|
|
26
|
+
require 'tubedl'
|
|
27
|
+
metallica = Tubedl.Playlist.new 'https://www.youtube.com/playlist?list=PLJvQXRgtxlumAHceNRk3cx3P7MZVUCdBl'
|
|
28
|
+
|
|
29
|
+
first_song = metallica.video0001
|
|
30
|
+
object_instances = metallica.instance_variables
|
|
31
|
+
first_song_link = first_song.values.first
|
|
32
|
+
first_songID = Tubedl.get_videoID(first_song_link)
|
|
33
|
+
video_list = metallica.playlist_data
|
|
34
|
+
dowload_links = metallica.playlist_data.values
|
|
35
|
+
whole_page_data = Tubedl.get_page_data(first_song_link)
|
|
36
|
+
specific_resulation = Tubedl.set_quality(first_song_link, 'hd1080')
|
|
37
|
+
metallica.save_playlist
|
|
38
|
+
# Tubedl.load_playlist(path)
|
|
39
|
+
Tubedl.save_object(metallica)
|
|
40
|
+
|
|
41
|
+
# Rusults
|
|
42
|
+
puts first_song
|
|
43
|
+
puts first_songID
|
|
44
|
+
puts first_song_link
|
|
45
|
+
puts object_instances
|
|
46
|
+
puts video_list
|
|
47
|
+
puts dowload_links
|
|
48
|
+
# puts whole_page_data
|
|
49
|
+
puts specific_resulation
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Development
|
|
53
|
+
|
|
54
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
55
|
+
|
|
56
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
57
|
+
|
|
58
|
+
## Contributing
|
|
59
|
+
|
|
60
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/cptangry/tubedl. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
|
65
|
+
|
|
66
|
+
## Code of Conduct
|
|
67
|
+
|
|
68
|
+
Everyone interacting in the Tubedl project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/tubedl/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "tubedl"
|
|
5
|
+
|
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
|
8
|
+
|
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
10
|
+
# require "pry"
|
|
11
|
+
# Pry.start
|
|
12
|
+
|
|
13
|
+
require "irb"
|
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/lib/tubedl.rb
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
require_relative 'tubedl/version'
|
|
2
|
+
require_relative 'tubedl/playlist_parser'
|
|
3
|
+
require 'nokogiri'
|
|
4
|
+
require 'open-uri'
|
|
5
|
+
require 'yaml'
|
|
6
|
+
|
|
7
|
+
module Tubedl
|
|
8
|
+
include PlaylistParser
|
|
9
|
+
|
|
10
|
+
QULITIES = {
|
|
11
|
+
hd1440: '?version=3&vq=hd1440',
|
|
12
|
+
hd1080: '?version=3&vq=hd1080',
|
|
13
|
+
hd720: '?version=3&vq=hd720',
|
|
14
|
+
sd480: '?version=3&vq=large',
|
|
15
|
+
sd360: '?version=3&vq=medium',
|
|
16
|
+
sd240: '?version=3&vq=small'
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
def self.get_videoID(link)
|
|
20
|
+
link.match(PlaylistParser::YoutubeRegex)[5]
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.set_quality(str, quality)
|
|
24
|
+
str + QULITIES[quality.to_sym]
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def self.get_page_data(url)
|
|
28
|
+
begin
|
|
29
|
+
doc = Nokogiri::HTML(open(url).read)
|
|
30
|
+
rescue Timeout::Error
|
|
31
|
+
STDERR.puts "Timeout while connecting to: #{urlHash}"
|
|
32
|
+
STDERR.puts 'Retrying...'
|
|
33
|
+
retry
|
|
34
|
+
end
|
|
35
|
+
doc
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def self.load_playlist(file_path)
|
|
39
|
+
YAML.load_file(file_path)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def self.save_object(object)
|
|
43
|
+
File.write("#{object}.yml", YAML.dump(object))
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
module PlaylistParser
|
|
2
|
+
YoutubeRegex = /(youtu\.be\/|youtube\.com\/(watch\?(.*&)?v=|(embed|v)\/))([^\?&"'>]+)/
|
|
3
|
+
|
|
4
|
+
class Playlist
|
|
5
|
+
attr_reader :playlistID, :playlist, :playlist_data
|
|
6
|
+
|
|
7
|
+
def initialize(link = nil)
|
|
8
|
+
counter = 'video0000'
|
|
9
|
+
link ||= link_generator
|
|
10
|
+
@playlist_data = parse_page(Nokogiri::HTML(open(link).read))
|
|
11
|
+
@playlist_data.each_pair do |video_name, video_link|
|
|
12
|
+
instance_variable_set('@playlistID', rand(1..(2**30 - 1)))
|
|
13
|
+
instance_variable_set("@#{counter.succ!}", video_name => "https://#{video_link}")
|
|
14
|
+
self.class.send(:attr_reader, counter)
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def link_generator(ln = nil)
|
|
19
|
+
print 'Please Enter A Correct Playlist Link: ' unless ln || ARGV[0]
|
|
20
|
+
ln ||= ARGV[0] || gets.chomp
|
|
21
|
+
if ln && is_playlist?(ln)
|
|
22
|
+
return ln
|
|
23
|
+
else
|
|
24
|
+
link_generator
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def parse_page(page)
|
|
29
|
+
playlist_data = page.css('table.pl-video-table')
|
|
30
|
+
if playlist_data
|
|
31
|
+
songs_hashes = Hash[playlist_data.css('a.pl-video-title-link').map do |ln|
|
|
32
|
+
[ln.text.strip, "https://www.youtube.com#{ln['href']}".match(YoutubeRegex)[0]]
|
|
33
|
+
end]
|
|
34
|
+
end
|
|
35
|
+
songs_hashes
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def is_playlist?(link)
|
|
39
|
+
link.include? 'list' && 'playlist'
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def save_playlist
|
|
45
|
+
File.write("Playlist-#{Time.now.to_a[3..5].join('-')}.yml", @playlist_data.to_yaml)
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
data/tubedl.gemspec
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require_relative "lib/tubedl/version"
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = "tubedl"
|
|
8
|
+
spec.version = Tubedl::VERSION
|
|
9
|
+
spec.authors = ["Gökhan Çağlar"]
|
|
10
|
+
spec.email = ["caglar.gokhan@gmail.com"]
|
|
11
|
+
|
|
12
|
+
spec.summary = %q{This gem parses youtube playlists to an object with an instance that named as playlist_data(hash: video_names => links)
|
|
13
|
+
also can save that instance as yaml, can check a video link format with regex, can create link to specific resulation
|
|
14
|
+
can take whole page data of a link, can take video ID from link and can save object as yaml }
|
|
15
|
+
spec.description = %q{This gem parses youtube playlists to an object with an instance that named as playlist_data(hash: video_names => links)
|
|
16
|
+
also can save that instance as yaml, can check a video link format with regex, can create link to specific resulation
|
|
17
|
+
can take whole page data of a link, can take video ID from link and can save object as yaml }
|
|
18
|
+
spec.homepage = "https://github.com/cptangry/tubedl"
|
|
19
|
+
spec.license = "MIT"
|
|
20
|
+
|
|
21
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
|
22
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
|
23
|
+
if spec.respond_to?(:metadata)
|
|
24
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org/"
|
|
25
|
+
else
|
|
26
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
|
27
|
+
"public gem pushes."
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
31
|
+
f.match(%r{^(test|spec|features)/})
|
|
32
|
+
end
|
|
33
|
+
spec.bindir = "bin"
|
|
34
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
35
|
+
spec.require_paths = ["lib"]
|
|
36
|
+
|
|
37
|
+
spec.required_ruby_version = '~> 2.0'
|
|
38
|
+
spec.add_development_dependency "bundler", "~> 1.15"
|
|
39
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
|
40
|
+
spec.add_development_dependency "minitest", "~> 5.0"
|
|
41
|
+
spec.add_development_dependency "nokogiri", '~> 1.8'
|
|
42
|
+
|
|
43
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: tubedl
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.6
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Gökhan Çağlar
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2017-08-15 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: bundler
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.15'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.15'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rake
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '10.0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '10.0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: minitest
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '5.0'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '5.0'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: nokogiri
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - "~>"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '1.8'
|
|
62
|
+
type: :development
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - "~>"
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '1.8'
|
|
69
|
+
description: "This gem parses youtube playlists to an object with an instance that
|
|
70
|
+
named as playlist_data(hash: video_names => links)\n also
|
|
71
|
+
can save that instance as yaml, can check a video link format with regex, can create
|
|
72
|
+
link to specific resulation\n can take whole page data
|
|
73
|
+
of a link, can take video ID from link and can save object as yaml "
|
|
74
|
+
email:
|
|
75
|
+
- caglar.gokhan@gmail.com
|
|
76
|
+
executables: []
|
|
77
|
+
extensions: []
|
|
78
|
+
extra_rdoc_files: []
|
|
79
|
+
files:
|
|
80
|
+
- ".gitignore"
|
|
81
|
+
- ".idea/.rakeTasks"
|
|
82
|
+
- ".idea/dictionaries/gokhan.xml"
|
|
83
|
+
- ".idea/inspectionProfiles/Project_Default.xml"
|
|
84
|
+
- ".idea/inspectionProfiles/profiles_settings.xml"
|
|
85
|
+
- ".idea/misc.xml"
|
|
86
|
+
- ".idea/modules.xml"
|
|
87
|
+
- ".idea/tubedl.iml"
|
|
88
|
+
- ".idea/vcs.xml"
|
|
89
|
+
- ".idea/workspace.xml"
|
|
90
|
+
- ".travis.yml"
|
|
91
|
+
- CODE_OF_CONDUCT.md
|
|
92
|
+
- Gemfile
|
|
93
|
+
- LICENSE.txt
|
|
94
|
+
- README.md
|
|
95
|
+
- Rakefile
|
|
96
|
+
- bin/console
|
|
97
|
+
- bin/setup
|
|
98
|
+
- lib/tubedl.rb
|
|
99
|
+
- lib/tubedl/playlist_parser.rb
|
|
100
|
+
- lib/tubedl/version.rb
|
|
101
|
+
- lib/tubedl/youtube_video.rb
|
|
102
|
+
- tubedl.gemspec
|
|
103
|
+
homepage: https://github.com/cptangry/tubedl
|
|
104
|
+
licenses:
|
|
105
|
+
- MIT
|
|
106
|
+
metadata:
|
|
107
|
+
allowed_push_host: https://rubygems.org/
|
|
108
|
+
post_install_message:
|
|
109
|
+
rdoc_options: []
|
|
110
|
+
require_paths:
|
|
111
|
+
- lib
|
|
112
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
113
|
+
requirements:
|
|
114
|
+
- - "~>"
|
|
115
|
+
- !ruby/object:Gem::Version
|
|
116
|
+
version: '2.0'
|
|
117
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
|
+
requirements:
|
|
119
|
+
- - ">="
|
|
120
|
+
- !ruby/object:Gem::Version
|
|
121
|
+
version: '0'
|
|
122
|
+
requirements: []
|
|
123
|
+
rubyforge_project:
|
|
124
|
+
rubygems_version: 2.6.12
|
|
125
|
+
signing_key:
|
|
126
|
+
specification_version: 4
|
|
127
|
+
summary: 'This gem parses youtube playlists to an object with an instance that named
|
|
128
|
+
as playlist_data(hash: video_names => links) also can save that instance as yaml,
|
|
129
|
+
can check a video link format with regex, can create link to specific resulation
|
|
130
|
+
can take whole page data of a link, can take video ID from link and can save object
|
|
131
|
+
as yaml'
|
|
132
|
+
test_files: []
|