Skip to content

Commit

Permalink
Release 1.5 on Playstore
Browse files Browse the repository at this point in the history
  • Loading branch information
samadritsarkar2 committed Jun 23, 2021
1 parent 10138ae commit 3164efb
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 62 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/main-cd.yml

This file was deleted.

6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ Download Apk
Downify wants to make sure that, no one is deprived of music on that long road trip or airplane when there is no Internet Connection.
You can download your Spotify playlists/albums in advance and enjoy music everywhere. And that too without annoying ads.
</h3>
<br>
<br>

# Screenshots

Expand All @@ -32,7 +30,6 @@ You can download your Spotify playlists/albums in advance and enjoy music everyw
<img src="screenshots/5.png" width="200" />
</div>
<br>
<br>

# Changelog

Expand All @@ -55,7 +52,7 @@ You can download your Spotify playlists/albums in advance and enjoy music everyw

# How it works?

It uses <a href="https://developer.spotify.com/">Spotify offical API</a> to fetch the tracks and Youtube(youtube-dl) to download the tracks.
It uses <a href="https://developer.spotify.com/">Spotify offical API</a> to fetch the tracks and Youtube(youtube-dl) to download the tracks. All that happens in server side and the app just downloads the mp3 file for later.

P.S:- ~~I have written a lot of Bad code, I will start improving the app and code soon.~~
I improved the code a little bit and the overall code structure. Will work on it soon.
Expand All @@ -71,6 +68,7 @@ I improved the code a little bit and the overall code structure. Will work on it
- While a track(/s) is getting downloaded from a particular playlist, if user exists the screen or another playlist is loaded, then the download gets cancelled.
- Few playlist may give error unexpectedly.
- Due to youtube policies, few songs are not downloadable. This is because some videos are regionally restriced or so. [See these limitations](https://github.com/fent/node-ytdl-core#limitations)
- Youtube server gives `429 error`.
- Downloads wrong tracks
- If you encounter anything else, feel free to report an issue or DM me. I will definetly work on it.

Expand Down
5 changes: 3 additions & 2 deletions src/components/Downloads.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ const Downloads = ({navigation}) => {
onPress={() => {
dispatch(allActions.playOne(item));
}}
style={{flex: 1, marginBottom: 15}}
style={styles.itemClickWrapper}
onLongPress={() => handleLongPress(item)}>
<View style={styles.itemWrapper}>
<Image
Expand Down Expand Up @@ -189,6 +189,7 @@ const styles = StyleSheet.create({
alignSelf: 'center',
marginTop: '5%',
},
itemClickWrapper: {flex: 1, marginBottom: 15},
itemWrapper: {
flex: 1,
flexDirection: 'row',
Expand All @@ -208,7 +209,7 @@ const styles = StyleSheet.create({
trackArtwork: {
flex: 1,
marginRight: 20,
height: '100%',
height: '90%',
aspectRatio: 1 / 1,
alignSelf: 'center',
borderRadius: 6,
Expand Down
66 changes: 50 additions & 16 deletions src/components/KnowMore.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ const KnowMore = ({isModalVisible, toggleModal}) => {
<ScrollView
showsVerticalScrollIndicator={false}
style={{margin: 10}}>
{/* // Changelog */}

<View style={styles.faqOne}>
<Text style={styles.faqQuestion}>Changelog v1.5</Text>
<Text style={styles.faqAnswer}>
Expand All @@ -62,6 +64,33 @@ const KnowMore = ({isModalVisible, toggleModal}) => {
{'\u25CF'} UI changes and few minor changes too.
</Text>
</View>
{/* // ISSUES */}
<View style={styles.faqOne}>
<Text style={styles.faqQuestion}>Issues :(</Text>
<Text style={styles.faqAnswer}>
{'\u25CF'} While a track(s) is downloaded from a specific
playlist, the download may be cancelled if a user exists that
screen, or if an other playlist is loaded. Rather, user may
minimize the app
</Text>
<Text style={styles.faqAnswer}>
{'\u25CF'} Few playlist may give error unexpectedly.
</Text>
<Text style={styles.faqAnswer}>
{'\u25CF'} Due to youtube policies, few songs are not
downloadable.
</Text>
<Text style={styles.faqAnswer}>
{'\u25CF'} Downloads wrong tracks
</Text>
<Text style={styles.faqAnswer}>
{'\u25CF'} If you encounter anything else, feel free to report
an issue or DM me. I will definetly work on it.
</Text>
</View>

{/* // How to use */}

<View style={styles.faqOne}>
<Text style={styles.faqQuestion}>How to use?</Text>
<Text style={styles.faqAnswer}>
Expand All @@ -71,12 +100,16 @@ const KnowMore = ({isModalVisible, toggleModal}) => {
</Text>
<Text style={styles.faqAnswer}>
{' '}
2. Paste the link in Add New screen. Now, you can download the
tracks.{' '}
2. Paste the link in Add New screen.
</Text>
<Text style={styles.faqAnswer}>
{' '}
3. You can save the Playlist in Library for later.{' '}
3. You can save the Playlist in Library for later.
</Text>
<Text style={styles.faqAnswer}>
{' '}
4. Downloaded tracks will be in Download Folder. Single tap to
Play or Long tap to Add to Queue.
</Text>
</View>

Expand All @@ -85,19 +118,20 @@ const KnowMore = ({isModalVisible, toggleModal}) => {
<Text style={styles.faqAnswer}>
The app searches the songs in your playlist or albums in
Youtube and downloads the first result. I will try to make a
detailed System Design doc soon.
</Text>
<Text
onPress={() =>
handleLink('https://github.com/samadritsarkar2/spotifydown')
}
style={{
alignSelf: 'center',
fontSize: 15,
marginTop: 5,
color: '#0588BC',
}}>
{'<GithubRepo here />'}
detailed System Design doc soon. For more info :{' '}
<Text
onPress={() =>
handleLink(
'https://github.com/samadritsarkar2/spotifydown',
)
}
style={{
fontSize: 15,

color: '#0588BC',
}}>
{'<GithubRepo here />'}
</Text>
</Text>
</View>
<View style={styles.faqOne}>
Expand Down
45 changes: 37 additions & 8 deletions src/components/Playlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,20 +154,30 @@ const Playlist = ({navigation, route}) => {
}, [isFocused]);

const downloader = async (single) => {
const api = `${API}/download?passedQuery=`;
const api = `${API}/download?`;
const req = perm();
const fileStatus = await checkExists(single);
if (req) {
if (!fileStatus.path) {
setVisible(true);
setCurentDownloading(single.id);
let artistsString = single.artist.map((item) => item.name).join();
let passedQuery =
single.title + ' ' + single.album + ' ' + artistsString;

const response = await fetch(api + encodeURIComponent(passedQuery));

response.json().then((res) => {
let passedQuery = single.title + ' ' + single.album + ' ' + artistsString;
const params = {
title : single.title,
album : single.album,
artistsString
}
const url = new URL(api);
let query = Object.keys(params)
.map(k => encodeURIComponent(k) + '=' + encodeURIComponent(params[k]))
.join('&');
// url.search = new URLSearchParams(params).toString();
//console.log(api+query);
const response = await fetch(api+query);

response.json()
.then((res) => {
// console.log('link fetched ....');
let link = res.url;
let duration = res.duration;
Expand Down Expand Up @@ -262,6 +272,8 @@ const Playlist = ({navigation, route}) => {
console.log('Download canceled due to error: ', error);
setDownloadPercent(0);
setVisible(false);
setCurentDownloading(null);

Snackbar.show({
text:
'Pardon! Could not download this particular file due to Youtube policies',
Expand All @@ -271,6 +283,9 @@ const Playlist = ({navigation, route}) => {
resolve('Failed');
});
} else {
setDownloadPercent(0);
setVisible(false);
setCurentDownloading(null);
Snackbar.show({
text: 'Server Error',
duration: Snackbar.LENGTH_SHORT,
Expand All @@ -280,7 +295,21 @@ const Playlist = ({navigation, route}) => {
});

return promise;
});
})
.catch((error) => {
console.log('Download canceled due to error: ', error);
setDownloadPercent(0);
setVisible(false);
setCurentDownloading(null);

Snackbar.show({
text:
'Something went wrong in the server',
duration: Snackbar.LENGTH_SHORT,
backgroundColor: 'red',
});
//resolve('Failed');
})
}
} else {
Alert.alert(
Expand Down

0 comments on commit 3164efb

Please sign in to comment.