diff --git a/app.json b/app.json index 2708b01..b886c45 100644 --- a/app.json +++ b/app.json @@ -20,7 +20,7 @@ ], "name": "spotiloader", "slug": "spotiloader", - "version": "1.0.0", + "version": "1.0.1", "orientation": "portrait", "icon": "./assets/icon.png", "userInterfaceStyle": "automatic", @@ -37,17 +37,31 @@ ], "ios": { "supportsTablet": true, - "bundleIdentifier": "com.jabedzaman.spotiloader" + "bundleIdentifier": "com.jabedzaman.spotiloader", + "infoPlist": { + "NSPhotoLibraryUsageDescription": "Allow spotiloader to access your photos.", + "NSPhotoLibraryAddUsageDescription": "Allow spotiloader to save photos." + } }, "android": { "adaptiveIcon": { "foregroundImage": "./assets/adaptive-icon.png", "backgroundColor": "#FFFFFF" }, - "package": "com.jabedzaman.spotiloader" + "package": "com.jabedzaman.spotiloader", + "permissions": [ + "android.permission.READ_EXTERNAL_STORAGE", + "android.permission.WRITE_EXTERNAL_STORAGE", + "android.permission.ACCESS_MEDIA_LOCATION" + ] }, "web": { "favicon": "./assets/favicon.png" + }, + "extra": { + "eas": { + "projectId": "a2cde989-521c-4c6c-8948-336b09633922" + } } } -} \ No newline at end of file +} diff --git a/assets/splash.png b/assets/splash.png index 51e42be..b7733c5 100644 Binary files a/assets/splash.png and b/assets/splash.png differ diff --git a/changelog.md b/changelog.md index 4d4a14f..4151fc4 100644 --- a/changelog.md +++ b/changelog.md @@ -6,3 +6,15 @@ Whats New !!! 🎉🎈 - Search Playlist or track from Spotify - Download Playlist or track on Spotify + +## v 1.0.1 + +Whats New !!! 🎉🎈 + +- Added a new feature to download videos from YouTube as mp3 + +### Bug Fixes + +- Fixed a bug where the app would not show icons on the home screen +- Fixed a bug where the app would redirect to donation url +- Other minor bug fixes diff --git a/config/app.config.js b/config/app.config.js index 389d83f..ac8beb9 100644 --- a/config/app.config.js +++ b/config/app.config.js @@ -3,6 +3,7 @@ const name = "spotiloader"; const downloadUrl = "https://jabed.me"; const author = "Jabed Zaman"; const githubUrl ="https://github.com/jabedzaman/spotiloader"; +const patreonUrl = "https://patreon.com/jabedzaman"; const config = { version, @@ -10,6 +11,7 @@ const config = { downloadUrl, author, githubUrl, + patreonUrl, }; export default config; diff --git a/package-lock.json b/package-lock.json index db07084..83e5559 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,14 @@ { "name": "spotiloader", - "version": "1.0.0", + "version": "1.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "spotiloader", - "version": "1.0.0", + "version": "1.0.1", "dependencies": { + "@react-native-picker/picker": "^2.4.8", "@react-navigation/bottom-tabs": "^6.5.3", "@react-navigation/native": "^6.1.2", "@react-navigation/native-stack": "^6.9.8", @@ -4508,6 +4509,15 @@ "node": ">=8" } }, + "node_modules/@react-native-picker/picker": { + "version": "2.4.8", + "resolved": "https://registry.npmjs.org/@react-native-picker/picker/-/picker-2.4.8.tgz", + "integrity": "sha512-5NQ5XPo1B03YNqKFrV6h9L3CQaHlB80wd4ETHUEABRP2iLh7FHLVObX2GfziD+K/VJb8G4KZcZ23NFBFP1f7bg==", + "peerDependencies": { + "react": ">=16", + "react-native": ">=0.57" + } + }, "node_modules/@react-native/assets": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@react-native/assets/-/assets-1.0.0.tgz", @@ -16435,6 +16445,12 @@ "joi": "^17.2.1" } }, + "@react-native-picker/picker": { + "version": "2.4.8", + "resolved": "https://registry.npmjs.org/@react-native-picker/picker/-/picker-2.4.8.tgz", + "integrity": "sha512-5NQ5XPo1B03YNqKFrV6h9L3CQaHlB80wd4ETHUEABRP2iLh7FHLVObX2GfziD+K/VJb8G4KZcZ23NFBFP1f7bg==", + "requires": {} + }, "@react-native/assets": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@react-native/assets/-/assets-1.0.0.tgz", diff --git a/package.json b/package.json index 6b75108..752e9bb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "spotiloader", - "version": "1.0.0", - "description": "A simple app to download songs from Spotify", + "version": "1.0.1", + "description": "Multiplatform Music Downloader", "author": { "name": "Jabed Zaman" }, @@ -13,6 +13,7 @@ "web": "expo start --web" }, "dependencies": { + "@react-native-picker/picker": "^2.4.8", "@react-navigation/bottom-tabs": "^6.5.3", "@react-navigation/native": "^6.1.2", "@react-navigation/native-stack": "^6.9.8", @@ -20,17 +21,17 @@ "expo": "~47.0.12", "expo-file-system": "~15.1.1", "expo-font": "~11.0.1", + "expo-media-library": "~15.0.0", + "expo-network": "~5.0.0", + "expo-notifications": "~0.17.0", + "expo-permissions": "~14.0.0", "expo-status-bar": "~1.4.2", "react": "18.1.0", "react-native": "0.70.5", "react-native-elements": "^3.4.3", "react-native-safe-area-context": "4.4.1", "react-native-screens": "~3.18.0", - "react-native-vector-icons": "^9.2.0", - "expo-permissions": "~14.0.0", - "expo-media-library": "~15.0.0", - "expo-network": "~5.0.0", - "expo-notifications": "~0.17.0" + "react-native-vector-icons": "^9.2.0" }, "devDependencies": { "@babel/core": "^7.12.9" diff --git a/readme.md b/readme.md index 3e02c41..e19ff24 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,6 @@ # Spotiloader -- **React Native Multiplatform** Music Downloader ,supports **Spotify only at this moment**.
+- **React Native Multiplatform** Music Downloader ,supports **Spotify & YouTube**.
Download Spotfy Tracks or Playlists from URL and save them locally to listen while offline !!! @@ -12,6 +12,7 @@ Download Spotfy Tracks or Playlists from URL and save them locally to listen whi ### Supported Platforms: - Spotify +- YouTube - (more coming soon) @@ -19,7 +20,7 @@ Download Spotfy Tracks or Playlists from URL and save them locally to listen whi | Platform | Download | Status | |----------|----------|--------| -| Android |[![Download Button](https://img.shields.io/github/v/release/jabedzaman/spotiloader?color=7885FF&label=Android-Apk&logo=android&style=for-the-badge)](https://github.com/jabedzaman/)| ✅ Stable | +| Android |[![Download Button](https://img.shields.io/github/v/release/jabedzaman/spotiloader?color=7885FF&label=Android-Apk&logo=android&style=for-the-badge)](https://github.com/jabedzaman/spotiloader/releases)| ✅ Stable | ### Permissions required: @@ -29,12 +30,10 @@ Download Spotfy Tracks or Playlists from URL and save them locally to listen whi ### Todos - [ ] Add download progress bar -- [ ] Add other platform support -- [ ] Add inbuilt player +- [x] Add other platform support - [ ] Add Dark Mode - [ ] Add search history -- [ ] Add seach with suggestions -- [ ] Add downlaod with meta data +- [ ] Add downlaod with meta data - [ ] Write Tests **GPL-3.0 License** diff --git a/screens/Home.jsx b/screens/Home.jsx index 3bfe2fb..81a310c 100644 --- a/screens/Home.jsx +++ b/screens/Home.jsx @@ -7,7 +7,6 @@ import { TouchableOpacity, } from "react-native"; import React, { useState } from "react"; -import Hero from "../components/Hero"; import { Button, Icon, @@ -25,17 +24,21 @@ import * as MediaLibrary from "expo-media-library"; import * as FileSystem from "expo-file-system"; import permissionRequest from "../utils/permissionRequest"; import secrets from "../config/apikey.config"; +import { Picker } from "@react-native-picker/picker"; +import { Alert } from "react-native"; const Home = () => { const [input, setInput] = useState(""); const [tracklist, setTracklist] = useState([]); const [track, setTrack] = useState([]); + const [info, setInfo] = useState([]); const [downloadlink, setDownloadlink] = useState(""); const [downloading, setDownloading] = useState(false); const [downloaded, setDownloaded] = useState(false); const [loading, setLoading] = useState(false); const [error, setError] = useState(false); const [networkError, setNetworkError] = useState(false); + const [selectedValue, setSelectedValue] = useState(""); const networkStatus = getNetworkStatus(); const apiKey = secrets.apikey; const apiHost = secrets.apihost; @@ -51,6 +54,16 @@ const Home = () => { }; const getTracklist = async () => { + if (selectedValue === "1") { + getSpotifyPlaylist(); + } else if (selectedValue === "2") { + getYoutbeTrack(); + } else { + Alert.alert("WARNING!!", "Must select a source"); + } + }; + + const getSpotifyPlaylist = async () => { if (!networkStatus) { setNetworkError(true); return; @@ -73,6 +86,45 @@ const Home = () => { } }; + const getYoutbeTrack = async () => { + if (!networkStatus) { + setNetworkError(true); + return; + } + try { + setLoading(true); + const response = await axios.get( + `https://ytdlapi.jabed.me/info?url=${input}` + ); + console.log(response.data.embedinfo); + setInfo(response.data.embedinfo); + setLoading(false); + } catch (error) { + setError(true); + console.log(error); + setTimeout(() => { + setError(false); + }, 5000); + setLoading(false); + } + }; + + const saveytTrack = async (uri, title) => { + if (!networkStatus) { + setNetworkError(true); + return; + } + permissionRequest(); + setDownloading(true); + const file = await FileSystem.downloadAsync( + `https://ytdlapi.jabed.me/download?url=${uri}`, + FileSystem.documentDirectory + `download.mp3` + ); + setDownloading(false); + await MediaLibrary.createAssetAsync(file.uri); + setDownloaded(true); + }; + const saveTrack = async (uri, title) => { if (!networkStatus) { setNetworkError(true); @@ -119,33 +171,19 @@ const Home = () => { value={input} onChangeText={(text) => setInput(text)} /> + setSelectedValue(itemValue)} + style={{ + marginHorizontal: 20, + }} + > + + + + -